!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).TXLivePusher=e()}(this,(function(){"use strict";function t(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(r){if("default"!==r&&!(r in t)){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}}))})),Object.freeze(t)}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(t){return t&&t.Math==Math&&t},i=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")(),n=function(t){try{return!!t()}catch(t){return!0}},o=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=o,a=Function.prototype,u=a.apply,h=a.call,c="object"==typeof Reflect&&Reflect.apply||(s?h.bind(u):function(){return h.apply(u,arguments)}),l=o,d=Function.prototype,f=d.bind,p=d.call,m=l&&f.bind(p,p),v=l?function(t){return t&&m(t)}:function(t){return t&&function(){return p.apply(t,arguments)}},_=function(t){return"function"==typeof t},y={},g=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),b=o,T=Function.prototype.call,E=b?T.bind(T):function(){return T.apply(T,arguments)},x={},R={}.propertyIsEnumerable,S=Object.getOwnPropertyDescriptor,A=S&&!R.call({1:2},1);x.f=A?function(t){var e=S(this,t);return!!e&&e.enumerable}:R;var I,C,O=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},w=v,P=w({}.toString),N=w("".slice),M=function(t){return N(P(t),8,-1)},D=n,L=M,U=Object,F=v("".split),G=D((function(){return!U("z").propertyIsEnumerable(0)}))?function(t){return"String"==L(t)?F(t,""):U(t)}:U,B=TypeError,k=function(t){if(null==t)throw B("Can't call method on "+t);return t},X=G,H=k,j=function(t){return X(H(t))},V=_,Y=function(t){return"object"==typeof t?null!==t:V(t)},W={},z=W,Z=i,K=_,q=function(t){return K(t)?t:void 0},J=function(t,e){return arguments.length<2?q(z[t])||q(Z[t]):z[t]&&z[t][e]||Z[t]&&Z[t][e]},Q=v({}.isPrototypeOf),$=J("navigator","userAgent")||"",tt=i,et=$,rt=tt.process,it=tt.Deno,nt=rt&&rt.versions||it&&it.version,ot=nt&&nt.v8;ot&&(C=(I=ot.split("."))[0]>0&&I[0]<4?1:+(I[0]+I[1])),!C&&et&&(!(I=et.match(/Edge\/(\d+)/))||I[1]>=74)&&(I=et.match(/Chrome\/(\d+)/))&&(C=+I[1]);var st=C,at=st,ut=n,ht=!!Object.getOwnPropertySymbols&&!ut((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&at&&at<41})),ct=ht&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,lt=J,dt=_,ft=Q,pt=Object,mt=ct?function(t){return"symbol"==typeof t}:function(t){var e=lt("Symbol");return dt(e)&&ft(e.prototype,pt(t))},vt=String,_t=function(t){try{return vt(t)}catch(t){return"Object"}},yt=_,gt=_t,bt=TypeError,Tt=function(t){if(yt(t))return t;throw bt(gt(t)+" is not a function")},Et=Tt,xt=function(t,e){var r=t[e];return null==r?void 0:Et(r)},Rt=E,St=_,At=Y,It=TypeError,Ct={exports:{}},Ot=i,wt=Object.defineProperty,Pt=function(t,e){try{wt(Ot,t,{value:e,configurable:!0,writable:!0})}catch(r){Ot[t]=e}return e},Nt="__core-js_shared__",Mt=i[Nt]||Pt(Nt,{}),Dt=Mt;(Ct.exports=function(t,e){return Dt[t]||(Dt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.23.4",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE",source:"https://github.com/zloirock/core-js"});var Lt=k,Ut=Object,Ft=function(t){return Ut(Lt(t))},Gt=Ft,Bt=v({}.hasOwnProperty),kt=Object.hasOwn||function(t,e){return Bt(Gt(t),e)},Xt=v,Ht=0,jt=Math.random(),Vt=Xt(1..toString),Yt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Vt(++Ht+jt,36)},Wt=i,zt=Ct.exports,Zt=kt,Kt=Yt,qt=ht,Jt=ct,Qt=zt("wks"),$t=Wt.Symbol,te=$t&&$t.for,ee=Jt?$t:$t&&$t.withoutSetter||Kt,re=function(t){if(!Zt(Qt,t)||!qt&&"string"!=typeof Qt[t]){var e="Symbol."+t;qt&&Zt($t,t)?Qt[t]=$t[t]:Qt[t]=Jt&&te?te(e):ee(e)}return Qt[t]},ie=E,ne=Y,oe=mt,se=xt,ae=function(t,e){var r,i;if("string"===e&&St(r=t.toString)&&!At(i=Rt(r,t)))return i;if(St(r=t.valueOf)&&!At(i=Rt(r,t)))return i;if("string"!==e&&St(r=t.toString)&&!At(i=Rt(r,t)))return i;throw It("Can't convert object to primitive value")},ue=TypeError,he=re("toPrimitive"),ce=function(t,e){if(!ne(t)||oe(t))return t;var r,i=se(t,he);if(i){if(void 0===e&&(e="default"),r=ie(i,t,e),!ne(r)||oe(r))return r;throw ue("Can't convert object to primitive value")}return void 0===e&&(e="number"),ae(t,e)},le=mt,de=function(t){var e=ce(t,"string");return le(e)?e:e+""},fe=Y,pe=i.document,me=fe(pe)&&fe(pe.createElement),ve=function(t){return me?pe.createElement(t):{}},_e=ve,ye=!g&&!n((function(){return 7!=Object.defineProperty(_e("div"),"a",{get:function(){return 7}}).a})),ge=g,be=E,Te=x,Ee=O,xe=j,Re=de,Se=kt,Ae=ye,Ie=Object.getOwnPropertyDescriptor;y.f=ge?Ie:function(t,e){if(t=xe(t),e=Re(e),Ae)try{return Ie(t,e)}catch(t){}if(Se(t,e))return Ee(!be(Te.f,t,e),t[e])};var Ce=n,Oe=_,we=/#|\.prototype\./,Pe=function(t,e){var r=Me[Ne(t)];return r==Le||r!=De&&(Oe(e)?Ce(e):!!e)},Ne=Pe.normalize=function(t){return String(t).replace(we,".").toLowerCase()},Me=Pe.data={},De=Pe.NATIVE="N",Le=Pe.POLYFILL="P",Ue=Pe,Fe=Tt,Ge=o,Be=v(v.bind),ke=function(t,e){return Fe(t),void 0===e?t:Ge?Be(t,e):function(){return t.apply(e,arguments)}},Xe={},He=g&&n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),je=Y,Ve=String,Ye=TypeError,We=function(t){if(je(t))return t;throw Ye(Ve(t)+" is not an object")},ze=g,Ze=ye,Ke=He,qe=We,Je=de,Qe=TypeError,$e=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,er="enumerable",rr="configurable",ir="writable";Xe.f=ze?Ke?function(t,e,r){if(qe(t),e=Je(e),qe(r),"function"==typeof t&&"prototype"===e&&"value"in r&&ir in r&&!r.writable){var i=tr(t,e);i&&i.writable&&(t[e]=r.value,r={configurable:rr in r?r.configurable:i.configurable,enumerable:er in r?r.enumerable:i.enumerable,writable:!1})}return $e(t,e,r)}:$e:function(t,e,r){if(qe(t),e=Je(e),qe(r),Ze)try{return $e(t,e,r)}catch(t){}if("get"in r||"set"in r)throw Qe("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var nr=Xe,or=O,sr=g?function(t,e,r){return nr.f(t,e,or(1,r))}:function(t,e,r){return t[e]=r,t},ar=i,ur=c,hr=v,cr=_,lr=y.f,dr=Ue,fr=W,pr=ke,mr=sr,vr=kt,_r=function(t){var e=function(r,i,n){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,i)}return new t(r,i,n)}return ur(t,this,arguments)};return e.prototype=t.prototype,e},yr=function(t,e){var r,i,n,o,s,a,u,h,c=t.target,l=t.global,d=t.stat,f=t.proto,p=l?ar:d?ar[c]:(ar[c]||{}).prototype,m=l?fr:fr[c]||mr(fr,c,{})[c],v=m.prototype;for(n in e)r=!dr(l?n:c+(d?".":"#")+n,t.forced)&&p&&vr(p,n),s=m[n],r&&(a=t.dontCallGetSet?(h=lr(p,n))&&h.value:p[n]),o=r&&a?a:e[n],r&&typeof s==typeof o||(u=t.bind&&r?pr(o,ar):t.wrap&&r?_r(o):f&&cr(o)?hr(o):o,(t.sham||o&&o.sham||s&&s.sham)&&mr(u,"sham",!0),mr(m,n,u),f&&(vr(fr,i=c+"Prototype")||mr(fr,i,{}),mr(fr[i],n,o),t.real&&v&&!v[n]&&mr(v,n,o)))},gr=M,br=Array.isArray||function(t){return"Array"==gr(t)},Tr=Math.ceil,Er=Math.floor,xr=Math.trunc||function(t){var e=+t;return(e>0?Er:Tr)(e)},Rr=xr,Sr=function(t){var e=+t;return e!=e||0===e?0:Rr(e)},Ar=Sr,Ir=Math.min,Cr=function(t){return t>0?Ir(Ar(t),9007199254740991):0},Or=Cr,wr=function(t){return Or(t.length)},Pr=TypeError,Nr=function(t){if(t>9007199254740991)throw Pr("Maximum allowed index exceeded");return t},Mr=de,Dr=Xe,Lr=O,Ur=function(t,e,r){var i=Mr(e);i in t?Dr.f(t,i,Lr(0,r)):t[i]=r},Fr={};Fr[re("toStringTag")]="z";var Gr="[object z]"===String(Fr),Br=Gr,kr=_,Xr=M,Hr=re("toStringTag"),jr=Object,Vr="Arguments"==Xr(function(){return arguments}()),Yr=Br?Xr:function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=jr(t),Hr))?r:Vr?Xr(e):"Object"==(i=Xr(e))&&kr(e.callee)?"Arguments":i},Wr=_,zr=Mt,Zr=v(Function.toString);Wr(zr.inspectSource)||(zr.inspectSource=function(t){return Zr(t)});var Kr=zr.inspectSource,qr=v,Jr=n,Qr=_,$r=Yr,ti=Kr,ei=function(){},ri=[],ii=J("Reflect","construct"),ni=/^\s*(?:class|function)\b/,oi=qr(ni.exec),si=!ni.exec(ei),ai=function(t){if(!Qr(t))return!1;try{return ii(ei,ri,t),!0}catch(t){return!1}},ui=function(t){if(!Qr(t))return!1;switch($r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return si||!!oi(ni,ti(t))}catch(t){return!0}};ui.sham=!0;var hi=!ii||Jr((function(){var t;return ai(ai.call)||!ai(Object)||!ai((function(){t=!0}))||t}))?ui:ai,ci=br,li=hi,di=Y,fi=re("species"),pi=Array,mi=function(t){var e;return ci(t)&&(e=t.constructor,(li(e)&&(e===pi||ci(e.prototype))||di(e)&&null===(e=e[fi]))&&(e=void 0)),void 0===e?pi:e},vi=function(t,e){return new(mi(t))(0===e?0:e)},_i=n,yi=st,gi=re("species"),bi=function(t){return yi>=51||!_i((function(){var e=[];return(e.constructor={})[gi]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ti=yr,Ei=n,xi=br,Ri=Y,Si=Ft,Ai=wr,Ii=Nr,Ci=Ur,Oi=vi,wi=bi,Pi=st,Ni=re("isConcatSpreadable"),Mi=Pi>=51||!Ei((function(){var t=[];return t[Ni]=!1,t.concat()[0]!==t})),Di=wi("concat"),Li=function(t){if(!Ri(t))return!1;var e=t[Ni];return void 0!==e?!!e:xi(t)};Ti({target:"Array",proto:!0,arity:1,forced:!Mi||!Di},{concat:function(t){var e,r,i,n,o,s=Si(this),a=Oi(s,0),u=0;for(e=-1,i=arguments.length;e<i;e++)if(Li(o=-1===e?s:arguments[e]))for(n=Ai(o),Ii(u+n),r=0;r<n;r++,u++)r in o&&Ci(a,u,o[r]);else Ii(u+1),Ci(a,u++,o);return a.length=u,a}});var Ui=Yr,Fi=String,Gi=function(t){if("Symbol"===Ui(t))throw TypeError("Cannot convert a Symbol value to a string");return Fi(t)},Bi={},ki=Sr,Xi=Math.max,Hi=Math.min,ji=function(t,e){var r=ki(t);return r<0?Xi(r+e,0):Hi(r,e)},Vi=j,Yi=ji,Wi=wr,zi=function(t){return function(e,r,i){var n,o=Vi(e),s=Wi(o),a=Yi(i,s);if(t&&r!=r){for(;s>a;)if((n=o[a++])!=n)return!0}else for(;s>a;a++)if((t||a in o)&&o[a]===r)return t||a||0;return!t&&-1}},Zi={includes:zi(!0),indexOf:zi(!1)},Ki={},qi=kt,Ji=j,Qi=Zi.indexOf,$i=Ki,tn=v([].push),en=function(t,e){var r,i=Ji(t),n=0,o=[];for(r in i)!qi($i,r)&&qi(i,r)&&tn(o,r);for(;e.length>n;)qi(i,r=e[n++])&&(~Qi(o,r)||tn(o,r));return o},rn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],nn=en,on=rn,sn=Object.keys||function(t){return nn(t,on)},an=g,un=He,hn=Xe,cn=We,ln=j,dn=sn;Bi.f=an&&!un?Object.defineProperties:function(t,e){cn(t);for(var r,i=ln(e),n=dn(e),o=n.length,s=0;o>s;)hn.f(t,r=n[s++],i[r]);return t};var fn,pn=J("document","documentElement"),mn=Ct.exports,vn=Yt,_n=mn("keys"),yn=function(t){return _n[t]||(_n[t]=vn(t))},gn=We,bn=Bi,Tn=rn,En=Ki,xn=pn,Rn=ve,Sn=yn("IE_PROTO"),An=function(){},In=function(t){return"<script>"+t+"</"+"script>"},Cn=function(t){t.write(In("")),t.close();var e=t.parentWindow.Object;return t=null,e},On=function(){try{fn=new ActiveXObject("htmlfile")}catch(t){}var t,e;On="undefined"!=typeof document?document.domain&&fn?Cn(fn):((e=Rn("iframe")).style.display="none",xn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(In("document.F=Object")),t.close(),t.F):Cn(fn);for(var r=Tn.length;r--;)delete On.prototype[Tn[r]];return On()};En[Sn]=!0;var wn=Object.create||function(t,e){var r;return null!==t?(An.prototype=gn(t),r=new An,An.prototype=null,r[Sn]=t):r=On(),void 0===e?r:bn.f(r,e)},Pn={},Nn=en,Mn=rn.concat("length","prototype");Pn.f=Object.getOwnPropertyNames||function(t){return Nn(t,Mn)};var Dn={},Ln=ji,Un=wr,Fn=Ur,Gn=Array,Bn=Math.max,kn=function(t,e,r){for(var i=Un(t),n=Ln(e,i),o=Ln(void 0===r?i:r,i),s=Gn(Bn(o-n,0)),a=0;n<o;n++,a++)Fn(s,a,t[n]);return s.length=a,s},Xn=M,Hn=j,jn=Pn.f,Vn=kn,Yn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Dn.f=function(t){return Yn&&"Window"==Xn(t)?function(t){try{return jn(t)}catch(t){return Vn(Yn)}}(t):jn(Hn(t))};var Wn={};Wn.f=Object.getOwnPropertySymbols;var zn=sr,Zn=function(t,e,r,i){return i&&i.enumerable?t[e]=r:zn(t,e,r),t},Kn={},qn=re;Kn.f=qn;var Jn,Qn,$n,to=W,eo=kt,ro=Kn,io=Xe.f,no=function(t){var e=to.Symbol||(to.Symbol={});eo(e,t)||io(e,t,{value:ro.f(t)})},oo=E,so=J,ao=re,uo=Zn,ho=function(){var t=so("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,i=ao("toPrimitive");e&&!e[i]&&uo(e,i,(function(t){return oo(r,this)}),{arity:1})},co=Yr,lo=Gr?{}.toString:function(){return"[object "+co(this)+"]"},fo=Gr,po=Xe.f,mo=sr,vo=kt,_o=lo,yo=re("toStringTag"),go=function(t,e,r,i){if(t){var n=r?t:t.prototype;vo(n,yo)||po(n,yo,{configurable:!0,value:e}),i&&!fo&&mo(n,"toString",_o)}},bo=_,To=Kr,Eo=i.WeakMap,xo=bo(Eo)&&/native code/.test(To(Eo)),Ro=i,So=v,Ao=Y,Io=sr,Co=kt,Oo=Mt,wo=yn,Po=Ki,No="Object already initialized",Mo=Ro.TypeError,Do=Ro.WeakMap;if(xo||Oo.state){var Lo=Oo.state||(Oo.state=new Do),Uo=So(Lo.get),Fo=So(Lo.has),Go=So(Lo.set);Jn=function(t,e){if(Fo(Lo,t))throw new Mo(No);return e.facade=t,Go(Lo,t,e),e},Qn=function(t){return Uo(Lo,t)||{}},$n=function(t){return Fo(Lo,t)}}else{var Bo=wo("state");Po[Bo]=!0,Jn=function(t,e){if(Co(t,Bo))throw new Mo(No);return e.facade=t,Io(t,Bo,e),e},Qn=function(t){return Co(t,Bo)?t[Bo]:{}},$n=function(t){return Co(t,Bo)}}var ko={set:Jn,get:Qn,has:$n,enforce:function(t){return $n(t)?Qn(t):Jn(t,{})},getterFor:function(t){return function(e){var r;if(!Ao(e)||(r=Qn(e)).type!==t)throw Mo("Incompatible receiver, "+t+" required");return r}}},Xo=ke,Ho=G,jo=Ft,Vo=wr,Yo=vi,Wo=v([].push),zo=function(t){var e=1==t,r=2==t,i=3==t,n=4==t,o=6==t,s=7==t,a=5==t||o;return function(u,h,c,l){for(var d,f,p=jo(u),m=Ho(p),v=Xo(h,c),_=Vo(m),y=0,g=l||Yo,b=e?g(u,_):r||s?g(u,0):void 0;_>y;y++)if((a||y in m)&&(f=v(d=m[y],y,p),t))if(e)b[y]=f;else if(f)switch(t){case 3:return!0;case 5:return d;case 6:return y;case 2:Wo(b,d)}else switch(t){case 4:return!1;case 7:Wo(b,d)}return o?-1:i||n?n:b}},Zo={forEach:zo(0),map:zo(1),filter:zo(2),some:zo(3),every:zo(4),find:zo(5),findIndex:zo(6),filterReject:zo(7)},Ko=yr,qo=i,Jo=E,Qo=v,$o=g,ts=ht,es=n,rs=kt,is=Q,ns=We,os=j,ss=de,as=Gi,us=O,hs=wn,cs=sn,ls=Pn,ds=Dn,fs=Wn,ps=y,ms=Xe,vs=Bi,_s=x,ys=Zn,gs=Ct.exports,bs=Ki,Ts=Yt,Es=re,xs=Kn,Rs=no,Ss=ho,As=go,Is=ko,Cs=Zo.forEach,Os=yn("hidden"),ws="Symbol",Ps=Is.set,Ns=Is.getterFor(ws),Ms=Object.prototype,Ds=qo.Symbol,Ls=Ds&&Ds.prototype,Us=qo.TypeError,Fs=qo.QObject,Gs=ps.f,Bs=ms.f,ks=ds.f,Xs=_s.f,Hs=Qo([].push),js=gs("symbols"),Vs=gs("op-symbols"),Ys=gs("wks"),Ws=!Fs||!Fs.prototype||!Fs.prototype.findChild,zs=$o&&es((function(){return 7!=hs(Bs({},"a",{get:function(){return Bs(this,"a",{value:7}).a}})).a}))?function(t,e,r){var i=Gs(Ms,e);i&&delete Ms[e],Bs(t,e,r),i&&t!==Ms&&Bs(Ms,e,i)}:Bs,Zs=function(t,e){var r=js[t]=hs(Ls);return Ps(r,{type:ws,tag:t,description:e}),$o||(r.description=e),r},Ks=function(t,e,r){t===Ms&&Ks(Vs,e,r),ns(t);var i=ss(e);return ns(r),rs(js,i)?(r.enumerable?(rs(t,Os)&&t[Os][i]&&(t[Os][i]=!1),r=hs(r,{enumerable:us(0,!1)})):(rs(t,Os)||Bs(t,Os,us(1,{})),t[Os][i]=!0),zs(t,i,r)):Bs(t,i,r)},qs=function(t,e){ns(t);var r=os(e),i=cs(r).concat(ta(r));return Cs(i,(function(e){$o&&!Jo(Js,r,e)||Ks(t,e,r[e])})),t},Js=function(t){var e=ss(t),r=Jo(Xs,this,e);return!(this===Ms&&rs(js,e)&&!rs(Vs,e))&&(!(r||!rs(this,e)||!rs(js,e)||rs(this,Os)&&this[Os][e])||r)},Qs=function(t,e){var r=os(t),i=ss(e);if(r!==Ms||!rs(js,i)||rs(Vs,i)){var n=Gs(r,i);return!n||!rs(js,i)||rs(r,Os)&&r[Os][i]||(n.enumerable=!0),n}},$s=function(t){var e=ks(os(t)),r=[];return Cs(e,(function(t){rs(js,t)||rs(bs,t)||Hs(r,t)})),r},ta=function(t){var e=t===Ms,r=ks(e?Vs:os(t)),i=[];return Cs(r,(function(t){!rs(js,t)||e&&!rs(Ms,t)||Hs(i,js[t])})),i};ts||(Ds=function(){if(is(Ls,this))throw Us("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?as(arguments[0]):void 0,e=Ts(t),r=function(t){this===Ms&&Jo(r,Vs,t),rs(this,Os)&&rs(this[Os],e)&&(this[Os][e]=!1),zs(this,e,us(1,t))};return $o&&Ws&&zs(Ms,e,{configurable:!0,set:r}),Zs(e,t)},ys(Ls=Ds.prototype,"toString",(function(){return Ns(this).tag})),ys(Ds,"withoutSetter",(function(t){return Zs(Ts(t),t)})),_s.f=Js,ms.f=Ks,vs.f=qs,ps.f=Qs,ls.f=ds.f=$s,fs.f=ta,xs.f=function(t){return Zs(Es(t),t)},$o&&Bs(Ls,"description",{configurable:!0,get:function(){return Ns(this).description}})),Ko({global:!0,constructor:!0,wrap:!0,forced:!ts,sham:!ts},{Symbol:Ds}),Cs(cs(Ys),(function(t){Rs(t)})),Ko({target:ws,stat:!0,forced:!ts},{useSetter:function(){Ws=!0},useSimple:function(){Ws=!1}}),Ko({target:"Object",stat:!0,forced:!ts,sham:!$o},{create:function(t,e){return void 0===e?hs(t):qs(hs(t),e)},defineProperty:Ks,defineProperties:qs,getOwnPropertyDescriptor:Qs}),Ko({target:"Object",stat:!0,forced:!ts},{getOwnPropertyNames:$s}),Ss(),As(Ds,ws),bs[Os]=!0;var ea=ht&&!!Symbol.for&&!!Symbol.keyFor,ra=yr,ia=J,na=kt,oa=Gi,sa=Ct.exports,aa=ea,ua=sa("string-to-symbol-registry"),ha=sa("symbol-to-string-registry");ra({target:"Symbol",stat:!0,forced:!aa},{for:function(t){var e=oa(t);if(na(ua,e))return ua[e];var r=ia("Symbol")(e);return ua[e]=r,ha[r]=e,r}});var ca=yr,la=kt,da=mt,fa=_t,pa=ea,ma=(0,Ct.exports)("symbol-to-string-registry");ca({target:"Symbol",stat:!0,forced:!pa},{keyFor:function(t){if(!da(t))throw TypeError(fa(t)+" is not a symbol");if(la(ma,t))return ma[t]}});var va=v([].slice),_a=yr,ya=J,ga=c,ba=E,Ta=v,Ea=n,xa=br,Ra=_,Sa=Y,Aa=mt,Ia=va,Ca=ht,Oa=ya("JSON","stringify"),wa=Ta(/./.exec),Pa=Ta("".charAt),Na=Ta("".charCodeAt),Ma=Ta("".replace),Da=Ta(1..toString),La=/[\uD800-\uDFFF]/g,Ua=/^[\uD800-\uDBFF]$/,Fa=/^[\uDC00-\uDFFF]$/,Ga=!Ca||Ea((function(){var t=ya("Symbol")();return"[null]"!=Oa([t])||"{}"!=Oa({a:t})||"{}"!=Oa(Object(t))})),Ba=Ea((function(){return'"\\udf06\\ud834"'!==Oa("\udf06\ud834")||'"\\udead"'!==Oa("\udead")})),ka=function(t,e){var r=Ia(arguments),i=e;if((Sa(e)||void 0!==t)&&!Aa(t))return xa(e)||(e=function(t,e){if(Ra(i)&&(e=ba(i,this,t,e)),!Aa(e))return e}),r[1]=e,ga(Oa,null,r)},Xa=function(t,e,r){var i=Pa(r,e-1),n=Pa(r,e+1);return wa(Ua,t)&&!wa(Fa,n)||wa(Fa,t)&&!wa(Ua,i)?"\\u"+Da(Na(t,0),16):t};Oa&&_a({target:"JSON",stat:!0,arity:3,forced:Ga||Ba},{stringify:function(t,e,r){var i=Ia(arguments),n=ga(Ga?ka:Oa,null,i);return Ba&&"string"==typeof n?Ma(n,La,Xa):n}});var Ha=Wn,ja=Ft;yr({target:"Object",stat:!0,forced:!ht||n((function(){Ha.f(1)}))},{getOwnPropertySymbols:function(t){var e=Ha.f;return e?e(ja(t)):[]}}),no("asyncIterator"),no("hasInstance"),no("isConcatSpreadable"),no("iterator"),no("match"),no("matchAll"),no("replace"),no("search"),no("species"),no("split");var Va=ho;no("toPrimitive"),Va();var Ya=J,Wa=go;no("toStringTag"),Wa(Ya("Symbol"),"Symbol"),no("unscopables"),go(i.JSON,"JSON",!0);var za,Za,Ka,qa=W.Symbol,Ja={},Qa=g,$a=kt,tu=Function.prototype,eu=Qa&&Object.getOwnPropertyDescriptor,ru=$a(tu,"name"),iu={EXISTS:ru,PROPER:ru&&"something"===function(){}.name,CONFIGURABLE:ru&&(!Qa||Qa&&eu(tu,"name").configurable)},nu=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ou=kt,su=_,au=Ft,uu=nu,hu=yn("IE_PROTO"),cu=Object,lu=cu.prototype,du=uu?cu.getPrototypeOf:function(t){var e=au(t);if(ou(e,hu))return e[hu];var r=e.constructor;return su(r)&&e instanceof r?r.prototype:e instanceof cu?lu:null},fu=n,pu=_,mu=wn,vu=du,_u=Zn,yu=re("iterator"),gu=!1;[].keys&&("next"in(Ka=[].keys())?(Za=vu(vu(Ka)))!==Object.prototype&&(za=Za):gu=!0);var bu=null==za||fu((function(){var t={};return za[yu].call(t)!==t}));pu((za=bu?{}:mu(za))[yu])||_u(za,yu,(function(){return this}));var Tu={IteratorPrototype:za,BUGGY_SAFARI_ITERATORS:gu},Eu=Tu.IteratorPrototype,xu=wn,Ru=O,Su=go,Au=Ja,Iu=function(){return this},Cu=function(t,e,r,i){var n=e+" Iterator";return t.prototype=xu(Eu,{next:Ru(+!i,r)}),Su(t,n,!1,!0),Au[n]=Iu,t},Ou=_,wu=String,Pu=TypeError,Nu=v,Mu=We,Du=function(t){if("object"==typeof t||Ou(t))return t;throw Pu("Can't set "+wu(t)+" as a prototype")},Lu=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Nu(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return Mu(r),Du(i),e?t(r,i):r.__proto__=i,r}}():void 0),Uu=yr,Fu=E,Gu=Cu,Bu=du,ku=go,Xu=Zn,Hu=Ja,ju=iu.PROPER,Vu=Tu.BUGGY_SAFARI_ITERATORS,Yu=re("iterator"),Wu="keys",zu="values",Zu="entries",Ku=function(){return this},qu=function(t,e,r,i,n,o,s){Gu(r,e,i);var a,u,h,c=function(t){if(t===n&&m)return m;if(!Vu&&t in f)return f[t];switch(t){case Wu:case zu:case Zu:return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",d=!1,f=t.prototype,p=f[Yu]||f["@@iterator"]||n&&f[n],m=!Vu&&p||c(n),v="Array"==e&&f.entries||p;if(v&&(a=Bu(v.call(new t)))!==Object.prototype&&a.next&&(ku(a,l,!0,!0),Hu[l]=Ku),ju&&n==zu&&p&&p.name!==zu&&(d=!0,m=function(){return Fu(p,this)}),n)if(u={values:c(zu),keys:o?m:c(Wu),entries:c(Zu)},s)for(h in u)(Vu||d||!(h in f))&&Xu(f,h,u[h]);else Uu({target:e,proto:!0,forced:Vu||d},u);return s&&f[Yu]!==m&&Xu(f,Yu,m,{name:n}),Hu[e]=m,u},Ju=j,Qu=Ja,$u=ko;Xe.f;var th=qu,eh="Array Iterator",rh=$u.set,ih=$u.getterFor(eh);th(Array,"Array",(function(t,e){rh(this,{type:eh,target:Ju(t),index:0,kind:e})}),(function(){var t=ih(this),e=t.target,r=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:i,done:!1}:"values"==r?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values"),Qu.Arguments=Qu.Array;var nh={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},oh=i,sh=Yr,ah=sr,uh=Ja,hh=re("toStringTag");for(var ch in nh){var lh=oh[ch],dh=lh&&lh.prototype;dh&&sh(dh)!==hh&&ah(dh,hh,ch),uh[ch]=uh.Array}var fh=qa;no("asyncDispose"),no("dispose"),no("matcher"),no("metadataKey"),no("observable"),no("metadata"),no("patternMatch"),no("replaceAll");var ph=fh,mh=v,vh=Sr,_h=Gi,yh=k,gh=mh("".charAt),bh=mh("".charCodeAt),Th=mh("".slice),Eh=function(t){return function(e,r){var i,n,o=_h(yh(e)),s=vh(r),a=o.length;return s<0||s>=a?t?"":void 0:(i=bh(o,s))<55296||i>56319||s+1===a||(n=bh(o,s+1))<56320||n>57343?t?gh(o,s):i:t?Th(o,s,s+2):n-56320+(i-55296<<10)+65536}},xh={codeAt:Eh(!1),charAt:Eh(!0)},Rh=xh.charAt,Sh=Gi,Ah=ko,Ih=qu,Ch="String Iterator",Oh=Ah.set,wh=Ah.getterFor(Ch);Ih(String,"String",(function(t){Oh(this,{type:Ch,string:Sh(t),index:0})}),(function(){var t,e=wh(this),r=e.string,i=e.index;return i>=r.length?{value:void 0,done:!0}:(t=Rh(r,i),e.index+=t.length,{value:t,done:!1})}));var Ph=Kn.f("iterator");function Nh(t){return Nh="function"==typeof ph&&"symbol"==typeof Ph?function(t){return typeof t}:function(t){return t&&"function"==typeof ph&&t.constructor===ph&&t!==ph.prototype?"symbol":typeof t},Nh(t)}var Mh=v,Dh=Tt,Lh=Y,Uh=kt,Fh=va,Gh=o,Bh=Function,kh=Mh([].concat),Xh=Mh([].join),Hh={},jh=function(t,e,r){if(!Uh(Hh,e)){for(var i=[],n=0;n<e;n++)i[n]="a["+n+"]";Hh[e]=Bh("C,a","return new C("+Xh(i,",")+")")}return Hh[e](t,r)},Vh=Gh?Bh.bind:function(t){var e=Dh(this),r=e.prototype,i=Fh(arguments,1),n=function(){var r=kh(i,Fh(arguments));return this instanceof n?jh(e,r.length,r):e.apply(t,r)};return Lh(r)&&(n.prototype=r),n},Yh=Vh;yr({target:"Function",proto:!0,forced:Function.bind!==Yh},{bind:Yh});var Wh=W,zh=function(t){return Wh[t+"Prototype"]},Zh=zh("Function").bind,Kh=Q,qh=Zh,Jh=Function.prototype,Qh=function(t){var e=t.bind;return t===Jh||Kh(Jh,t)&&e===Jh.bind?qh:e},$h=n,tc=function(t,e){var r=[][t];return!!r&&$h((function(){r.call(null,e||function(){return 1},1)}))},ec=Zo.forEach,rc=tc("forEach")?[].forEach:function(t){return ec(this,t,arguments.length>1?arguments[1]:void 0)};yr({target:"Array",proto:!0,forced:[].forEach!=rc},{forEach:rc});var ic=zh("Array").forEach,nc=Yr,oc=kt,sc=Q,ac=ic,uc=Array.prototype,hc={DOMTokenList:!0,NodeList:!0},cc=function(t){var e=t.forEach;return t===uc||sc(uc,t)&&e===uc.forEach||oc(hc,nc(t))?ac:e},lc=Zo.filter;yr({target:"Array",proto:!0,forced:!bi("filter")},{filter:function(t){return lc(this,t,arguments.length>1?arguments[1]:void 0)}});var dc=zh("Array").filter,fc=Q,pc=dc,mc=Array.prototype,vc=function(t){var e=t.filter;return t===mc||fc(mc,t)&&e===mc.filter?pc:e},_c=yr,yc=Zo.findIndex,gc="findIndex",bc=!0;gc in[]&&Array(1).findIndex((function(){bc=!1})),_c({target:"Array",proto:!0,forced:bc},{findIndex:function(t){return yc(this,t,arguments.length>1?arguments[1]:void 0)}});var Tc=zh("Array").findIndex,Ec=Q,xc=Tc,Rc=Array.prototype,Sc=function(t){var e=t.findIndex;return t===Rc||Ec(Rc,t)&&e===Rc.findIndex?xc:e},Ac=_t,Ic=TypeError,Cc=yr,Oc=Ft,wc=ji,Pc=Sr,Nc=wr,Mc=Nr,Dc=vi,Lc=Ur,Uc=function(t,e){if(!delete t[e])throw Ic("Cannot delete property "+Ac(e)+" of "+Ac(t))},Fc=bi("splice"),Gc=Math.max,Bc=Math.min;Cc({target:"Array",proto:!0,forced:!Fc},{splice:function(t,e){var r,i,n,o,s,a,u=Oc(this),h=Nc(u),c=wc(t,h),l=arguments.length;for(0===l?r=i=0:1===l?(r=0,i=h-c):(r=l-2,i=Bc(Gc(Pc(e),0),h-c)),Mc(h+r-i),n=Dc(u,i),o=0;o<i;o++)(s=c+o)in u&&Lc(n,o,u[s]);if(n.length=i,r<i){for(o=c;o<h-i;o++)a=o+r,(s=o+i)in u?u[a]=u[s]:Uc(u,a);for(o=h;o>h-i+r;o--)Uc(u,o-1)}else if(r>i)for(o=h-i;o>c;o--)a=o+r-1,(s=o+i-1)in u?u[a]=u[s]:Uc(u,a);for(o=0;o<r;o++)u[o+c]=arguments[o+2];return u.length=h-i+r,n}});var kc=zh("Array").splice,Xc=Q,Hc=kc,jc=Array.prototype,Vc=function(t){var e=t.splice;return t===jc||Xc(jc,t)&&e===jc.splice?Hc:e},Yc=yr,Wc=Zo.find,zc="find",Zc=!0;zc in[]&&Array(1).find((function(){Zc=!1})),Yc({target:"Array",proto:!0,forced:Zc},{find:function(t){return Wc(this,t,arguments.length>1?arguments[1]:void 0)}});var Kc=zh("Array").find,qc=Q,Jc=Kc,Qc=Array.prototype,$c=function(t){var e=t.find;return t===Qc||qc(Qc,t)&&e===Qc.find?Jc:e},tl=Ft,el=sn;yr({target:"Object",stat:!0,forced:n((function(){el(1)}))},{keys:function(t){return el(tl(t))}});var rl=W.Object.keys,il=Zi.includes;yr({target:"Array",proto:!0,forced:n((function(){return!Array(1).includes()}))},{includes:function(t){return il(this,t,arguments.length>1?arguments[1]:void 0)}});var nl=zh("Array").includes,ol=Y,sl=M,al=re("match"),ul=function(t){var e;return ol(t)&&(void 0!==(e=t[al])?!!e:"RegExp"==sl(t))},hl=TypeError,cl=function(t){if(ul(t))throw hl("The method doesn't accept regular expressions");return t},ll=re("match"),dl=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[ll]=!1,"/./"[t](e)}catch(t){}}return!1},fl=yr,pl=cl,ml=k,vl=Gi,_l=dl,yl=v("".indexOf);fl({target:"String",proto:!0,forced:!_l("includes")},{includes:function(t){return!!~yl(vl(ml(this)),vl(pl(t)),arguments.length>1?arguments[1]:void 0)}});var gl=zh("String").includes,bl=Q,Tl=nl,El=gl,xl=Array.prototype,Rl=String.prototype,Sl=function(t){var e=t.includes;return t===xl||bl(xl,t)&&e===xl.includes?Tl:"string"==typeof t||t===Rl||bl(Rl,t)&&e===Rl.includes?El:e},Al=TypeError,Il=function(t,e){if(t<e)throw Al("Not enough arguments");return t},Cl=i,Ol=c,wl=_,Pl=va,Nl=Il,Ml=/MSIE .\./.test($),Dl=Cl.Function,Ll=function(t){return Ml?function(e,r){var i=Nl(arguments.length,1)>2,n=wl(e)?e:Dl(e),o=i?Pl(arguments,2):void 0;return t(i?function(){Ol(n,this,o)}:n,r)}:t},Ul={setTimeout:Ll(Cl.setTimeout),setInterval:Ll(Cl.setInterval)},Fl=Ul.setInterval;yr({global:!0,bind:!0,forced:i.setInterval!==Fl},{setInterval:Fl});var Gl=Ul.setTimeout;yr({global:!0,bind:!0,forced:i.setTimeout!==Gl},{setTimeout:Gl});var Bl=W.setTimeout,kl=Zo.map;yr({target:"Array",proto:!0,forced:!bi("map")},{map:function(t){return kl(this,t,arguments.length>1?arguments[1]:void 0)}});var Xl=zh("Array").map,Hl=Q,jl=Xl,Vl=Array.prototype,Yl=function(t){var e=t.map;return t===Vl||Hl(Vl,t)&&e===Vl.map?jl:e},Wl=zh("Array").concat,zl=Q,Zl=Wl,Kl=Array.prototype,ql=function(t){var e=t.concat;return t===Kl||zl(Kl,t)&&e===Kl.concat?Zl:e},Jl=Zo.every;yr({target:"Array",proto:!0,forced:!tc("every")},{every:function(t){return Jl(this,t,arguments.length>1?arguments[1]:void 0)}});var Ql=zh("Array").every,$l=Q,td=Ql,ed=Array.prototype,rd=function(t){var e=t.every;return t===ed||$l(ed,t)&&e===ed.every?td:e},id=function(){return id=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},id.apply(this,arguments)};function nd(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))}function od(t,e){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function sd(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ad(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}var ud="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==ud&&ud,hd="URLSearchParams"in ud,cd="Symbol"in ud&&"iterator"in Symbol,ld="FileReader"in ud&&"Blob"in ud&&function(){try{return new Blob,!0}catch(t){return!1}}(),dd="FormData"in ud,fd="ArrayBuffer"in ud;if(fd)var pd=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],md=ArrayBuffer.isView||function(t){return t&&pd.indexOf(Object.prototype.toString.call(t))>-1};function vd(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 _d(t){return"string"!=typeof t&&(t=String(t)),t}function yd(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return cd&&(e[Symbol.iterator]=function(){return e}),e}function gd(t){this.map={},t instanceof gd?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function bd(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function Td(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function Ed(t){var e=new FileReader,r=Td(e);return e.readAsArrayBuffer(t),r}function xd(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Rd(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:ld&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:dd&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:hd&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():fd&&ld&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=xd(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):fd&&(ArrayBuffer.prototype.isPrototypeOf(t)||md(t))?this._bodyArrayBuffer=xd(t):this._bodyText=t=Object.prototype.toString.call(t):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):hd&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ld&&(this.blob=function(){var t=bd(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=bd(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))}return this.blob().then(Ed)}),this.text=function(){var t=bd(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=Td(e);return e.readAsText(t),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i<e.length;i++)r[i]=String.fromCharCode(e[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},dd&&(this.formData=function(){return this.text().then(Id)}),this.json=function(){return this.text().then(JSON.parse)},this}gd.prototype.append=function(t,e){t=vd(t),e=_d(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},gd.prototype.delete=function(t){delete this.map[vd(t)]},gd.prototype.get=function(t){return t=vd(t),this.has(t)?this.map[t]:null},gd.prototype.has=function(t){return this.map.hasOwnProperty(vd(t))},gd.prototype.set=function(t,e){this.map[vd(t)]=_d(e)},gd.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},gd.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),yd(t)},gd.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),yd(t)},gd.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),yd(t)},cd&&(gd.prototype[Symbol.iterator]=gd.prototype.entries);var Sd=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];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 gd(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 gd(e.headers)),this.method=function(t){var e=t.toUpperCase();return Sd.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.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 i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Id(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function Cd(t,e){if(!(this instanceof Cd))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new gd(e.headers),this.url=e.url||"",this._initBody(t)}Ad.prototype.clone=function(){return new Ad(this,{body:this._bodyInit})},Rd.call(Ad.prototype),Rd.call(Cd.prototype),Cd.prototype.clone=function(){return new Cd(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new gd(this.headers),url:this.url})},Cd.error=function(){var t=new Cd(null,{status:0,statusText:""});return t.type="error",t};var Od=[301,302,303,307,308];Cd.redirect=function(t,e){if(-1===Od.indexOf(e))throw new RangeError("Invalid status code");return new Cd(null,{status:e,headers:{location:t}})};var wd=ud.DOMException;try{new wd}catch(t){(wd=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),wd.prototype.constructor=wd}function Pd(t,e){return new Promise((function(r,i){var n=new Ad(t,e);if(n.signal&&n.signal.aborted)return i(new wd("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}o.onload=function(){var t,e,i={status:o.status,statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new gd,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(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}})),e)};i.url="responseURL"in o?o.responseURL:i.headers.get("X-Request-URL");var n="response"in o?o.response:o.responseText;setTimeout((function(){r(new Cd(n,i))}),0)},o.onerror=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},o.onabort=function(){setTimeout((function(){i(new wd("Aborted","AbortError"))}),0)},o.open(n.method,function(t){try{return""===t&&ud.location.href?ud.location.href:t}catch(e){return t}}(n.url),!0),"include"===n.credentials?o.withCredentials=!0:"omit"===n.credentials&&(o.withCredentials=!1),"responseType"in o&&(ld?o.responseType="blob":fd&&n.headers.get("Content-Type")&&-1!==n.headers.get("Content-Type").indexOf("application/octet-stream")&&(o.responseType="arraybuffer")),!e||"object"!=typeof e.headers||e.headers instanceof gd?n.headers.forEach((function(t,e){o.setRequestHeader(e,t)})):Object.getOwnPropertyNames(e.headers).forEach((function(t){o.setRequestHeader(t,_d(e.headers[t]))})),n.signal&&(n.signal.addEventListener("abort",s),o.onreadystatechange=function(){4===o.readyState&&n.signal.removeEventListener("abort",s)}),o.send(void 0===n._bodyInit?null:n._bodyInit)}))}Pd.polyfill=!0,ud.fetch||(ud.fetch=Pd,ud.Headers=gd,ud.Request=Ad,ud.Response=Cd);let Nd=!0,Md=!0;function Dd(t,e,r){const i=t.match(e);return i&&i.length>=r&&parseInt(i[r],10)}function Ld(t,e,r){if(!t.RTCPeerConnection)return;const i=t.RTCPeerConnection.prototype,n=i.addEventListener;i.addEventListener=function(t,i){if(t!==e)return n.apply(this,arguments);const o=t=>{const e=r(t);e&&(i.handleEvent?i.handleEvent(e):i(e))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(i,o),n.apply(this,[t,o])};const o=i.removeEventListener;i.removeEventListener=function(t,r){if(t!==e||!this._eventMap||!this._eventMap[e])return o.apply(this,arguments);if(!this._eventMap[e].has(r))return o.apply(this,arguments);const i=this._eventMap[e].get(r);return this._eventMap[e].delete(r),0===this._eventMap[e].size&&delete this._eventMap[e],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[t,i])},Object.defineProperty(i,"on"+e,{get(){return this["_on"+e]},set(t){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),t&&this.addEventListener(e,this["_on"+e]=t)},enumerable:!0,configurable:!0})}function Ud(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(Nd=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Fd(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(Md=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function Gd(){if("object"==typeof window){if(Nd)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function Bd(t,e){Md&&console.warn(t+" is deprecated, please use "+e+" instead.")}function kd(t){return"[object Object]"===Object.prototype.toString.call(t)}function Xd(t){return kd(t)?Object.keys(t).reduce((function(e,r){const i=kd(t[r]),n=i?Xd(t[r]):t[r],o=i&&!Object.keys(n).length;return void 0===n||o?e:Object.assign(e,{[r]:n})}),{}):t}function Hd(t,e,r){e&&!r.has(e.id)&&(r.set(e.id,e),Object.keys(e).forEach((i=>{i.endsWith("Id")?Hd(t,t.get(e[i]),r):i.endsWith("Ids")&&e[i].forEach((e=>{Hd(t,t.get(e),r)}))})))}function jd(t,e,r){const i=r?"outbound-rtp":"inbound-rtp",n=new Map;if(null===e)return n;const o=[];return t.forEach((t=>{"track"===t.type&&t.trackIdentifier===e.id&&o.push(t)})),o.forEach((e=>{t.forEach((r=>{r.type===i&&r.trackId===e.id&&Hd(t,r,n)}))})),n}const Vd=Gd;function Yd(t,e){const r=t&&t.navigator;if(!r.mediaDevices)return;const i=function(t){if("object"!=typeof t||t.mandatory||t.optional)return t;const e={};return Object.keys(t).forEach((r=>{if("require"===r||"advanced"===r||"mediaSource"===r)return;const i="object"==typeof t[r]?t[r]:{ideal:t[r]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const n=function(t,e){return t?t+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==i.ideal){e.optional=e.optional||[];let t={};"number"==typeof i.ideal?(t[n("min",r)]=i.ideal,e.optional.push(t),t={},t[n("max",r)]=i.ideal,e.optional.push(t)):(t[n("",r)]=i.ideal,e.optional.push(t))}void 0!==i.exact&&"number"!=typeof i.exact?(e.mandatory=e.mandatory||{},e.mandatory[n("",r)]=i.exact):["min","max"].forEach((t=>{void 0!==i[t]&&(e.mandatory=e.mandatory||{},e.mandatory[n(t,r)]=i[t])}))})),t.advanced&&(e.optional=(e.optional||[]).concat(t.advanced)),e},n=function(t,n){if(e.version>=61)return n(t);if((t=JSON.parse(JSON.stringify(t)))&&"object"==typeof t.audio){const e=function(t,e,r){e in t&&!(r in t)&&(t[r]=t[e],delete t[e])};e((t=JSON.parse(JSON.stringify(t))).audio,"autoGainControl","googAutoGainControl"),e(t.audio,"noiseSuppression","googNoiseSuppression"),t.audio=i(t.audio)}if(t&&"object"==typeof t.video){let o=t.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=e.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||s)){let e;if(delete t.video.facingMode,"environment"===o.exact||"environment"===o.ideal?e=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(e=["front"]),e)return r.mediaDevices.enumerateDevices().then((r=>{r=r.filter((t=>"videoinput"===t.kind));let s=r.find((t=>e.some((e=>t.label.toLowerCase().includes(e)))));return!s&&r.length&&e.includes("back")&&(s=r[r.length-1]),s&&(t.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),t.video=i(t.video),Vd("chrome: "+JSON.stringify(t)),n(t)}))}t.video=i(t.video)}return Vd("chrome: "+JSON.stringify(t)),n(t)},o=function(t){return e.version>=64?t:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraint||t.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(t,e,i){n(t,(t=>{r.webkitGetUserMedia(t,e,(t=>{i&&i(o(t))}))}))}.bind(r),r.mediaDevices.getUserMedia){const t=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(e){return n(e,(e=>t(e).then((t=>{if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((t=>{t.stop()})),new DOMException("","NotFoundError");return t}),(t=>Promise.reject(o(t))))))}}}function Wd(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function zd(t){if("object"==typeof t&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=e=>{e.stream.addEventListener("addtrack",(r=>{let i;i=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((t=>t.track&&t.track.id===r.track.id)):{track:r.track};const n=new Event("track");n.track=r.track,n.receiver=i,n.transceiver={receiver:i},n.streams=[e.stream],this.dispatchEvent(n)})),e.stream.getTracks().forEach((r=>{let i;i=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((t=>t.track&&t.track.id===r.id)):{track:r};const n=new Event("track");n.track=r,n.receiver=i,n.transceiver={receiver:i},n.streams=[e.stream],this.dispatchEvent(n)}))},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else Ld(t,"track",(t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t)))}function Zd(t){if("object"==typeof t&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(t,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=t.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:t}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,i){let n=r.apply(this,arguments);return n||(n=e(this,t),this._senders.push(n)),n};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){i.apply(this,arguments);const e=this._senders.indexOf(t);-1!==e&&this._senders.splice(e,1)}}const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._senders=this._senders||[],r.apply(this,[t]),t.getTracks().forEach((t=>{this._senders.push(e(this,t))}))};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){this._senders=this._senders||[],i.apply(this,[t]),t.getTracks().forEach((t=>{const e=this._senders.find((e=>e.track===t));e&&this._senders.splice(this._senders.indexOf(e),1)}))}}else if("object"==typeof t&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Kd(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,r,i]=arguments;if(arguments.length>0&&"function"==typeof t)return e.apply(this,arguments);if(0===e.length&&(0===arguments.length||"function"!=typeof t))return e.apply(this,[]);const n=function(t){const e={};return t.result().forEach((t=>{const r={id:t.id,timestamp:t.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[t.type]||t.type};t.names().forEach((e=>{r[e]=t.stat(e)})),e[r.id]=r})),e},o=function(t){return new Map(Object.keys(t).map((e=>[e,t[e]])))};if(arguments.length>=2){const i=function(t){r(o(n(t)))};return e.apply(this,[i,t])}return new Promise(((t,r)=>{e.apply(this,[function(e){t(o(n(e)))},r])})).then(r,i)}}function qd(t){if(!("object"==typeof t&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t});const r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=r.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){const t=this;return this._pc.getStats().then((e=>jd(e,t.track,!0)))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t}),Ld(t,"track",(t=>(t.receiver._pc=t.srcElement,t))),t.RTCRtpReceiver.prototype.getStats=function(){const t=this;return this._pc.getStats().then((e=>jd(e,t.track,!1)))}}if(!("getStats"in t.RTCRtpSender.prototype)||!("getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const t=arguments[0];let e,r,i;return this.getSenders().forEach((r=>{r.track===t&&(e?i=!0:e=r)})),this.getReceivers().forEach((e=>(e.track===t&&(r?i=!0:r=e),e.track===t))),i||e&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function Jd(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((t=>this._shimmedLocalStreams[t][0]))};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,r){if(!r)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const i=e.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(i)&&this._shimmedLocalStreams[r.id].push(i):this._shimmedLocalStreams[r.id]=[r,i],i};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._shimmedLocalStreams=this._shimmedLocalStreams||{},t.getTracks().forEach((t=>{const e=this.getSenders().find((e=>e.track===t));if(e)throw new DOMException("Track already exists.","InvalidAccessError")}));const e=this.getSenders();r.apply(this,arguments);const i=this.getSenders().filter((t=>-1===e.indexOf(t)));this._shimmedLocalStreams[t.id]=[t].concat(i)};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[t.id],i.apply(this,arguments)};const n=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},t&&Object.keys(this._shimmedLocalStreams).forEach((e=>{const r=this._shimmedLocalStreams[e].indexOf(t);-1!==r&&this._shimmedLocalStreams[e].splice(r,1),1===this._shimmedLocalStreams[e].length&&delete this._shimmedLocalStreams[e]})),n.apply(this,arguments)}}function Qd(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Jd(t);const r=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const t=r.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((t=>this._reverseStreams[t.id]))};const i=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(e){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach((t=>{const e=this.getSenders().find((e=>e.track===t));if(e)throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[e.id]){const r=new t.MediaStream(e.getTracks());this._streams[e.id]=r,this._reverseStreams[r.id]=e,e=r}i.apply(this,[e])};const n=t.RTCPeerConnection.prototype.removeStream;function o(t,e){let r=e.sdp;return Object.keys(t._reverseStreams||[]).forEach((e=>{const i=t._reverseStreams[e],n=t._streams[i.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:e.type,sdp:r})}function s(t,e){let r=e.sdp;return Object.keys(t._reverseStreams||[]).forEach((e=>{const i=t._reverseStreams[e],n=t._streams[i.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:e.type,sdp:r})}t.RTCPeerConnection.prototype.removeStream=function(t){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},n.apply(this,[this._streams[t.id]||t]),delete this._reverseStreams[this._streams[t.id]?this._streams[t.id].id:t.id],delete this._streams[t.id]},t.RTCPeerConnection.prototype.addTrack=function(e,r){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((t=>t===e)))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");const n=this.getSenders().find((t=>t.track===e));if(n)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[r.id];if(o)o.addTrack(e),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const i=new t.MediaStream([e]);this._streams[r.id]=i,this._reverseStreams[i.id]=r,this.addStream(i)}return this.getSenders().find((t=>t.track===e))},["createOffer","createAnswer"].forEach((function(e){const r=t.RTCPeerConnection.prototype[e],i={[e](){const t=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[e=>{const r=o(this,e);t[0].apply(null,[r])},e=>{t[1]&&t[1].apply(null,e)},arguments[2]]):r.apply(this,arguments).then((t=>o(this,t)))}};t.RTCPeerConnection.prototype[e]=i[e]}));const a=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=s(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const u=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const t=u.get.apply(this);return""===t.type?t:o(this,t)}}),t.RTCPeerConnection.prototype.removeTrack=function(t){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!t._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(t._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let e;this._streams=this._streams||{},Object.keys(this._streams).forEach((r=>{this._streams[r].getTracks().find((e=>t.track===e))&&(e=this._streams[r])})),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(t.track),this.dispatchEvent(new Event("negotiationneeded")))}}function $d(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const r=t.RTCPeerConnection.prototype[e],i={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=i[e]}))}function tf(t,e){Ld(t,"negotiationneeded",(t=>{const r=t.target;if(!(e.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return t}))}var ef=Object.freeze({__proto__:null,shimMediaStream:Wd,shimOnTrack:zd,shimGetSendersWithDtmf:Zd,shimGetStats:Kd,shimSenderReceiverGetStats:qd,shimAddTrackRemoveTrackWithNative:Jd,shimAddTrackRemoveTrack:Qd,shimPeerConnection:$d,fixNegotiationNeeded:tf,shimGetUserMedia:Yd,shimGetDisplayMedia:function(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&("function"==typeof e?t.navigator.mediaDevices.getDisplayMedia=function(r){return e(r).then((e=>{const i=r.video&&r.video.width,n=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxFrameRate:o||3}},i&&(r.video.mandatory.maxWidth=i),n&&(r.video.mandatory.maxHeight=n),t.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}});function rf(t,e){const r=t&&t.navigator,i=t&&t.MediaStreamTrack;if(r.getUserMedia=function(t,e,i){Bd("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(t).then(e,i)},!(e.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){const t=function(t,e,r){e in t&&!(r in t)&&(t[r]=t[e],delete t[e])},e=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(r){return"object"==typeof r&&"object"==typeof r.audio&&(r=JSON.parse(JSON.stringify(r)),t(r.audio,"autoGainControl","mozAutoGainControl"),t(r.audio,"noiseSuppression","mozNoiseSuppression")),e(r)},i&&i.prototype.getSettings){const e=i.prototype.getSettings;i.prototype.getSettings=function(){const r=e.apply(this,arguments);return t(r,"mozAutoGainControl","autoGainControl"),t(r,"mozNoiseSuppression","noiseSuppression"),r}}if(i&&i.prototype.applyConstraints){const e=i.prototype.applyConstraints;i.prototype.applyConstraints=function(r){return"audio"===this.kind&&"object"==typeof r&&(r=JSON.parse(JSON.stringify(r)),t(r,"autoGainControl","mozAutoGainControl"),t(r,"noiseSuppression","mozNoiseSuppression")),e.apply(this,[r])}}}}function nf(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function of(t,e){if("object"!=typeof t||!t.RTCPeerConnection&&!t.mozRTCPeerConnection)return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const r=t.RTCPeerConnection.prototype[e],i={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=i[e]}));const r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,n,o]=arguments;return i.apply(this,[t||null]).then((t=>{if(e.version<53&&!n)try{t.forEach((t=>{t.type=r[t.type]||t.type}))}catch(e){if("TypeError"!==e.name)throw e;t.forEach(((e,i)=>{t.set(i,Object.assign({},e,{type:r[e.type]||e.type}))}))}return t})).then(n,o)}}function sf(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t});const r=t.RTCPeerConnection.prototype.addTrack;r&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=r.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function af(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach((t=>t._pc=this)),t}),Ld(t,"track",(t=>(t.receiver._pc=t.srcElement,t))),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function uf(t){t.RTCPeerConnection&&!("removeStream"in t.RTCPeerConnection.prototype)&&(t.RTCPeerConnection.prototype.removeStream=function(t){Bd("removeStream","removeTrack"),this.getSenders().forEach((e=>{e.track&&t.getTracks().includes(e.track)&&this.removeTrack(e)}))})}function hf(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function cf(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const t=arguments[1],r=t&&"sendEncodings"in t;r&&t.sendEncodings.forEach((t=>{if("rid"in t){if(!/^[a-z0-9]{0,16}$/i.test(t.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in t&&!(parseFloat(t.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in t&&!(parseFloat(t.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const i=e.apply(this,arguments);if(r){const{sender:e}=i,r=e.getParameters();(!("encodings"in r)||1===r.encodings.length&&0===Object.keys(r.encodings[0]).length)&&(r.encodings=t.sendEncodings,e.sendEncodings=t.sendEncodings,this.setParametersPromises.push(e.setParameters(r).then((()=>{delete e.sendEncodings})).catch((()=>{delete e.sendEncodings}))))}return i})}function lf(t){if("object"!=typeof t||!t.RTCRtpSender)return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const t=e.apply(this,arguments);return"encodings"in t||(t.encodings=[].concat(this.sendEncodings||[{}])),t})}function df(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>e.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):e.apply(this,arguments)}}function ff(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>e.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):e.apply(this,arguments)}}var pf=Object.freeze({__proto__:null,shimOnTrack:nf,shimPeerConnection:of,shimSenderGetStats:sf,shimReceiverGetStats:af,shimRemoveStream:uf,shimRTCDataChannel:hf,shimAddTransceiver:cf,shimGetParameters:lf,shimCreateOffer:df,shimCreateAnswer:ff,shimGetUserMedia:rf,shimGetDisplayMedia:function(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){const t=new DOMException("getDisplayMedia without video constraints is undefined");return t.name="NotFoundError",t.code=8,Promise.reject(t)}return!0===r.video?r.video={mediaSource:e}:r.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(r)})}});function mf(t){if("object"==typeof t&&t.RTCPeerConnection){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(t){this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getAudioTracks().forEach((r=>e.call(this,r,t))),t.getVideoTracks().forEach((r=>e.call(this,r,t)))},t.RTCPeerConnection.prototype.addTrack=function(t,...r){return r&&r.forEach((t=>{this._localStreams?this._localStreams.includes(t)||this._localStreams.push(t):this._localStreams=[t]})),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const e=this._localStreams.indexOf(t);if(-1===e)return;this._localStreams.splice(e,1);const r=t.getTracks();this.getSenders().forEach((t=>{r.includes(t.track)&&this.removeTrack(t)}))})}}function vf(t){if("object"==typeof t&&t.RTCPeerConnection&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=t=>{t.streams.forEach((t=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(t))return;this._remoteStreams.push(t);const e=new Event("addstream");e.stream=t,this.dispatchEvent(e)}))})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((e=>{if(t._remoteStreams||(t._remoteStreams=[]),t._remoteStreams.indexOf(e)>=0)return;t._remoteStreams.push(e);const r=new Event("addstream");r.stream=e,t.dispatchEvent(r)}))}),e.apply(t,arguments)}}}function _f(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,r=e.createOffer,i=e.createAnswer,n=e.setLocalDescription,o=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(t,e){const i=arguments.length>=2?arguments[2]:arguments[0],n=r.apply(this,[i]);return e?(n.then(t,e),Promise.resolve()):n},e.createAnswer=function(t,e){const r=arguments.length>=2?arguments[2]:arguments[0],n=i.apply(this,[r]);return e?(n.then(t,e),Promise.resolve()):n};let a=function(t,e,r){const i=n.apply(this,[t]);return r?(i.then(e,r),Promise.resolve()):i};e.setLocalDescription=a,a=function(t,e,r){const i=o.apply(this,[t]);return r?(i.then(e,r),Promise.resolve()):i},e.setRemoteDescription=a,a=function(t,e,r){const i=s.apply(this,[t]);return r?(i.then(e,r),Promise.resolve()):i},e.addIceCandidate=a}function yf(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,r=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=t=>r(gf(t))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(t,r,i){e.mediaDevices.getUserMedia(t).then(r,i)}.bind(e))}function gf(t){return t&&void 0!==t.video?Object.assign({},t,{video:Xd(t.video)}):t}function bf(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(t,r){if(t&&t.iceServers){const e=[];for(let r=0;r<t.iceServers.length;r++){let i=t.iceServers[r];!i.hasOwnProperty("urls")&&i.hasOwnProperty("url")?(Bd("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,e.push(i)):e.push(t.iceServers[r])}t.iceServers=e}return new e(t,r)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:()=>e.generateCertificate})}function Tf(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Ef(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(t){if(t){void 0!==t.offerToReceiveAudio&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);const e=this.getTransceivers().find((t=>"audio"===t.receiver.track.kind));!1===t.offerToReceiveAudio&&e?"sendrecv"===e.direction?e.setDirection?e.setDirection("sendonly"):e.direction="sendonly":"recvonly"===e.direction&&(e.setDirection?e.setDirection("inactive"):e.direction="inactive"):!0!==t.offerToReceiveAudio||e||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==t.offerToReceiveVideo&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);const r=this.getTransceivers().find((t=>"video"===t.receiver.track.kind));!1===t.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==t.offerToReceiveVideo||r||this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function xf(t){"object"!=typeof t||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var Rf=Object.freeze({__proto__:null,shimLocalStreamsAPI:mf,shimRemoteStreamsAPI:vf,shimCallbacksAPI:_f,shimGetUserMedia:yf,shimConstraints:gf,shimRTCIceServerUrls:bf,shimTrackEventTransceiver:Tf,shimCreateOfferLegacy:Ef,shimAudioContext:xf}),Sf={exports:{}};!function(t){const e={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split("\n").map((t=>t.trim()))},e.splitSections=function(t){return t.split("\nm=").map(((t,e)=>(e>0?"m="+t:t).trim()+"\r\n"))},e.getDescription=function(t){const r=e.splitSections(t);return r&&r[0]},e.getMediaSections=function(t){const r=e.splitSections(t);return r.shift(),r},e.matchPrefix=function(t,r){return e.splitLines(t).filter((t=>0===t.indexOf(r)))},e.parseCandidate=function(t){let e;e=0===t.indexOf("a=candidate:")?t.substring(12).split(" "):t.substring(10).split(" ");const r={foundation:e[0],component:{1:"rtp",2:"rtcp"}[e[1]]||e[1],protocol:e[2].toLowerCase(),priority:parseInt(e[3],10),ip:e[4],address:e[4],port:parseInt(e[5],10),type:e[7]};for(let t=8;t<e.length;t+=2)switch(e[t]){case"raddr":r.relatedAddress=e[t+1];break;case"rport":r.relatedPort=parseInt(e[t+1],10);break;case"tcptype":r.tcpType=e[t+1];break;case"ufrag":r.ufrag=e[t+1],r.usernameFragment=e[t+1];break;default:void 0===r[e[t]]&&(r[e[t]]=e[t+1])}return r},e.writeCandidate=function(t){const e=[];e.push(t.foundation);const r=t.component;"rtp"===r?e.push(1):"rtcp"===r?e.push(2):e.push(r),e.push(t.protocol.toUpperCase()),e.push(t.priority),e.push(t.address||t.ip),e.push(t.port);const i=t.type;return e.push("typ"),e.push(i),"host"!==i&&t.relatedAddress&&t.relatedPort&&(e.push("raddr"),e.push(t.relatedAddress),e.push("rport"),e.push(t.relatedPort)),t.tcpType&&"tcp"===t.protocol.toLowerCase()&&(e.push("tcptype"),e.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(e.push("ufrag"),e.push(t.usernameFragment||t.ufrag)),"candidate:"+e.join(" ")},e.parseIceOptions=function(t){return t.substr(14).split(" ")},e.parseRtpMap=function(t){let e=t.substr(9).split(" ");const r={payloadType:parseInt(e.shift(),10)};return e=e[0].split("/"),r.name=e[0],r.clockRate=parseInt(e[1],10),r.channels=3===e.length?parseInt(e[2],10):1,r.numChannels=r.channels,r},e.writeRtpMap=function(t){let e=t.payloadType;void 0!==t.preferredPayloadType&&(e=t.preferredPayloadType);const r=t.channels||t.numChannels||1;return"a=rtpmap:"+e+" "+t.name+"/"+t.clockRate+(1!==r?"/"+r:"")+"\r\n"},e.parseExtmap=function(t){const e=t.substr(9).split(" ");return{id:parseInt(e[0],10),direction:e[0].indexOf("/")>0?e[0].split("/")[1]:"sendrecv",uri:e[1]}},e.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&"sendrecv"!==t.direction?"/"+t.direction:"")+" "+t.uri+"\r\n"},e.parseFmtp=function(t){const e={};let r;const i=t.substr(t.indexOf(" ")+1).split(";");for(let t=0;t<i.length;t++)r=i[t].trim().split("="),e[r[0].trim()]=r[1];return e},e.writeFmtp=function(t){let e="",r=t.payloadType;if(void 0!==t.preferredPayloadType&&(r=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){const i=[];Object.keys(t.parameters).forEach((e=>{void 0!==t.parameters[e]?i.push(e+"="+t.parameters[e]):i.push(e)})),e+="a=fmtp:"+r+" "+i.join(";")+"\r\n"}return e},e.parseRtcpFb=function(t){const e=t.substr(t.indexOf(" ")+1).split(" ");return{type:e.shift(),parameter:e.join(" ")}},e.writeRtcpFb=function(t){let e="",r=t.payloadType;return void 0!==t.preferredPayloadType&&(r=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach((t=>{e+="a=rtcp-fb:"+r+" "+t.type+(t.parameter&&t.parameter.length?" "+t.parameter:"")+"\r\n"})),e},e.parseSsrcMedia=function(t){const e=t.indexOf(" "),r={ssrc:parseInt(t.substr(7,e-7),10)},i=t.indexOf(":",e);return i>-1?(r.attribute=t.substr(e+1,i-e-1),r.value=t.substr(i+1)):r.attribute=t.substr(e+1),r},e.parseSsrcGroup=function(t){const e=t.substr(13).split(" ");return{semantics:e.shift(),ssrcs:e.map((t=>parseInt(t,10)))}},e.getMid=function(t){const r=e.matchPrefix(t,"a=mid:")[0];if(r)return r.substr(6)},e.parseFingerprint=function(t){const e=t.substr(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1].toUpperCase()}},e.getDtlsParameters=function(t,r){return{role:"auto",fingerprints:e.matchPrefix(t+r,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(t,e){let r="a=setup:"+e+"\r\n";return t.fingerprints.forEach((t=>{r+="a=fingerprint:"+t.algorithm+" "+t.value+"\r\n"})),r},e.parseCryptoLine=function(t){const e=t.substr(9).split(" ");return{tag:parseInt(e[0],10),cryptoSuite:e[1],keyParams:e[2],sessionParams:e.slice(3)}},e.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+("object"==typeof t.keyParams?e.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+"\r\n"},e.parseCryptoKeyParams=function(t){if(0!==t.indexOf("inline:"))return null;const e=t.substr(7).split("|");return{keyMethod:"inline",keySalt:e[0],lifeTime:e[1],mkiValue:e[2]?e[2].split(":")[0]:void 0,mkiLength:e[2]?e[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},e.getCryptoParameters=function(t,r){return e.matchPrefix(t+r,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(t,r){const i=e.matchPrefix(t+r,"a=ice-ufrag:")[0],n=e.matchPrefix(t+r,"a=ice-pwd:")[0];return i&&n?{usernameFragment:i.substr(12),password:n.substr(10)}:null},e.writeIceParameters=function(t){let e="a=ice-ufrag:"+t.usernameFragment+"\r\na=ice-pwd:"+t.password+"\r\n";return t.iceLite&&(e+="a=ice-lite\r\n"),e},e.parseRtpParameters=function(t){const r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=e.splitLines(t)[0].split(" ");for(let n=3;n<i.length;n++){const o=i[n],s=e.matchPrefix(t,"a=rtpmap:"+o+" ")[0];if(s){const i=e.parseRtpMap(s),n=e.matchPrefix(t,"a=fmtp:"+o+" ");switch(i.parameters=n.length?e.parseFmtp(n[0]):{},i.rtcpFeedback=e.matchPrefix(t,"a=rtcp-fb:"+o+" ").map(e.parseRtcpFb),r.codecs.push(i),i.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(i.name.toUpperCase())}}}return e.matchPrefix(t,"a=extmap:").forEach((t=>{r.headerExtensions.push(e.parseExtmap(t))})),r},e.writeRtpDescription=function(t,r){let i="";i+="m="+t+" ",i+=r.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=r.codecs.map((t=>void 0!==t.preferredPayloadType?t.preferredPayloadType:t.payloadType)).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",r.codecs.forEach((t=>{i+=e.writeRtpMap(t),i+=e.writeFmtp(t),i+=e.writeRtcpFb(t)}));let n=0;return r.codecs.forEach((t=>{t.maxptime>n&&(n=t.maxptime)})),n>0&&(i+="a=maxptime:"+n+"\r\n"),r.headerExtensions&&r.headerExtensions.forEach((t=>{i+=e.writeExtmap(t)})),i},e.parseRtpEncodingParameters=function(t){const r=[],i=e.parseRtpParameters(t),n=-1!==i.fecMechanisms.indexOf("RED"),o=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=e.matchPrefix(t,"a=ssrc:").map((t=>e.parseSsrcMedia(t))).filter((t=>"cname"===t.attribute)),a=s.length>0&&s[0].ssrc;let u;const h=e.matchPrefix(t,"a=ssrc-group:FID").map((t=>t.substr(17).split(" ").map((t=>parseInt(t,10)))));h.length>0&&h[0].length>1&&h[0][0]===a&&(u=h[0][1]),i.codecs.forEach((t=>{if("RTX"===t.name.toUpperCase()&&t.parameters.apt){let e={ssrc:a,codecPayloadType:parseInt(t.parameters.apt,10)};a&&u&&(e.rtx={ssrc:u}),r.push(e),n&&(e=JSON.parse(JSON.stringify(e)),e.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},r.push(e))}})),0===r.length&&a&&r.push({ssrc:a});let c=e.matchPrefix(t,"b=");return c.length&&(c=0===c[0].indexOf("b=TIAS:")?parseInt(c[0].substr(7),10):0===c[0].indexOf("b=AS:")?1e3*parseInt(c[0].substr(5),10)*.95-16e3:void 0,r.forEach((t=>{t.maxBitrate=c}))),r},e.parseRtcpParameters=function(t){const r={},i=e.matchPrefix(t,"a=ssrc:").map((t=>e.parseSsrcMedia(t))).filter((t=>"cname"===t.attribute))[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);const n=e.matchPrefix(t,"a=rtcp-rsize");r.reducedSize=n.length>0,r.compound=0===n.length;const o=e.matchPrefix(t,"a=rtcp-mux");return r.mux=o.length>0,r},e.writeRtcpParameters=function(t){let e="";return t.reducedSize&&(e+="a=rtcp-rsize\r\n"),t.mux&&(e+="a=rtcp-mux\r\n"),void 0!==t.ssrc&&t.cname&&(e+="a=ssrc:"+t.ssrc+" cname:"+t.cname+"\r\n"),e},e.parseMsid=function(t){let r;const i=e.matchPrefix(t,"a=msid:");if(1===i.length)return r=i[0].substr(7).split(" "),{stream:r[0],track:r[1]};const n=e.matchPrefix(t,"a=ssrc:").map((t=>e.parseSsrcMedia(t))).filter((t=>"msid"===t.attribute));return n.length>0?(r=n[0].value.split(" "),{stream:r[0],track:r[1]}):void 0},e.parseSctpDescription=function(t){const r=e.parseMLine(t),i=e.matchPrefix(t,"a=max-message-size:");let n;i.length>0&&(n=parseInt(i[0].substr(19),10)),isNaN(n)&&(n=65536);const o=e.matchPrefix(t,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:r.fmt,maxMessageSize:n};const s=e.matchPrefix(t,"a=sctpmap:");if(s.length>0){const t=s[0].substr(10).split(" ");return{port:parseInt(t[0],10),protocol:t[1],maxMessageSize:n}}},e.writeSctpDescription=function(t,e){let r=[];return r="DTLS/SCTP"!==t.protocol?["m="+t.kind+" 9 "+t.protocol+" "+e.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+e.port+"\r\n"]:["m="+t.kind+" 9 "+t.protocol+" "+e.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+e.port+" "+e.protocol+" 65535\r\n"],void 0!==e.maxMessageSize&&r.push("a=max-message-size:"+e.maxMessageSize+"\r\n"),r.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,21)},e.writeSessionBoilerplate=function(t,r,i){let n;const o=void 0!==r?r:2;n=t||e.generateSessionId();return"v=0\r\no="+(i||"thisisadapterortc")+" "+n+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},e.getDirection=function(t,r){const i=e.splitLines(t);for(let t=0;t<i.length;t++)switch(i[t]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[t].substr(2)}return r?e.getDirection(r):"sendrecv"},e.getKind=function(t){return e.splitLines(t)[0].split(" ")[0].substr(2)},e.isRejected=function(t){return"0"===t.split(" ",2)[1]},e.parseMLine=function(t){const r=e.splitLines(t)[0].substr(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},e.parseOLine=function(t){const r=e.matchPrefix(t,"o=")[0].substr(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},e.isValidSDP=function(t){if("string"!=typeof t||0===t.length)return!1;const r=e.splitLines(t);for(let t=0;t<r.length;t++)if(r[t].length<2||"="!==r[t].charAt(1))return!1;return!0},t.exports=e}(Sf);var Af=Sf.exports,If=t({__proto__:null,default:Af},[Sf.exports]);function Cf(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(t){if("object"==typeof t&&t.candidate&&0===t.candidate.indexOf("a=")&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substr(2)),t.candidate&&t.candidate.length){const r=new e(t),i=Af.parseCandidate(t.candidate),n=Object.assign(r,i);return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new e(t)},t.RTCIceCandidate.prototype=e.prototype,Ld(t,"icecandidate",(e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new t.RTCIceCandidate(e.candidate),writable:"false"}),e)))}function Of(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const r=function(t){if(!t||!t.sdp)return!1;const e=Af.splitSections(t.sdp);return e.shift(),e.some((t=>{const e=Af.parseMLine(t);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")}))},i=function(t){const e=t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;const r=parseInt(e[1],10);return r!=r?-1:r},n=function(t){let r=65536;return"firefox"===e.browser&&(r=e.version<57?-1===t?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),r},o=function(t,r){let i=65536;"firefox"===e.browser&&57===e.version&&(i=65535);const n=Af.matchPrefix(t.sdp,"a=max-message-size:");return n.length>0?i=parseInt(n[0].substr(19),10):"firefox"===e.browser&&-1!==r&&(i=2147483637),i},s=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76){const{sdpSemantics:t}=this.getConfiguration();"plan-b"===t&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(r(arguments[0])){const t=i(arguments[0]),e=n(t),r=o(arguments[0],t);let s;s=0===e&&0===r?Number.POSITIVE_INFINITY:0===e||0===r?Math.max(e,r):Math.min(e,r);const a={};Object.defineProperty(a,"maxMessageSize",{get:()=>s}),this._sctp=a}return s.apply(this,arguments)}}function wf(t){if(!t.RTCPeerConnection||!("createDataChannel"in t.RTCPeerConnection.prototype))return;function e(t,e){const r=t.send;t.send=function(){const i=arguments[0],n=i.length||i.size||i.byteLength;if("open"===t.readyState&&e.sctp&&n>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return r.apply(t,arguments)}}const r=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const t=r.apply(this,arguments);return e(t,this),t},Ld(t,"datachannel",(t=>(e(t.channel,t.target),t)))}function Pf(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((t=>{const r=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=t=>{const e=t.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;const r=new Event("connectionstatechange",t);e.dispatchEvent(r)}return t},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}function Nf(t,e){if(!t.RTCPeerConnection)return;if("chrome"===e.browser&&e.version>=71)return;if("safari"===e.browser&&e.version>=605)return;const r=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){const r=e.sdp.split("\n").filter((t=>"a=extmap-allow-mixed"!==t.trim())).join("\n");t.RTCSessionDescription&&e instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:e.type,sdp:r}):e.sdp=r}return r.apply(this,arguments)}}function Mf(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const r=t.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===e.browser&&e.version<78||"firefox"===e.browser&&e.version<68||"safari"===e.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Df(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const r=t.RTCPeerConnection.prototype.setLocalDescription;r&&0!==r.length&&(t.RTCPeerConnection.prototype.setLocalDescription=function(){let t=arguments[0]||{};if("object"!=typeof t||t.type&&t.sdp)return r.apply(this,arguments);if(t={type:t.type,sdp:t.sdp},!t.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":t.type="offer";break;default:t.type="answer"}if(t.sdp||"offer"!==t.type&&"answer"!==t.type)return r.apply(this,[t]);const e="offer"===t.type?this.createOffer:this.createAnswer;return e.apply(this).then((t=>r.apply(this,[t])))})}var Lf=Object.freeze({__proto__:null,shimRTCIceCandidate:Cf,shimMaxMessageSize:Of,shimSendThrowTypeError:wf,shimConnectionState:Pf,removeExtmapAllowMixed:Nf,shimAddIceCandidateNullOrEmpty:Mf,shimParameterlessSetLocalDescription:Df});const Uf=function({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const r=Gd,i=function(t){const e={browser:null,version:null};if(void 0===t||!t.navigator)return e.browser="Not a browser.",e;const{navigator:r}=t;if(r.mozGetUserMedia)e.browser="firefox",e.version=Dd(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===t.isSecureContext&&t.webkitRTCPeerConnection&&!t.RTCIceGatherer)e.browser="chrome",e.version=Dd(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!t.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=Dd(r.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype}return e}(t),n={browserDetails:i,commonShim:Lf,extractVersion:Dd,disableLog:Ud,disableWarnings:Fd,sdp:If};switch(i.browser){case"chrome":if(!ef||!$d||!e.shimChrome)return r("Chrome shim is not included in this adapter release."),n;if(null===i.version)return r("Chrome shim can not determine version, not shimming."),n;r("adapter.js shimming chrome."),n.browserShim=ef,Mf(t,i),Df(t),Yd(t,i),Wd(t),$d(t,i),zd(t),Qd(t,i),Zd(t),Kd(t),qd(t),tf(t,i),Cf(t),Pf(t),Of(t,i),wf(t),Nf(t,i);break;case"firefox":if(!pf||!of||!e.shimFirefox)return r("Firefox shim is not included in this adapter release."),n;r("adapter.js shimming firefox."),n.browserShim=pf,Mf(t,i),Df(t),rf(t,i),of(t,i),nf(t),uf(t),sf(t),af(t),hf(t),cf(t),lf(t),df(t),ff(t),Cf(t),Pf(t),Of(t,i),wf(t);break;case"safari":if(!Rf||!e.shimSafari)return r("Safari shim is not included in this adapter release."),n;r("adapter.js shimming safari."),n.browserShim=Rf,Mf(t,i),Df(t),bf(t),Ef(t),_f(t),mf(t),vf(t),Tf(t),yf(t),xf(t),Cf(t),Of(t,i),wf(t),Nf(t,i);break;default:r("Unsupported browser!")}return n}({window:"undefined"==typeof window?void 0:window});let Ff=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"),"");var Gf={exports:{}},Bf=1e3,kf=60*Bf,Xf=60*kf,Hf=24*Xf,jf=7*Hf,Vf=365.25*Hf,Yf=function(t,e){e=e||{};var r=typeof t;if("string"===r&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*Vf;case"weeks":case"week":case"w":return r*jf;case"days":case"day":case"d":return r*Hf;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Xf;case"minutes":case"minute":case"mins":case"min":case"m":return r*kf;case"seconds":case"second":case"secs":case"sec":case"s":return r*Bf;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===r&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=Hf)return Wf(t,e,Hf,"day");if(e>=Xf)return Wf(t,e,Xf,"hour");if(e>=kf)return Wf(t,e,kf,"minute");if(e>=Bf)return Wf(t,e,Bf,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=Hf)return Math.round(t/Hf)+"d";if(e>=Xf)return Math.round(t/Xf)+"h";if(e>=kf)return Math.round(t/kf)+"m";if(e>=Bf)return Math.round(t/Bf)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Wf(t,e,r,i){var n=e>=1.5*r;return Math.round(t/r)+" "+i+(n?"s":"")}var zf=function(t){function e(t){let i,n,o,s=null;function a(...t){if(!a.enabled)return;const r=a,n=Number(new Date),o=n-(i||n);r.diff=o,r.prev=i,r.curr=n,i=n,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((i,n)=>{if("%%"===i)return"%";s++;const o=e.formatters[n];if("function"==typeof o){const e=t[s];i=o.call(r,e),t.splice(s,1),s--}return i})),e.formatArgs.call(r,t);(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(n!==e.namespaces&&(n=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,r){const i=e(this.namespace+(void 0===r?":":r)+t);return i.log=this.log,i}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const i=("string"==typeof t?t:"").split(/[\s,]+/),n=i.length;for(r=0;r<n;r++)i[r]&&("-"===(t=i[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,i;for(r=0,i=e.skips.length;r<i;r++)if(e.skips[r].test(t))return!1;for(r=0,i=e.names.length;r<i;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=Yf,e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e};!function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let i=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(i++,"%c"===t&&(n=i))})),e.splice(n,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=zf(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(Gf,Gf.exports);var Zf,Kf,qf=Gf.exports,Jf="max-width:100%;max-height:100%;object-fit:contain;display:block;margin:0 auto;",Qf={"120p":{width:160,height:120,frameRate:15,bitrate:200},"180p":{width:320,height:180,frameRate:15,bitrate:350},"240p":{width:320,height:240,frameRate:15,bitrate:400},"360p":{width:640,height:360,frameRate:15,bitrate:800},"480p":{width:640,height:480,frameRate:15,bitrate:900},"720p":{width:1280,height:720,frameRate:15,bitrate:1500},"1080p":{width:1920,height:1080,frameRate:15,bitrate:2e3},"2K":{width:2560,height:1440,frameRate:30,bitrate:4860},"4K":{width:3840,height:2160,frameRate:30,bitrate:9e3}},$f={standard:{sampleRate:48e3,bitrate:40},high:{sampleRate:48e3,bitrate:128}};!function(t){t[t.TXLIVE_ERROR_WEBRTC_FAILED=-1]="TXLIVE_ERROR_WEBRTC_FAILED",t[t.TXLIVE_ERROR_REQUEST_FAILED=-2]="TXLIVE_ERROR_REQUEST_FAILED",t[t.TXLIVE_WARNING_CAMERA_START_FAILED=-1001]="TXLIVE_WARNING_CAMERA_START_FAILED",t[t.TXLIVE_WARNING_MICROPHONE_START_FAILED=-1002]="TXLIVE_WARNING_MICROPHONE_START_FAILED",t[t.TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED=-1003]="TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED",t[t.TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED=-1004]="TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED",t[t.TXLIVE_WARNING_CAMERA_INTERRUPTED=-1005]="TXLIVE_WARNING_CAMERA_INTERRUPTED",t[t.TXLIVE_WARNING_MICROPHONE_INTERRUPTED=-1006]="TXLIVE_WARNING_MICROPHONE_INTERRUPTED",t[t.TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED=-1007]="TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED"}(Zf||(Zf={})),function(t){t[t.TXLIVE_PUSH_STATUS_DISCONNECTED=0]="TXLIVE_PUSH_STATUS_DISCONNECTED",t[t.TXLIVE_PUSH_STATUS_CONNECTING=1]="TXLIVE_PUSH_STATUS_CONNECTING",t[t.TXLIVE_PUSH_STATUS_CONNECTED=2]="TXLIVE_PUSH_STATUS_CONNECTED",t[t.TXLIVE_PUSH_STATUS_RECONNECTING=3]="TXLIVE_PUSH_STATUS_RECONNECTING"}(Kf||(Kf={}));var tp,ep,rp="disconnected",ip="connecting",np="connected",op="request_push_start",sp="request_push_success",ap=["device","screen","file"],up={deviceId:"",frameRate:15,resolution:{width:1280,height:720}},hp={deviceId:"",sampleRate:48e3,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},cp=["image/bmp","image/jpeg","image/png"],lp=[".bmp",".jpeg",".jpg",".png"],dp={type:ql(tp=["video/mp4","video/webm","video/ogg","audio/mpeg","audio/ogg","audio/wav"]).call(tp,cp),extension:ql(ep=[".mp4",".webm",".ogg",".mp3",".wav"]).call(ep,lp)},fp="track_stop",pp="stream_stop",mp="object"==typeof e&&e&&e.Object===Object&&e,vp=mp,_p="object"==typeof self&&self&&self.Object===Object&&self,yp=vp||_p||Function("return this")(),gp=yp.Symbol,bp=gp,Tp=Object.prototype,Ep=Tp.hasOwnProperty,xp=Tp.toString,Rp=bp?bp.toStringTag:void 0;var Sp=function(t){var e=Ep.call(t,Rp),r=t[Rp];try{t[Rp]=void 0;var i=!0}catch(t){}var n=xp.call(t);return i&&(e?t[Rp]=r:delete t[Rp]),n},Ap=Object.prototype.toString;var Ip=Sp,Cp=function(t){return Ap.call(t)},Op=gp?gp.toStringTag:void 0;var wp=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Op&&Op in Object(t)?Ip(t):Cp(t)};var Pp=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Np=wp,Mp=Pp;var Dp=function(t){if(!Mp(t))return!1;var e=Np(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Lp=yp["__core-js_shared__"],Up=function(){var t=/[^.]+$/.exec(Lp&&Lp.keys&&Lp.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var Fp=function(t){return!!Up&&Up in t},Gp=Function.prototype.toString;var Bp=function(t){if(null!=t){try{return Gp.call(t)}catch(t){}try{return t+""}catch(t){}}return""},kp=Dp,Xp=Fp,Hp=Pp,jp=Bp,Vp=/^\[object .+?Constructor\]$/,Yp=Function.prototype,Wp=Object.prototype,zp=Yp.toString,Zp=Wp.hasOwnProperty,Kp=RegExp("^"+zp.call(Zp).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var qp=function(t){return!(!Hp(t)||Xp(t))&&(kp(t)?Kp:Vp).test(jp(t))},Jp=function(t,e){return null==t?void 0:t[e]};var Qp=function(t,e){var r=Jp(t,e);return qp(r)?r:void 0},$p=Qp(Object,"create"),tm=$p;var em=function(){this.__data__=tm?tm(null):{},this.size=0};var rm=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},im=$p,nm=Object.prototype.hasOwnProperty;var om=function(t){var e=this.__data__;if(im){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return nm.call(e,t)?e[t]:void 0},sm=$p,am=Object.prototype.hasOwnProperty;var um=function(t){var e=this.__data__;return sm?void 0!==e[t]:am.call(e,t)},hm=$p;var cm=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=hm&&void 0===e?"__lodash_hash_undefined__":e,this},lm=em,dm=rm,fm=om,pm=um,mm=cm;function vm(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}vm.prototype.clear=lm,vm.prototype.delete=dm,vm.prototype.get=fm,vm.prototype.has=pm,vm.prototype.set=mm;var _m=vm;var ym=function(){this.__data__=[],this.size=0};var gm=function(t,e){return t===e||t!=t&&e!=e},bm=gm;var Tm=function(t,e){for(var r=t.length;r--;)if(bm(t[r][0],e))return r;return-1},Em=Tm,xm=Array.prototype.splice;var Rm=function(t){var e=this.__data__,r=Em(e,t);return!(r<0)&&(r==e.length-1?e.pop():xm.call(e,r,1),--this.size,!0)},Sm=Tm;var Am=function(t){var e=this.__data__,r=Sm(e,t);return r<0?void 0:e[r][1]},Im=Tm;var Cm=Tm;var Om=function(t,e){var r=this.__data__,i=Cm(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this},wm=ym,Pm=Rm,Nm=Am,Mm=function(t){return Im(this.__data__,t)>-1},Dm=Om;function Lm(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}Lm.prototype.clear=wm,Lm.prototype.delete=Pm,Lm.prototype.get=Nm,Lm.prototype.has=Mm,Lm.prototype.set=Dm;var Um=Lm,Fm=Qp(yp,"Map"),Gm=_m,Bm=Um,km=Fm;var Xm=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Hm=function(t,e){var r=t.__data__;return Xm(e)?r["string"==typeof e?"string":"hash"]:r.map},jm=Hm;var Vm=Hm;var Ym=Hm;var Wm=Hm;var zm=function(t,e){var r=Wm(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},Zm=function(){this.size=0,this.__data__={hash:new Gm,map:new(km||Bm),string:new Gm}},Km=function(t){var e=jm(this,t).delete(t);return this.size-=e?1:0,e},qm=function(t){return Vm(this,t).get(t)},Jm=function(t){return Ym(this,t).has(t)},Qm=zm;function $m(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}$m.prototype.clear=Zm,$m.prototype.delete=Km,$m.prototype.get=qm,$m.prototype.has=Jm,$m.prototype.set=Qm;var tv=$m;var ev=tv,rv=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},iv=function(t){return this.__data__.has(t)};function nv(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ev;++e<r;)this.add(t[e])}nv.prototype.add=nv.prototype.push=rv,nv.prototype.has=iv;var ov=nv;var sv=function(t,e,r,i){for(var n=t.length,o=r+(i?1:-1);i?o--:++o<n;)if(e(t[o],o,t))return o;return-1},av=function(t){return t!=t},uv=function(t,e,r){for(var i=r-1,n=t.length;++i<n;)if(t[i]===e)return i;return-1};var hv=function(t,e,r){return e==e?uv(t,e,r):sv(t,av,r)};var cv=function(t){return function(e){return t(e)}};var lv=function(t,e){return t.has(e)},dv=ov,fv=function(t,e){return!!(null==t?0:t.length)&&hv(t,e,0)>-1},pv=function(t,e,r){for(var i=-1,n=null==t?0:t.length;++i<n;)if(r(e,t[i]))return!0;return!1},mv=function(t,e){for(var r=-1,i=null==t?0:t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n},vv=cv,_v=lv;var yv=function(t,e,r,i){var n=-1,o=fv,s=!0,a=t.length,u=[],h=e.length;if(!a)return u;r&&(e=mv(e,vv(r))),i?(o=pv,s=!1):e.length>=200&&(o=_v,s=!1,e=new dv(e));t:for(;++n<a;){var c=t[n],l=null==r?c:r(c);if(c=i||0!==c?c:0,s&&l==l){for(var d=h;d--;)if(e[d]===l)continue t;u.push(c)}else o(e,l,i)||u.push(c)}return u};var gv=function(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t};var bv=function(t){return null!=t&&"object"==typeof t},Tv=wp,Ev=bv;var xv=function(t){return Ev(t)&&"[object Arguments]"==Tv(t)},Rv=bv,Sv=Object.prototype,Av=Sv.hasOwnProperty,Iv=Sv.propertyIsEnumerable,Cv=xv(function(){return arguments}())?xv:function(t){return Rv(t)&&Av.call(t,"callee")&&!Iv.call(t,"callee")},Ov=Cv,wv=Array.isArray,Pv=Ov,Nv=wv,Mv=gp?gp.isConcatSpreadable:void 0;var Dv=gv,Lv=function(t){return Nv(t)||Pv(t)||!!(Mv&&t&&t[Mv])};var Uv=function t(e,r,i,n,o){var s=-1,a=e.length;for(i||(i=Lv),o||(o=[]);++s<a;){var u=e[s];r>0&&i(u)?r>1?t(u,r-1,i,n,o):Dv(o,u):n||(o[o.length]=u)}return o};var Fv=function(t){return t};var Gv=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)},Bv=Math.max;var kv=function(t,e,r){return e=Bv(void 0===e?t.length-1:e,0),function(){for(var i=arguments,n=-1,o=Bv(i.length-e,0),s=Array(o);++n<o;)s[n]=i[e+n];n=-1;for(var a=Array(e+1);++n<e;)a[n]=i[n];return a[e]=r(s),Gv(t,this,a)}};var Xv=function(t){return function(){return t}},Hv=Qp,jv=function(){try{var t=Hv(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Vv=Xv,Yv=jv,Wv=Yv?function(t,e){return Yv(t,"toString",{configurable:!0,enumerable:!1,value:Vv(e),writable:!0})}:Fv,zv=Date.now;var Zv=function(t){var e=0,r=0;return function(){var i=zv(),n=16-(i-r);if(r=i,n>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},Kv=Zv(Wv),qv=Fv,Jv=kv,Qv=Kv;var $v=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},t_=Dp,e_=$v;var r_=function(t){return null!=t&&e_(t.length)&&!t_(t)},i_=r_,n_=bv;var o_=yv,s_=Uv,a_=function(t){return n_(t)&&i_(t)},u_=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},h_=function(t,e){return Qv(Jv(t,e,qv),t+"")}((function(t,e){var r=u_(e);return a_(r)&&(r=void 0),a_(t)?o_(t,s_(e,1,a_,!0),void 0,r):[]})),c_=Um;var l_=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var d_=Um,f_=Fm,p_=tv;var m_=function(t,e){var r=this.__data__;if(r instanceof d_){var i=r.__data__;if(!f_||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new p_(i)}return r.set(t,e),this.size=r.size,this},v_=Um,__=function(){this.__data__=new c_,this.size=0},y_=l_,g_=function(t){return this.__data__.get(t)},b_=function(t){return this.__data__.has(t)},T_=m_;function E_(t){var e=this.__data__=new v_(t);this.size=e.size}E_.prototype.clear=__,E_.prototype.delete=y_,E_.prototype.get=g_,E_.prototype.has=b_,E_.prototype.set=T_;var x_=E_;var R_=ov,S_=function(t,e){for(var r=-1,i=null==t?0:t.length;++r<i;)if(e(t[r],r,t))return!0;return!1},A_=lv;var I_=function(t,e,r,i,n,o){var s=1&r,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var h=o.get(t),c=o.get(e);if(h&&c)return h==e&&c==t;var l=-1,d=!0,f=2&r?new R_:void 0;for(o.set(t,e),o.set(e,t);++l<a;){var p=t[l],m=e[l];if(i)var v=s?i(m,p,l,e,t,o):i(p,m,l,t,e,o);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!S_(e,(function(t,e){if(!A_(f,e)&&(p===t||n(p,t,r,i,o)))return f.push(e)}))){d=!1;break}}else if(p!==m&&!n(p,m,r,i,o)){d=!1;break}}return o.delete(t),o.delete(e),d},C_=yp.Uint8Array;var O_=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r};var w_=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},P_=C_,N_=gm,M_=I_,D_=O_,L_=w_,U_=gp?gp.prototype:void 0,F_=U_?U_.valueOf:void 0;var G_=function(t,e,r,i,n,o,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new P_(t),new P_(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return N_(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=D_;case"[object Set]":var u=1&i;if(a||(a=L_),t.size!=e.size&&!u)return!1;var h=s.get(t);if(h)return h==e;i|=2,s.set(t,e);var c=M_(a(t),a(e),i,n,o,s);return s.delete(t),c;case"[object Symbol]":if(F_)return F_.call(t)==F_.call(e)}return!1},B_=gv,k_=wv;var X_=function(t,e,r){var i=e(t);return k_(t)?i:B_(i,r(t))};var H_=function(){return[]},j_=function(t,e){for(var r=-1,i=null==t?0:t.length,n=0,o=[];++r<i;){var s=t[r];e(s,r,t)&&(o[n++]=s)}return o},V_=H_,Y_=Object.prototype.propertyIsEnumerable,W_=Object.getOwnPropertySymbols,z_=W_?function(t){return null==t?[]:(t=Object(t),j_(W_(t),(function(e){return Y_.call(t,e)})))}:V_,Z_=z_;var K_=function(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i},q_={exports:{}};var J_=function(){return!1};!function(t,e){var r=yp,i=J_,n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,s=o&&o.exports===n?r.Buffer:void 0,a=(s?s.isBuffer:void 0)||i;t.exports=a}(q_,q_.exports);var Q_=/^(?:0|[1-9]\d*)$/;var $_=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Q_.test(t))&&t>-1&&t%1==0&&t<e},ty=wp,ey=$v,ry=bv,iy={};iy["[object Float32Array]"]=iy["[object Float64Array]"]=iy["[object Int8Array]"]=iy["[object Int16Array]"]=iy["[object Int32Array]"]=iy["[object Uint8Array]"]=iy["[object Uint8ClampedArray]"]=iy["[object Uint16Array]"]=iy["[object Uint32Array]"]=!0,iy["[object Arguments]"]=iy["[object Array]"]=iy["[object ArrayBuffer]"]=iy["[object Boolean]"]=iy["[object DataView]"]=iy["[object Date]"]=iy["[object Error]"]=iy["[object Function]"]=iy["[object Map]"]=iy["[object Number]"]=iy["[object Object]"]=iy["[object RegExp]"]=iy["[object Set]"]=iy["[object String]"]=iy["[object WeakMap]"]=!1;var ny=function(t){return ry(t)&&ey(t.length)&&!!iy[ty(t)]},oy={exports:{}};!function(t,e){var r=mp,i=e&&!e.nodeType&&e,n=i&&t&&!t.nodeType&&t,o=n&&n.exports===i&&r.process,s=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=s}(oy,oy.exports);var sy=ny,ay=cv,uy=oy.exports,hy=uy&&uy.isTypedArray,cy=hy?ay(hy):sy,ly=K_,dy=Ov,fy=wv,py=q_.exports,my=$_,vy=cy,_y=Object.prototype.hasOwnProperty;var yy=function(t,e){var r=fy(t),i=!r&&dy(t),n=!r&&!i&&py(t),o=!r&&!i&&!n&&vy(t),s=r||i||n||o,a=s?ly(t.length,String):[],u=a.length;for(var h in t)!e&&!_y.call(t,h)||s&&("length"==h||n&&("offset"==h||"parent"==h)||o&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||my(h,u))||a.push(h);return a},gy=Object.prototype;var by=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||gy)};var Ty=function(t,e){return function(r){return t(e(r))}},Ey=Ty(Object.keys,Object),xy=by,Ry=Ey,Sy=Object.prototype.hasOwnProperty;var Ay=yy,Iy=function(t){if(!xy(t))return Ry(t);var e=[];for(var r in Object(t))Sy.call(t,r)&&"constructor"!=r&&e.push(r);return e},Cy=r_;var Oy=function(t){return Cy(t)?Ay(t):Iy(t)},wy=X_,Py=Z_,Ny=Oy;var My=function(t){return wy(t,Ny,Py)},Dy=My,Ly=Object.prototype.hasOwnProperty;var Uy=function(t,e,r,i,n,o){var s=1&r,a=Dy(t),u=a.length;if(u!=Dy(e).length&&!s)return!1;for(var h=u;h--;){var c=a[h];if(!(s?c in e:Ly.call(e,c)))return!1}var l=o.get(t),d=o.get(e);if(l&&d)return l==e&&d==t;var f=!0;o.set(t,e),o.set(e,t);for(var p=s;++h<u;){var m=t[c=a[h]],v=e[c];if(i)var _=s?i(v,m,c,e,t,o):i(m,v,c,t,e,o);if(!(void 0===_?m===v||n(m,v,r,i,o):_)){f=!1;break}p||(p="constructor"==c)}if(f&&!p){var y=t.constructor,g=e.constructor;y==g||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof g&&g instanceof g||(f=!1)}return o.delete(t),o.delete(e),f},Fy=Qp(yp,"DataView"),Gy=Fm,By=Qp(yp,"Promise"),ky=Qp(yp,"Set"),Xy=Qp(yp,"WeakMap"),Hy=wp,jy=Bp,Vy="[object Map]",Yy="[object Promise]",Wy="[object Set]",zy="[object WeakMap]",Zy="[object DataView]",Ky=jy(Fy),qy=jy(Gy),Jy=jy(By),Qy=jy(ky),$y=jy(Xy),tg=Hy;(Fy&&tg(new Fy(new ArrayBuffer(1)))!=Zy||Gy&&tg(new Gy)!=Vy||By&&tg(By.resolve())!=Yy||ky&&tg(new ky)!=Wy||Xy&&tg(new Xy)!=zy)&&(tg=function(t){var e=Hy(t),r="[object Object]"==e?t.constructor:void 0,i=r?jy(r):"";if(i)switch(i){case Ky:return Zy;case qy:return Vy;case Jy:return Yy;case Qy:return Wy;case $y:return zy}return e});var eg=tg,rg=x_,ig=I_,ng=G_,og=Uy,sg=eg,ag=wv,ug=q_.exports,hg=cy,cg="[object Arguments]",lg="[object Array]",dg="[object Object]",fg=Object.prototype.hasOwnProperty;var pg=function(t,e,r,i,n,o){var s=ag(t),a=ag(e),u=s?lg:sg(t),h=a?lg:sg(e),c=(u=u==cg?dg:u)==dg,l=(h=h==cg?dg:h)==dg,d=u==h;if(d&&ug(t)){if(!ug(e))return!1;s=!0,c=!1}if(d&&!c)return o||(o=new rg),s||hg(t)?ig(t,e,r,i,n,o):ng(t,e,u,r,i,n,o);if(!(1&r)){var f=c&&fg.call(t,"__wrapped__"),p=l&&fg.call(e,"__wrapped__");if(f||p){var m=f?t.value():t,v=p?e.value():e;return o||(o=new rg),n(m,v,r,i,o)}}return!!d&&(o||(o=new rg),og(t,e,r,i,n,o))},mg=bv;var vg=function t(e,r,i,n,o){return e===r||(null==e||null==r||!mg(e)&&!mg(r)?e!=e&&r!=r:pg(e,r,i,n,t,o))},_g=vg;var yg=function(t,e){return _g(t,e)},gg="position:fixed;left:0;top:0;pointer-events:none;opacity:0;z-index:-1;",bg=function(t){if("suspended"===t.state){var e=document.body,r=["touchstart","touchend","mouseup","click"];cc(r).call(r,(function(t){return e.addEventListener(t,i,!1)})),i()}function i(){t.resume().then(n).catch(null)}function n(){cc(r).call(r,(function(t){return e.removeEventListener(t,i,!1)}))}},Tg=function(){var t=null;return window.TXLiveAudioContext?t=window.TXLiveAudioContext:(t=new(window.AudioContext||window.webkitAudioContext),bg(t)),t},Eg=function(t){void 0===t&&(t={});var e=t.parentEl,r=void 0===e?document.body:e,i=t.style,n=void 0===i?gg:i,o=t.crossOrigin,s=void 0===o||o,a=t.loop,u=void 0===a||a,h=document.createElement("video");return h.autoplay=!0,h.controls=!1,h.preload="auto",h.playsInline=!0,h.setAttribute("webkit-playsinline",""),h.setAttribute("x5-playsinline",""),h.loop=u,s&&(h.crossOrigin="anonymous"),h.setAttribute("style",n),r.appendChild(h),h},xg="\t\n\v\f\r                　\u2028\u2029\ufeff",Rg=k,Sg=Gi,Ag=v("".replace),Ig="[\t\n\v\f\r                　\u2028\u2029\ufeff]",Cg=RegExp("^"+Ig+Ig+"*"),Og=RegExp(Ig+Ig+"*$"),wg=function(t){return function(e){var r=Sg(Rg(e));return 1&t&&(r=Ag(r,Cg,"")),2&t&&(r=Ag(r,Og,"")),r}},Pg={start:wg(1),end:wg(2),trim:wg(3)},Ng=i,Mg=n,Dg=v,Lg=Gi,Ug=Pg.trim,Fg=xg,Gg=Ng.parseInt,Bg=Ng.Symbol,kg=Bg&&Bg.iterator,Xg=/^[+-]?0x/i,Hg=Dg(Xg.exec),jg=8!==Gg(Fg+"08")||22!==Gg(Fg+"0x16")||kg&&!Mg((function(){Gg(Object(kg))}))?function(t,e){var r=Ug(Lg(t));return Gg(r,e>>>0||(Hg(Xg,r)?16:10))}:Gg;yr({global:!0,forced:parseInt!=jg},{parseInt:jg});var Vg=W.parseInt,Yg=J,Wg=Pn,zg=Wn,Zg=We,Kg=v([].concat),qg=Yg("Reflect","ownKeys")||function(t){var e=Wg.f(Zg(t)),r=zg.f;return r?Kg(e,r(t)):e},Jg=kt,Qg=qg,$g=y,tb=Xe,eb=Error,rb=v("".replace),ib=String(eb("zxcasd").stack),nb=/\n\s*at [^:]*:[^\n]*/,ob=nb.test(ib),sb=Y,ab=sr,ub=Ja,hb=re("iterator"),cb=Array.prototype,lb=function(t){return void 0!==t&&(ub.Array===t||cb[hb]===t)},db=Yr,fb=xt,pb=Ja,mb=re("iterator"),vb=function(t){if(null!=t)return fb(t,mb)||fb(t,"@@iterator")||pb[db(t)]},_b=E,yb=Tt,gb=We,bb=_t,Tb=vb,Eb=TypeError,xb=function(t,e){var r=arguments.length<2?Tb(t):e;if(yb(r))return gb(_b(r,t));throw Eb(bb(t)+" is not iterable")},Rb=E,Sb=We,Ab=xt,Ib=function(t,e,r){var i,n;Sb(t);try{if(!(i=Ab(t,"return"))){if("throw"===e)throw r;return r}i=Rb(i,t)}catch(t){n=!0,i=t}if("throw"===e)throw r;if(n)throw i;return Sb(i),r},Cb=ke,Ob=E,wb=We,Pb=_t,Nb=lb,Mb=wr,Db=Q,Lb=xb,Ub=vb,Fb=Ib,Gb=TypeError,Bb=function(t,e){this.stopped=t,this.result=e},kb=Bb.prototype,Xb=function(t,e,r){var i,n,o,s,a,u,h,c=r&&r.that,l=!(!r||!r.AS_ENTRIES),d=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),m=Cb(e,c),v=function(t){return i&&Fb(i,"normal",t),new Bb(!0,t)},_=function(t){return l?(wb(t),p?m(t[0],t[1],v):m(t[0],t[1])):p?m(t,v):m(t)};if(d)i=t.iterator;else if(f)i=t;else{if(!(n=Ub(t)))throw Gb(Pb(t)+" is not iterable");if(Nb(n)){for(o=0,s=Mb(t);s>o;o++)if((a=_(t[o]))&&Db(kb,a))return a;return new Bb(!1)}i=Lb(t,n)}for(u=d?t.next:i.next;!(h=Ob(u,i)).done;){try{a=_(h.value)}catch(t){Fb(i,"throw",t)}if("object"==typeof a&&a&&Db(kb,a))return a}return new Bb(!1)},Hb=Gi,jb=O,Vb=!n((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",jb(1,7)),7!==t.stack)})),Yb=yr,Wb=Q,zb=du,Zb=Lu,Kb=function(t,e,r){for(var i=Qg(e),n=tb.f,o=$g.f,s=0;s<i.length;s++){var a=i[s];Jg(t,a)||r&&Jg(r,a)||n(t,a,o(e,a))}},qb=wn,Jb=sr,Qb=O,$b=function(t,e){if(ob&&"string"==typeof t&&!eb.prepareStackTrace)for(;e--;)t=rb(t,nb,"");return t},tT=function(t,e){sb(e)&&"cause"in e&&ab(t,"cause",e.cause)},eT=Xb,rT=function(t,e){return void 0===t?arguments.length<2?"":e:Hb(t)},iT=Vb,nT=re("toStringTag"),oT=Error,sT=[].push,aT=function(t,e){var r,i=arguments.length>2?arguments[2]:void 0,n=Wb(uT,this);Zb?r=Zb(new oT,n?zb(this):uT):(r=n?this:qb(uT),Jb(r,nT,"Error")),void 0!==e&&Jb(r,"message",rT(e)),iT&&Jb(r,"stack",$b(r.stack,1)),tT(r,i);var o=[];return eT(t,sT,{that:o}),Jb(r,"errors",o),r};Zb?Zb(aT,oT):Kb(aT,oT,{name:!0});var uT=aT.prototype=qb(oT.prototype,{constructor:Qb(1,aT),message:Qb(1,""),name:Qb(1,"AggregateError")});Yb({global:!0,constructor:!0,arity:2},{AggregateError:aT});var hT,cT,lT,dT,fT="process"==M(i.process),pT=J,mT=Xe,vT=g,_T=re("species"),yT=Q,gT=TypeError,bT=function(t,e){if(yT(e,t))return t;throw gT("Incorrect invocation")},TT=hi,ET=_t,xT=TypeError,RT=We,ST=function(t){if(TT(t))return t;throw xT(ET(t)+" is not a constructor")},AT=re("species"),IT=function(t,e){var r,i=RT(t).constructor;return void 0===i||null==(r=RT(i)[AT])?e:ST(r)},CT=/(?:ipad|iphone|ipod).*applewebkit/i.test($),OT=i,wT=c,PT=ke,NT=_,MT=kt,DT=n,LT=pn,UT=va,FT=ve,GT=Il,BT=CT,kT=fT,XT=OT.setImmediate,HT=OT.clearImmediate,jT=OT.process,VT=OT.Dispatch,YT=OT.Function,WT=OT.MessageChannel,zT=OT.String,ZT=0,KT={},qT="onreadystatechange";try{hT=OT.location}catch(t){}var JT=function(t){if(MT(KT,t)){var e=KT[t];delete KT[t],e()}},QT=function(t){return function(){JT(t)}},$T=function(t){JT(t.data)},tE=function(t){OT.postMessage(zT(t),hT.protocol+"//"+hT.host)};XT&&HT||(XT=function(t){GT(arguments.length,1);var e=NT(t)?t:YT(t),r=UT(arguments,1);return KT[++ZT]=function(){wT(e,void 0,r)},cT(ZT),ZT},HT=function(t){delete KT[t]},kT?cT=function(t){jT.nextTick(QT(t))}:VT&&VT.now?cT=function(t){VT.now(QT(t))}:WT&&!BT?(dT=(lT=new WT).port2,lT.port1.onmessage=$T,cT=PT(dT.postMessage,dT)):OT.addEventListener&&NT(OT.postMessage)&&!OT.importScripts&&hT&&"file:"!==hT.protocol&&!DT(tE)?(cT=tE,OT.addEventListener("message",$T,!1)):cT=qT in FT("script")?function(t){LT.appendChild(FT("script")).onreadystatechange=function(){LT.removeChild(this),JT(t)}}:function(t){setTimeout(QT(t),0)});var eE,rE,iE,nE,oE,sE,aE,uE,hE={set:XT,clear:HT},cE=i,lE=/ipad|iphone|ipod/i.test($)&&void 0!==cE.Pebble,dE=/web0s(?!.*chrome)/i.test($),fE=i,pE=ke,mE=y.f,vE=hE.set,_E=CT,yE=lE,gE=dE,bE=fT,TE=fE.MutationObserver||fE.WebKitMutationObserver,EE=fE.document,xE=fE.process,RE=fE.Promise,SE=mE(fE,"queueMicrotask"),AE=SE&&SE.value;AE||(eE=function(){var t,e;for(bE&&(t=xE.domain)&&t.exit();rE;){e=rE.fn,rE=rE.next;try{e()}catch(t){throw rE?nE():iE=void 0,t}}iE=void 0,t&&t.enter()},_E||bE||gE||!TE||!EE?!yE&&RE&&RE.resolve?((aE=RE.resolve(void 0)).constructor=RE,uE=pE(aE.then,aE),nE=function(){uE(eE)}):bE?nE=function(){xE.nextTick(eE)}:(vE=pE(vE,fE),nE=function(){vE(eE)}):(oE=!0,sE=EE.createTextNode(""),new TE(eE).observe(sE,{characterData:!0}),nE=function(){sE.data=oE=!oE}));var IE=AE||function(t){var e={fn:t,next:void 0};iE&&(iE.next=e),rE||(rE=e,nE()),iE=e},CE=i,OE=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},wE=function(){this.head=null,this.tail=null};wE.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var PE=wE,NE=i.Promise,ME="object"==typeof window&&"object"!=typeof Deno,DE=i,LE=NE,UE=_,FE=Ue,GE=Kr,BE=re,kE=ME,XE=st,HE=LE&&LE.prototype,jE=BE("species"),VE=!1,YE=UE(DE.PromiseRejectionEvent),WE=FE("Promise",(function(){var t=GE(LE),e=t!==String(LE);if(!e&&66===XE)return!0;if(!HE.catch||!HE.finally)return!0;if(XE>=51&&/native code/.test(t))return!1;var r=new LE((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};return(r.constructor={})[jE]=i,!(VE=r.then((function(){}))instanceof i)||!e&&kE&&!YE})),zE={CONSTRUCTOR:WE,REJECTION_EVENT:YE,SUBCLASSING:VE},ZE={},KE=Tt,qE=function(t){var e,r;this.promise=new t((function(t,i){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=i})),this.resolve=KE(e),this.reject=KE(r)};ZE.f=function(t){return new qE(t)};var JE,QE,$E=yr,tx=fT,ex=i,rx=E,ix=Zn,nx=go,ox=function(t){var e=pT(t),r=mT.f;vT&&e&&!e[_T]&&r(e,_T,{configurable:!0,get:function(){return this}})},sx=Tt,ax=_,ux=Y,hx=bT,cx=IT,lx=hE.set,dx=IE,fx=function(t,e){var r=CE.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))},px=OE,mx=PE,vx=ko,_x=NE,yx=ZE,gx="Promise",bx=zE.CONSTRUCTOR,Tx=zE.REJECTION_EVENT,Ex=vx.getterFor(gx),xx=vx.set,Rx=_x&&_x.prototype,Sx=_x,Ax=Rx,Ix=ex.TypeError,Cx=ex.document,Ox=ex.process,wx=yx.f,Px=wx,Nx=!!(Cx&&Cx.createEvent&&ex.dispatchEvent),Mx="unhandledrejection",Dx=function(t){var e;return!(!ux(t)||!ax(e=t.then))&&e},Lx=function(t,e){var r,i,n,o=e.value,s=1==e.state,a=s?t.ok:t.fail,u=t.resolve,h=t.reject,c=t.domain;try{a?(s||(2===e.rejection&&kx(e),e.rejection=1),!0===a?r=o:(c&&c.enter(),r=a(o),c&&(c.exit(),n=!0)),r===t.promise?h(Ix("Promise-chain cycle")):(i=Dx(r))?rx(i,r,u,h):u(r)):h(o)}catch(t){c&&!n&&c.exit(),h(t)}},Ux=function(t,e){t.notified||(t.notified=!0,dx((function(){for(var r,i=t.reactions;r=i.get();)Lx(r,t);t.notified=!1,e&&!t.rejection&&Gx(t)})))},Fx=function(t,e,r){var i,n;Nx?((i=Cx.createEvent("Event")).promise=e,i.reason=r,i.initEvent(t,!1,!0),ex.dispatchEvent(i)):i={promise:e,reason:r},!Tx&&(n=ex["on"+t])?n(i):t===Mx&&fx("Unhandled promise rejection",r)},Gx=function(t){rx(lx,ex,(function(){var e,r=t.facade,i=t.value;if(Bx(t)&&(e=px((function(){tx?Ox.emit("unhandledRejection",i,r):Fx(Mx,r,i)})),t.rejection=tx||Bx(t)?2:1,e.error))throw e.value}))},Bx=function(t){return 1!==t.rejection&&!t.parent},kx=function(t){rx(lx,ex,(function(){var e=t.facade;tx?Ox.emit("rejectionHandled",e):Fx("rejectionhandled",e,t.value)}))},Xx=function(t,e,r){return function(i){t(e,i,r)}},Hx=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Ux(t,!0))},jx=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw Ix("Promise can't be resolved itself");var i=Dx(e);i?dx((function(){var r={done:!1};try{rx(i,e,Xx(jx,r,t),Xx(Hx,r,t))}catch(e){Hx(r,e,t)}})):(t.value=e,t.state=1,Ux(t,!1))}catch(e){Hx({done:!1},e,t)}}};bx&&(Ax=(Sx=function(t){hx(this,Ax),sx(t),rx(JE,this);var e=Ex(this);try{t(Xx(jx,e),Xx(Hx,e))}catch(t){Hx(e,t)}}).prototype,(JE=function(t){xx(this,{type:gx,done:!1,notified:!1,parent:!1,reactions:new mx,rejection:!1,state:0,value:void 0})}).prototype=ix(Ax,"then",(function(t,e){var r=Ex(this),i=wx(cx(this,Sx));return r.parent=!0,i.ok=!ax(t)||t,i.fail=ax(e)&&e,i.domain=tx?Ox.domain:void 0,0==r.state?r.reactions.add(i):dx((function(){Lx(i,r)})),i.promise})),QE=function(){var t=new JE,e=Ex(t);this.promise=t,this.resolve=Xx(jx,e),this.reject=Xx(Hx,e)},yx.f=wx=function(t){return t===Sx||undefined===t?new QE(t):Px(t)}),$E({global:!0,constructor:!0,wrap:!0,forced:bx},{Promise:Sx}),nx(Sx,gx,!1,!0),ox(gx);var Vx=re("iterator"),Yx=!1;try{var Wx=0,zx={next:function(){return{done:!!Wx++}},return:function(){Yx=!0}};zx[Vx]=function(){return this},Array.from(zx,(function(){throw 2}))}catch(t){}var Zx=NE,Kx=function(t,e){if(!e&&!Yx)return!1;var r=!1;try{var i={};i[Vx]=function(){return{next:function(){return{done:r=!0}}}},t(i)}catch(t){}return r},qx=zE.CONSTRUCTOR||!Kx((function(t){Zx.all(t).then(void 0,(function(){}))})),Jx=E,Qx=Tt,$x=ZE,tR=OE,eR=Xb;yr({target:"Promise",stat:!0,forced:qx},{all:function(t){var e=this,r=$x.f(e),i=r.resolve,n=r.reject,o=tR((function(){var r=Qx(e.resolve),o=[],s=0,a=1;eR(t,(function(t){var u=s++,h=!1;a++,Jx(r,e,t).then((function(t){h||(h=!0,o[u]=t,--a||i(o))}),n)})),--a||i(o)}));return o.error&&n(o.value),r.promise}});var rR=yr,iR=zE.CONSTRUCTOR;NE&&NE.prototype,rR({target:"Promise",proto:!0,forced:iR,real:!0},{catch:function(t){return this.then(void 0,t)}});var nR=E,oR=Tt,sR=ZE,aR=OE,uR=Xb;yr({target:"Promise",stat:!0,forced:qx},{race:function(t){var e=this,r=sR.f(e),i=r.reject,n=aR((function(){var n=oR(e.resolve);uR(t,(function(t){nR(n,e,t).then(r.resolve,i)}))}));return n.error&&i(n.value),r.promise}});var hR=E,cR=ZE;yr({target:"Promise",stat:!0,forced:zE.CONSTRUCTOR},{reject:function(t){var e=cR.f(this);return hR(e.reject,void 0,t),e.promise}});var lR=We,dR=Y,fR=ZE,pR=function(t,e){if(lR(t),dR(e)&&e.constructor===t)return e;var r=fR.f(t);return(0,r.resolve)(e),r.promise},mR=yr,vR=NE,_R=zE.CONSTRUCTOR,yR=pR,gR=J("Promise"),bR=!_R;mR({target:"Promise",stat:!0,forced:true},{resolve:function(t){return yR(bR&&this===gR?vR:this,t)}});var TR=E,ER=Tt,xR=ZE,RR=OE,SR=Xb;yr({target:"Promise",stat:!0},{allSettled:function(t){var e=this,r=xR.f(e),i=r.resolve,n=r.reject,o=RR((function(){var r=ER(e.resolve),n=[],o=0,s=1;SR(t,(function(t){var a=o++,u=!1;s++,TR(r,e,t).then((function(t){u||(u=!0,n[a]={status:"fulfilled",value:t},--s||i(n))}),(function(t){u||(u=!0,n[a]={status:"rejected",reason:t},--s||i(n))}))})),--s||i(n)}));return o.error&&n(o.value),r.promise}});var AR=E,IR=Tt,CR=J,OR=ZE,wR=OE,PR=Xb,NR="No one promise resolved";yr({target:"Promise",stat:!0},{any:function(t){var e=this,r=CR("AggregateError"),i=OR.f(e),n=i.resolve,o=i.reject,s=wR((function(){var i=IR(e.resolve),s=[],a=0,u=1,h=!1;PR(t,(function(t){var c=a++,l=!1;u++,AR(i,e,t).then((function(t){l||h||(h=!0,n(t))}),(function(t){l||h||(l=!0,s[c]=t,--u||o(new r(s,NR)))}))})),--u||o(new r(s,NR))}));return s.error&&o(s.value),i.promise}});var MR=yr,DR=NE,LR=n,UR=J,FR=_,GR=IT,BR=pR,kR=DR&&DR.prototype;MR({target:"Promise",proto:!0,real:!0,forced:!!DR&&LR((function(){kR.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=GR(this,UR("Promise")),r=FR(t);return this.then(r?function(r){return BR(e,t()).then((function(){return r}))}:t,r?function(r){return BR(e,t()).then((function(){throw r}))}:t)}});var XR=W.Promise,HR=ZE,jR=OE;yr({target:"Promise",stat:!0,forced:!0},{try:function(t){var e=HR.f(this),r=jR(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}});var VR=XR,YR=/Version\/(\d+)\./,WR=/OS (\d+)_(\d+)_?(\d+)?/,zR=/firefox\/(\d+)\./i.test(navigator.userAgent),ZR=/safari\/(\d+)\./i.test(navigator.userAgent)&&!/chrome\/(\d+)\./i.test(navigator.userAgent),KR=/iPhone|iPad|iOS/i.test(navigator.userAgent),qR=ZR&&15===function(){var t=navigator.userAgent.match(YR);return t?Vg(t[1],10):null}()||KR&&15===function(){var t=navigator.userAgent.match(WR);return t?Vg(t[1],10):null}(),JR=function(){var t,e;return!(!(null===(t=navigator.mediaDevices)||void 0===t?void 0:t.enumerateDevices)||!(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia))},QR=function(){var t;return!!(null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getDisplayMedia)},$R=Zo.some;yr({target:"Array",proto:!0,forced:!tc("some")},{some:function(t){return $R(this,t,arguments.length>1?arguments[1]:void 0)}});var tS=zh("Array").some,eS=Q,rS=tS,iS=Array.prototype,nS=function(t){var e=t.some;return t===iS||eS(iS,t)&&e===iS.some?rS:e},oS=yr,sS=v,aS=Cr,uS=Gi,hS=cl,cS=k,lS=dl,dS=sS("".endsWith),fS=sS("".slice),pS=Math.min;oS({target:"String",proto:!0,forced:!lS("endsWith")},{endsWith:function(t){var e=uS(cS(this));hS(t);var r=arguments.length>1?arguments[1]:void 0,i=e.length,n=void 0===r?i:pS(aS(r),i),o=uS(t);return dS?dS(e,o,n):fS(e,n-o.length,n)===o}});var mS=zh("String").endsWith,vS=Q,_S=mS,yS=String.prototype,gS=function(t){var e=t.endsWith;return"string"==typeof t||t===yS||vS(yS,t)&&e===yS.endsWith?_S:e};var bS=function(t,e){for(var r=-1,i=null==t?0:t.length;++r<i&&!1!==e(t[r],r,t););return t},TS=jv;var ES=function(t,e,r){"__proto__"==e&&TS?TS(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r},xS=ES,RS=gm,SS=Object.prototype.hasOwnProperty;var AS=function(t,e,r){var i=t[e];SS.call(t,e)&&RS(i,r)&&(void 0!==r||e in t)||xS(t,e,r)},IS=AS,CS=ES;var OS=function(t,e,r,i){var n=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=i?i(r[a],t[a],a,r,t):void 0;void 0===u&&(u=t[a]),n?CS(r,a,u):IS(r,a,u)}return r},wS=OS,PS=Oy;var NS=function(t,e){return t&&wS(e,PS(e),t)};var MS=Pp,DS=by,LS=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},US=Object.prototype.hasOwnProperty;var FS=yy,GS=function(t){if(!MS(t))return LS(t);var e=DS(t),r=[];for(var i in t)("constructor"!=i||!e&&US.call(t,i))&&r.push(i);return r},BS=r_;var kS=function(t){return BS(t)?FS(t,!0):GS(t)},XS=OS,HS=kS;var jS=function(t,e){return t&&XS(e,HS(e),t)},VS={exports:{}};!function(t,e){var r=yp,i=e&&!e.nodeType&&e,n=i&&t&&!t.nodeType&&t,o=n&&n.exports===i?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,i=s?s(r):new t.constructor(r);return t.copy(i),i}}(VS,VS.exports);var YS=function(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e},WS=OS,zS=Z_;var ZS=function(t,e){return WS(t,zS(t),e)},KS=Ty(Object.getPrototypeOf,Object),qS=gv,JS=KS,QS=Z_,$S=H_,tA=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)qS(e,QS(t)),t=JS(t);return e}:$S,eA=OS,rA=tA;var iA=function(t,e){return eA(t,rA(t),e)},nA=X_,oA=tA,sA=kS;var aA=function(t){return nA(t,sA,oA)},uA=Object.prototype.hasOwnProperty;var hA=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&uA.call(t,"index")&&(r.index=t.index,r.input=t.input),r},cA=C_;var lA=function(t){var e=new t.constructor(t.byteLength);return new cA(e).set(new cA(t)),e},dA=lA;var fA=function(t,e){var r=e?dA(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)},pA=/\w*$/;var mA=function(t){var e=new t.constructor(t.source,pA.exec(t));return e.lastIndex=t.lastIndex,e},vA=gp?gp.prototype:void 0,_A=vA?vA.valueOf:void 0;var yA=function(t){return _A?Object(_A.call(t)):{}},gA=lA;var bA=lA,TA=fA,EA=mA,xA=yA,RA=function(t,e){var r=e?gA(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};var SA=function(t,e,r){var i=t.constructor;switch(e){case"[object ArrayBuffer]":return bA(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return TA(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return RA(t,r);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return EA(t);case"[object Symbol]":return xA(t)}},AA=Pp,IA=Object.create,CA=function(){function t(){}return function(e){if(!AA(e))return{};if(IA)return IA(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),OA=KS,wA=by;var PA=function(t){return"function"!=typeof t.constructor||wA(t)?{}:CA(OA(t))},NA=eg,MA=bv;var DA=function(t){return MA(t)&&"[object Map]"==NA(t)},LA=cv,UA=oy.exports,FA=UA&&UA.isMap,GA=FA?LA(FA):DA,BA=eg,kA=bv;var XA=function(t){return kA(t)&&"[object Set]"==BA(t)},HA=cv,jA=oy.exports,VA=jA&&jA.isSet,YA=VA?HA(VA):XA,WA=x_,zA=bS,ZA=AS,KA=NS,qA=jS,JA=VS.exports,QA=YS,$A=ZS,tI=iA,eI=My,rI=aA,iI=eg,nI=hA,oI=SA,sI=PA,aI=wv,uI=q_.exports,hI=GA,cI=Pp,lI=YA,dI=Oy,fI=kS,pI="[object Arguments]",mI="[object Function]",vI="[object Object]",_I={};_I[pI]=_I["[object Array]"]=_I["[object ArrayBuffer]"]=_I["[object DataView]"]=_I["[object Boolean]"]=_I["[object Date]"]=_I["[object Float32Array]"]=_I["[object Float64Array]"]=_I["[object Int8Array]"]=_I["[object Int16Array]"]=_I["[object Int32Array]"]=_I["[object Map]"]=_I["[object Number]"]=_I[vI]=_I["[object RegExp]"]=_I["[object Set]"]=_I["[object String]"]=_I["[object Symbol]"]=_I["[object Uint8Array]"]=_I["[object Uint8ClampedArray]"]=_I["[object Uint16Array]"]=_I["[object Uint32Array]"]=!0,_I["[object Error]"]=_I[mI]=_I["[object WeakMap]"]=!1;var yI=function t(e,r,i,n,o,s){var a,u=1&r,h=2&r,c=4&r;if(i&&(a=o?i(e,n,o,s):i(e)),void 0!==a)return a;if(!cI(e))return e;var l=aI(e);if(l){if(a=nI(e),!u)return QA(e,a)}else{var d=iI(e),f=d==mI||"[object GeneratorFunction]"==d;if(uI(e))return JA(e,u);if(d==vI||d==pI||f&&!o){if(a=h||f?{}:sI(e),!u)return h?tI(e,qA(a,e)):$A(e,KA(a,e))}else{if(!_I[d])return o?e:{};a=oI(e,d,u)}}s||(s=new WA);var p=s.get(e);if(p)return p;s.set(e,a),lI(e)?e.forEach((function(n){a.add(t(n,r,i,n,e,s))})):hI(e)&&e.forEach((function(n,o){a.set(o,t(n,r,i,o,e,s))}));var m=l?void 0:(c?h?rI:eI:h?fI:dI)(e);return zA(m||e,(function(n,o){m&&(n=e[o=n]),ZA(a,o,t(n,r,i,o,e,s))})),a},gI=yI;var bI=function(t){return gI(t,5)},TI=qf("stream:device"),EI=function(){function t(){this.mediaStream=null}return t.prototype.start=function(t){var e=t.video,r=t.audio;return nd(this,void 0,void 0,(function(){var t,i,n,o,s,a,u,h,c,l,d,f,p;return od(this,(function(m){switch(m.label){case 0:if(this.mediaStream)return TI("stream is existed"),[2,this.mediaStream];t={},e&&(s=e.deviceId,i=e.frameRate,n=e.resolution,o={frameRate:{ideal:i},width:{ideal:n.width},height:{ideal:n.height}},s&&(o.deviceId={exact:s}),t.video=o),r&&(s=r.deviceId,a=r.sampleRate,u=r.echoCancellation,h=r.noiseSuppression,c=r.autoGainControl,l={sampleRate:a,echoCancellation:u,noiseSuppression:h,autoGainControl:c},s&&(l.deviceId={exact:s}),t.audio=l),m.label=1;case 1:return m.trys.push([1,3,,4]),d=this,[4,navigator.mediaDevices.getUserMedia(t)];case 2:return d.mediaStream=m.sent(),[2,this.mediaStream];case 3:switch(f=m.sent(),TI("start error, "+f.toString()),p="",f.name){case"NotFoundError":case"DevicesNotFoundError":p="NotFoundError";break;case"NotAllowedError":case"PermissionDeniedError":p="NotAllowedError";break;default:p=f.name}throw f.name!==p&&(f.name=p),f;case 4:return[2]}}))}))},t.prototype.stop=function(){var t,e;null===(e=this.mediaStream)||void 0===e||cc(t=e.getTracks()).call(t,(function(t){"ended"!==t.readyState&&t.stop()})),this.mediaStream=null},t.prototype.getResolution=function(){if(!this.mediaStream)return null;var t=this.mediaStream.getVideoTracks();if(0===t.length)return null;var e=t[0].getSettings();return{width:e.width,height:e.height}},t}(),xI=qf("stream:screen"),RI=function(){function t(){this.mediaStream=null}return t.prototype.start=function(t){var e=t.video,r=t.audio;return nd(this,void 0,void 0,(function(){var t,i,n,o,s,a,u,h,c,l,d;return od(this,(function(f){switch(f.label){case 0:if(this.mediaStream)return xI("stream is existed"),[2,this.mediaStream];t={},e&&(i=e.frameRate,n=e.resolution,o={frameRate:{ideal:i},width:{ideal:n.width},height:{ideal:n.height}},t.video=o),r&&(s=r.sampleRate,a=r.echoCancellation,u=r.noiseSuppression,h=r.autoGainControl,c={sampleRate:s,echoCancellation:a,noiseSuppression:u,autoGainControl:h},t.audio=c),f.label=1;case 1:return f.trys.push([1,3,,4]),l=this,[4,navigator.mediaDevices.getDisplayMedia(t)];case 2:return l.mediaStream=f.sent(),[2,this.mediaStream];case 3:throw d=f.sent(),xI("start error, "+d.toString()),d;case 4:return[2]}}))}))},t.prototype.stop=function(){var t,e;null===(e=this.mediaStream)||void 0===e||cc(t=e.getTracks()).call(t,(function(t){"ended"!==t.readyState&&t.stop()})),this.mediaStream=null},t.prototype.getResolution=function(){if(!this.mediaStream)return null;var t=this.mediaStream.getVideoTracks();if(0===t.length)return null;var e=t[0].getSettings();return{width:e.width,height:e.height}},t}(),SI=n,AI=re("iterator"),II=!SI((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";return t.pathname="c%20d",e.forEach((function(t,i){e.delete("b"),r+=i+t})),!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[AI]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),CI=Xe,OI=g,wI=v,PI=E,NI=n,MI=sn,DI=Wn,LI=x,UI=Ft,FI=G,GI=Object.assign,BI=Object.defineProperty,kI=wI([].concat),XI=!GI||NI((function(){if(OI&&1!==GI({b:1},GI(BI({},"a",{enumerable:!0,get:function(){BI(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),i="abcdefghijklmnopqrst";return t[r]=7,i.split("").forEach((function(t){e[t]=t})),7!=GI({},t)[r]||MI(GI({},e)).join("")!=i}))?function(t,e){for(var r=UI(t),i=arguments.length,n=1,o=DI.f,s=LI.f;i>n;)for(var a,u=FI(arguments[n++]),h=o?kI(MI(u),o(u)):MI(u),c=h.length,l=0;c>l;)a=h[l++],OI&&!PI(s,u,a)||(r[a]=u[a]);return r}:GI,HI=We,jI=Ib,VI=ke,YI=E,WI=Ft,zI=function(t,e,r,i){try{return i?e(HI(r)[0],r[1]):e(r)}catch(e){jI(t,"throw",e)}},ZI=lb,KI=hi,qI=wr,JI=Ur,QI=xb,$I=vb,tC=Array,eC=v,rC=2147483647,iC=/[^\0-\u007E]/,nC=/[.\u3002\uFF0E\uFF61]/g,oC="Overflow: input needs wider integers to process",sC=RangeError,aC=eC(nC.exec),uC=Math.floor,hC=String.fromCharCode,cC=eC("".charCodeAt),lC=eC([].join),dC=eC([].push),fC=eC("".replace),pC=eC("".split),mC=eC("".toLowerCase),vC=function(t){return t+22+75*(t<26)},_C=function(t,e,r){var i=0;for(t=r?uC(t/700):t>>1,t+=uC(t/e);t>455;)t=uC(t/35),i+=36;return uC(i+36*t/(t+38))},yC=function(t){var e=[];t=function(t){for(var e=[],r=0,i=t.length;r<i;){var n=cC(t,r++);if(n>=55296&&n<=56319&&r<i){var o=cC(t,r++);56320==(64512&o)?dC(e,((1023&n)<<10)+(1023&o)+65536):(dC(e,n),r--)}else dC(e,n)}return e}(t);var r,i,n=t.length,o=128,s=0,a=72;for(r=0;r<t.length;r++)(i=t[r])<128&&dC(e,hC(i));var u=e.length,h=u;for(u&&dC(e,"-");h<n;){var c=rC;for(r=0;r<t.length;r++)(i=t[r])>=o&&i<c&&(c=i);var l=h+1;if(c-o>uC((rC-s)/l))throw sC(oC);for(s+=(c-o)*l,o=c,r=0;r<t.length;r++){if((i=t[r])<o&&++s>rC)throw sC(oC);if(i==o){for(var d=s,f=36;;){var p=f<=a?1:f>=a+26?26:f-a;if(d<p)break;var m=d-p,v=36-p;dC(e,hC(vC(p+m%v))),d=uC(m/v),f+=36}dC(e,hC(vC(d))),a=_C(s,l,h==u),s=0,h++}}s++,o++}return lC(e,"")},gC=Zn,bC=kn,TC=Math.floor,EC=function(t,e){var r=t.length,i=TC(r/2);return r<8?xC(t,e):RC(t,EC(bC(t,0,i),e),EC(bC(t,i),e),e)},xC=function(t,e){for(var r,i,n=t.length,o=1;o<n;){for(i=o,r=t[o];i&&e(t[i-1],r)>0;)t[i]=t[--i];i!==o++&&(t[i]=r)}return t},RC=function(t,e,r,i){for(var n=e.length,o=r.length,s=0,a=0;s<n||a<o;)t[s+a]=s<n&&a<o?i(e[s],r[a])<=0?e[s++]:r[a++]:s<n?e[s++]:r[a++];return t},SC=yr,AC=i,IC=E,CC=v,OC=g,wC=II,PC=Zn,NC=function(t,e,r){for(var i in e)r&&r.unsafe&&t[i]?t[i]=e[i]:gC(t,i,e[i],r);return t},MC=go,DC=Cu,LC=ko,UC=bT,FC=_,GC=kt,BC=ke,kC=Yr,XC=We,HC=Y,jC=Gi,VC=wn,YC=O,WC=xb,zC=vb,ZC=Il,KC=EC,qC=re("iterator"),JC="URLSearchParams",QC="URLSearchParamsIterator",$C=LC.set,tO=LC.getterFor(JC),eO=LC.getterFor(QC),rO=Object.getOwnPropertyDescriptor,iO=function(t){if(!OC)return AC[t];var e=rO(AC,t);return e&&e.value},nO=iO("fetch"),oO=iO("Request"),sO=iO("Headers"),aO=oO&&oO.prototype,uO=sO&&sO.prototype,hO=AC.RegExp,cO=AC.TypeError,lO=AC.decodeURIComponent,dO=AC.encodeURIComponent,fO=CC("".charAt),pO=CC([].join),mO=CC([].push),vO=CC("".replace),_O=CC([].shift),yO=CC([].splice),gO=CC("".split),bO=CC("".slice),TO=/\+/g,EO=Array(4),xO=function(t){return EO[t-1]||(EO[t-1]=hO("((?:%[\\da-f]{2}){"+t+"})","gi"))},RO=function(t){try{return lO(t)}catch(e){return t}},SO=function(t){var e=vO(t,TO," "),r=4;try{return lO(e)}catch(t){for(;r;)e=vO(e,xO(r--),RO);return e}},AO=/[!'()~]|%20/g,IO={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},CO=function(t){return IO[t]},OO=function(t){return vO(dO(t),AO,CO)},wO=DC((function(t,e){$C(this,{type:QC,iterator:WC(tO(t).entries),kind:e})}),"Iterator",(function(){var t=eO(this),e=t.kind,r=t.iterator.next(),i=r.value;return r.done||(r.value="keys"===e?i.key:"values"===e?i.value:[i.key,i.value]),r}),!0),PO=function(t){this.entries=[],this.url=null,void 0!==t&&(HC(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===fO(t,0)?bO(t,1):t:jC(t)))};PO.prototype={type:JC,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,i,n,o,s,a,u=zC(t);if(u)for(r=(e=WC(t,u)).next;!(i=IC(r,e)).done;){if(o=(n=WC(XC(i.value))).next,(s=IC(o,n)).done||(a=IC(o,n)).done||!IC(o,n).done)throw cO("Expected sequence with length 2");mO(this.entries,{key:jC(s.value),value:jC(a.value)})}else for(var h in t)GC(t,h)&&mO(this.entries,{key:h,value:jC(t[h])})},parseQuery:function(t){if(t)for(var e,r,i=gO(t,"&"),n=0;n<i.length;)(e=i[n++]).length&&(r=gO(e,"="),mO(this.entries,{key:SO(_O(r)),value:SO(pO(r,"="))}))},serialize:function(){for(var t,e=this.entries,r=[],i=0;i<e.length;)t=e[i++],mO(r,OO(t.key)+"="+OO(t.value));return pO(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var NO=function(){UC(this,MO);var t=arguments.length>0?arguments[0]:void 0;$C(this,new PO(t))},MO=NO.prototype;if(NC(MO,{append:function(t,e){ZC(arguments.length,2);var r=tO(this);mO(r.entries,{key:jC(t),value:jC(e)}),r.updateURL()},delete:function(t){ZC(arguments.length,1);for(var e=tO(this),r=e.entries,i=jC(t),n=0;n<r.length;)r[n].key===i?yO(r,n,1):n++;e.updateURL()},get:function(t){ZC(arguments.length,1);for(var e=tO(this).entries,r=jC(t),i=0;i<e.length;i++)if(e[i].key===r)return e[i].value;return null},getAll:function(t){ZC(arguments.length,1);for(var e=tO(this).entries,r=jC(t),i=[],n=0;n<e.length;n++)e[n].key===r&&mO(i,e[n].value);return i},has:function(t){ZC(arguments.length,1);for(var e=tO(this).entries,r=jC(t),i=0;i<e.length;)if(e[i++].key===r)return!0;return!1},set:function(t,e){ZC(arguments.length,1);for(var r,i=tO(this),n=i.entries,o=!1,s=jC(t),a=jC(e),u=0;u<n.length;u++)(r=n[u]).key===s&&(o?yO(n,u--,1):(o=!0,r.value=a));o||mO(n,{key:s,value:a}),i.updateURL()},sort:function(){var t=tO(this);KC(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=tO(this).entries,i=BC(t,arguments.length>1?arguments[1]:void 0),n=0;n<r.length;)i((e=r[n++]).value,e.key,this)},keys:function(){return new wO(this,"keys")},values:function(){return new wO(this,"values")},entries:function(){return new wO(this,"entries")}},{enumerable:!0}),PC(MO,qC,MO.entries,{name:"entries"}),PC(MO,"toString",(function(){return tO(this).serialize()}),{enumerable:!0}),MC(NO,JC),SC({global:!0,constructor:!0,forced:!wC},{URLSearchParams:NO}),!wC&&FC(sO)){var DO=CC(uO.has),LO=CC(uO.set),UO=function(t){if(HC(t)){var e,r=t.body;if(kC(r)===JC)return e=t.headers?new sO(t.headers):new sO,DO(e,"content-type")||LO(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),VC(t,{body:YC(0,jC(r)),headers:YC(0,e)})}return t};if(FC(nO)&&SC({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return nO(t,arguments.length>1?UO(arguments[1]):{})}}),FC(oO)){var FO=function(t){return UC(this,aO),new oO(t,arguments.length>1?UO(arguments[1]):{})};aO.constructor=FO,FO.prototype=aO,SC({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:FO})}}var GO,BO=yr,kO=g,XO=II,HO=i,jO=ke,VO=v,YO=Zn,WO=function(t,e,r){return CI.f(t,e,r)},zO=bT,ZO=kt,KO=XI,qO=function(t){var e=WI(t),r=KI(this),i=arguments.length,n=i>1?arguments[1]:void 0,o=void 0!==n;o&&(n=VI(n,i>2?arguments[2]:void 0));var s,a,u,h,c,l,d=$I(e),f=0;if(!d||this===tC&&ZI(d))for(s=qI(e),a=r?new this(s):tC(s);s>f;f++)l=o?n(e[f],f):e[f],JI(a,f,l);else for(c=(h=QI(e,d)).next,a=r?new this:[];!(u=YI(c,h)).done;f++)l=o?zI(h,n,[u.value,f],!0):u.value,JI(a,f,l);return a.length=f,a},JO=kn,QO=xh.codeAt,$O=function(t){var e,r,i=[],n=pC(fC(mC(t),nC,"."),".");for(e=0;e<n.length;e++)r=n[e],dC(i,aC(iC,r)?"xn--"+yC(r):r);return lC(i,".")},tw=Gi,ew=go,rw=Il,iw={URLSearchParams:NO,getState:tO},nw=ko,ow=nw.set,sw=nw.getterFor("URL"),aw=iw.URLSearchParams,uw=iw.getState,hw=HO.URL,cw=HO.TypeError,lw=HO.parseInt,dw=Math.floor,fw=Math.pow,pw=VO("".charAt),mw=VO(/./.exec),vw=VO([].join),_w=VO(1..toString),yw=VO([].pop),gw=VO([].push),bw=VO("".replace),Tw=VO([].shift),Ew=VO("".split),xw=VO("".slice),Rw=VO("".toLowerCase),Sw=VO([].unshift),Aw="Invalid scheme",Iw="Invalid host",Cw="Invalid port",Ow=/[a-z]/i,ww=/[\d+-.a-z]/i,Pw=/\d/,Nw=/^0x/i,Mw=/^[0-7]+$/,Dw=/^\d+$/,Lw=/^[\da-f]+$/i,Uw=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Fw=/[\0\t\n\r #/:<>?@[\\\]^|]/,Gw=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Bw=/[\t\n\r]/g,kw=function(t){var e,r,i,n;if("number"==typeof t){for(e=[],r=0;r<4;r++)Sw(e,t%256),t=dw(t/256);return vw(e,".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,r=1,i=null,n=0,o=0;o<8;o++)0!==t[o]?(n>r&&(e=i,r=n),i=null,n=0):(null===i&&(i=o),++n);return n>r&&(e=i,r=n),e}(t),r=0;r<8;r++)n&&0===t[r]||(n&&(n=!1),i===r?(e+=r?":":"::",n=!0):(e+=_w(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},Xw={},Hw=KO({},Xw,{" ":1,'"':1,"<":1,">":1,"`":1}),jw=KO({},Hw,{"#":1,"?":1,"{":1,"}":1}),Vw=KO({},jw,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Yw=function(t,e){var r=QO(t,0);return r>32&&r<127&&!ZO(e,t)?t:encodeURIComponent(t)},Ww={ftp:21,file:null,http:80,https:443,ws:80,wss:443},zw=function(t,e){var r;return 2==t.length&&mw(Ow,pw(t,0))&&(":"==(r=pw(t,1))||!e&&"|"==r)},Zw=function(t){var e;return t.length>1&&zw(xw(t,0,2))&&(2==t.length||"/"===(e=pw(t,2))||"\\"===e||"?"===e||"#"===e)},Kw=function(t){return"."===t||"%2e"===Rw(t)},qw={},Jw={},Qw={},$w={},tP={},eP={},rP={},iP={},nP={},oP={},sP={},aP={},uP={},hP={},cP={},lP={},dP={},fP={},pP={},mP={},vP={},_P=function(t,e,r){var i,n,o,s=tw(t);if(e){if(n=this.parse(s))throw cw(n);this.searchParams=null}else{if(void 0!==r&&(i=new _P(r,!0)),n=this.parse(s,null,i))throw cw(n);(o=uw(new aw)).bindURL(this),this.searchParams=o}};_P.prototype={type:"URL",parse:function(t,e,r){var i,n,o,s,a,u=this,h=e||qw,c=0,l="",d=!1,f=!1,p=!1;for(t=tw(t),e||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,t=bw(t,Gw,"")),t=bw(t,Bw,""),i=qO(t);c<=i.length;){switch(n=i[c],h){case qw:if(!n||!mw(Ow,n)){if(e)return Aw;h=Qw;continue}l+=Rw(n),h=Jw;break;case Jw:if(n&&(mw(ww,n)||"+"==n||"-"==n||"."==n))l+=Rw(n);else{if(":"!=n){if(e)return Aw;l="",h=Qw,c=0;continue}if(e&&(u.isSpecial()!=ZO(Ww,l)||"file"==l&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=l,e)return void(u.isSpecial()&&Ww[u.scheme]==u.port&&(u.port=null));l="","file"==u.scheme?h=hP:u.isSpecial()&&r&&r.scheme==u.scheme?h=$w:u.isSpecial()?h=iP:"/"==i[c+1]?(h=tP,c++):(u.cannotBeABaseURL=!0,gw(u.path,""),h=pP)}break;case Qw:if(!r||r.cannotBeABaseURL&&"#"!=n)return Aw;if(r.cannotBeABaseURL&&"#"==n){u.scheme=r.scheme,u.path=JO(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,h=vP;break}h="file"==r.scheme?hP:eP;continue;case $w:if("/"!=n||"/"!=i[c+1]){h=eP;continue}h=nP,c++;break;case tP:if("/"==n){h=oP;break}h=fP;continue;case eP:if(u.scheme=r.scheme,n==GO)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=JO(r.path),u.query=r.query;else if("/"==n||"\\"==n&&u.isSpecial())h=rP;else if("?"==n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=JO(r.path),u.query="",h=mP;else{if("#"!=n){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=JO(r.path),u.path.length--,h=fP;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=JO(r.path),u.query=r.query,u.fragment="",h=vP}break;case rP:if(!u.isSpecial()||"/"!=n&&"\\"!=n){if("/"!=n){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,h=fP;continue}h=oP}else h=nP;break;case iP:if(h=nP,"/"!=n||"/"!=pw(l,c+1))continue;c++;break;case nP:if("/"!=n&&"\\"!=n){h=oP;continue}break;case oP:if("@"==n){d&&(l="%40"+l),d=!0,o=qO(l);for(var m=0;m<o.length;m++){var v=o[m];if(":"!=v||p){var _=Yw(v,Vw);p?u.password+=_:u.username+=_}else p=!0}l=""}else if(n==GO||"/"==n||"?"==n||"#"==n||"\\"==n&&u.isSpecial()){if(d&&""==l)return"Invalid authority";c-=qO(l).length+1,l="",h=sP}else l+=n;break;case sP:case aP:if(e&&"file"==u.scheme){h=lP;continue}if(":"!=n||f){if(n==GO||"/"==n||"?"==n||"#"==n||"\\"==n&&u.isSpecial()){if(u.isSpecial()&&""==l)return Iw;if(e&&""==l&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(l))return s;if(l="",h=dP,e)return;continue}"["==n?f=!0:"]"==n&&(f=!1),l+=n}else{if(""==l)return Iw;if(s=u.parseHost(l))return s;if(l="",h=uP,e==aP)return}break;case uP:if(!mw(Pw,n)){if(n==GO||"/"==n||"?"==n||"#"==n||"\\"==n&&u.isSpecial()||e){if(""!=l){var y=lw(l,10);if(y>65535)return Cw;u.port=u.isSpecial()&&y===Ww[u.scheme]?null:y,l=""}if(e)return;h=dP;continue}return Cw}l+=n;break;case hP:if(u.scheme="file","/"==n||"\\"==n)h=cP;else{if(!r||"file"!=r.scheme){h=fP;continue}if(n==GO)u.host=r.host,u.path=JO(r.path),u.query=r.query;else if("?"==n)u.host=r.host,u.path=JO(r.path),u.query="",h=mP;else{if("#"!=n){Zw(vw(JO(i,c),""))||(u.host=r.host,u.path=JO(r.path),u.shortenPath()),h=fP;continue}u.host=r.host,u.path=JO(r.path),u.query=r.query,u.fragment="",h=vP}}break;case cP:if("/"==n||"\\"==n){h=lP;break}r&&"file"==r.scheme&&!Zw(vw(JO(i,c),""))&&(zw(r.path[0],!0)?gw(u.path,r.path[0]):u.host=r.host),h=fP;continue;case lP:if(n==GO||"/"==n||"\\"==n||"?"==n||"#"==n){if(!e&&zw(l))h=fP;else if(""==l){if(u.host="",e)return;h=dP}else{if(s=u.parseHost(l))return s;if("localhost"==u.host&&(u.host=""),e)return;l="",h=dP}continue}l+=n;break;case dP:if(u.isSpecial()){if(h=fP,"/"!=n&&"\\"!=n)continue}else if(e||"?"!=n)if(e||"#"!=n){if(n!=GO&&(h=fP,"/"!=n))continue}else u.fragment="",h=vP;else u.query="",h=mP;break;case fP:if(n==GO||"/"==n||"\\"==n&&u.isSpecial()||!e&&("?"==n||"#"==n)){if(".."===(a=Rw(a=l))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(u.shortenPath(),"/"==n||"\\"==n&&u.isSpecial()||gw(u.path,"")):Kw(l)?"/"==n||"\\"==n&&u.isSpecial()||gw(u.path,""):("file"==u.scheme&&!u.path.length&&zw(l)&&(u.host&&(u.host=""),l=pw(l,0)+":"),gw(u.path,l)),l="","file"==u.scheme&&(n==GO||"?"==n||"#"==n))for(;u.path.length>1&&""===u.path[0];)Tw(u.path);"?"==n?(u.query="",h=mP):"#"==n&&(u.fragment="",h=vP)}else l+=Yw(n,jw);break;case pP:"?"==n?(u.query="",h=mP):"#"==n?(u.fragment="",h=vP):n!=GO&&(u.path[0]+=Yw(n,Xw));break;case mP:e||"#"!=n?n!=GO&&("'"==n&&u.isSpecial()?u.query+="%27":u.query+="#"==n?"%23":Yw(n,Xw)):(u.fragment="",h=vP);break;case vP:n!=GO&&(u.fragment+=Yw(n,Hw))}c++}},parseHost:function(t){var e,r,i;if("["==pw(t,0)){if("]"!=pw(t,t.length-1))return Iw;if(e=function(t){var e,r,i,n,o,s,a,u=[0,0,0,0,0,0,0,0],h=0,c=null,l=0,d=function(){return pw(t,l)};if(":"==d()){if(":"!=pw(t,1))return;l+=2,c=++h}for(;d();){if(8==h)return;if(":"!=d()){for(e=r=0;r<4&&mw(Lw,d());)e=16*e+lw(d(),16),l++,r++;if("."==d()){if(0==r)return;if(l-=r,h>6)return;for(i=0;d();){if(n=null,i>0){if(!("."==d()&&i<4))return;l++}if(!mw(Pw,d()))return;for(;mw(Pw,d());){if(o=lw(d(),10),null===n)n=o;else{if(0==n)return;n=10*n+o}if(n>255)return;l++}u[h]=256*u[h]+n,2!=++i&&4!=i||h++}if(4!=i)return;break}if(":"==d()){if(l++,!d())return}else if(d())return;u[h++]=e}else{if(null!==c)return;l++,c=++h}}if(null!==c)for(s=h-c,h=7;0!=h&&s>0;)a=u[h],u[h--]=u[c+s-1],u[c+--s]=a;else if(8!=h)return;return u}(xw(t,1,-1)),!e)return Iw;this.host=e}else if(this.isSpecial()){if(t=$O(t),mw(Uw,t))return Iw;if(e=function(t){var e,r,i,n,o,s,a,u=Ew(t,".");if(u.length&&""==u[u.length-1]&&u.length--,(e=u.length)>4)return t;for(r=[],i=0;i<e;i++){if(""==(n=u[i]))return t;if(o=10,n.length>1&&"0"==pw(n,0)&&(o=mw(Nw,n)?16:8,n=xw(n,8==o?1:2)),""===n)s=0;else{if(!mw(10==o?Dw:8==o?Mw:Lw,n))return t;s=lw(n,o)}gw(r,s)}for(i=0;i<e;i++)if(s=r[i],i==e-1){if(s>=fw(256,5-e))return null}else if(s>255)return null;for(a=yw(r),i=0;i<r.length;i++)a+=r[i]*fw(256,3-i);return a}(t),null===e)return Iw;this.host=e}else{if(mw(Fw,t))return Iw;for(e="",r=qO(t),i=0;i<r.length;i++)e+=Yw(r[i],Xw);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return ZO(Ww,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&&zw(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,i=t.password,n=t.host,o=t.port,s=t.path,a=t.query,u=t.fragment,h=e+":";return null!==n?(h+="//",t.includesCredentials()&&(h+=r+(i?":"+i:"")+"@"),h+=kw(n),null!==o&&(h+=":"+o)):"file"==e&&(h+="//"),h+=t.cannotBeABaseURL?s[0]:s.length?"/"+vw(s,"/"):"",null!==a&&(h+="?"+a),null!==u&&(h+="#"+u),h},setHref:function(t){var e=this.parse(t);if(e)throw cw(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new yP(t.path[0]).origin}catch(t){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+kw(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(tw(t)+":",qw)},getUsername:function(){return this.username},setUsername:function(t){var e=qO(tw(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=Yw(e[r],Vw)}},getPassword:function(){return this.password},setPassword:function(t){var e=qO(tw(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=Yw(e[r],Vw)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?kw(t):kw(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,sP)},getHostname:function(){var t=this.host;return null===t?"":kw(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,aP)},getPort:function(){var t=this.port;return null===t?"":tw(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=tw(t))?this.port=null:this.parse(t,uP))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+vw(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,dP))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""==(t=tw(t))?this.query=null:("?"==pw(t,0)&&(t=xw(t,1)),this.query="",this.parse(t,mP)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!=(t=tw(t))?("#"==pw(t,0)&&(t=xw(t,1)),this.fragment="",this.parse(t,vP)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var yP=function(t){var e=zO(this,gP),r=rw(arguments.length,1)>1?arguments[1]:void 0,i=ow(e,new _P(t,!1,r));kO||(e.href=i.serialize(),e.origin=i.getOrigin(),e.protocol=i.getProtocol(),e.username=i.getUsername(),e.password=i.getPassword(),e.host=i.getHost(),e.hostname=i.getHostname(),e.port=i.getPort(),e.pathname=i.getPathname(),e.search=i.getSearch(),e.searchParams=i.getSearchParams(),e.hash=i.getHash())},gP=yP.prototype,bP=function(t,e){return{get:function(){return sw(this)[t]()},set:e&&function(t){return sw(this)[e](t)},configurable:!0,enumerable:!0}};if(kO&&(WO(gP,"href",bP("serialize","setHref")),WO(gP,"origin",bP("getOrigin")),WO(gP,"protocol",bP("getProtocol","setProtocol")),WO(gP,"username",bP("getUsername","setUsername")),WO(gP,"password",bP("getPassword","setPassword")),WO(gP,"host",bP("getHost","setHost")),WO(gP,"hostname",bP("getHostname","setHostname")),WO(gP,"port",bP("getPort","setPort")),WO(gP,"pathname",bP("getPathname","setPathname")),WO(gP,"search",bP("getSearch","setSearch")),WO(gP,"searchParams",bP("getSearchParams")),WO(gP,"hash",bP("getHash","setHash"))),YO(gP,"toJSON",(function(){return sw(this).serialize()}),{enumerable:!0}),YO(gP,"toString",(function(){return sw(this).serialize()}),{enumerable:!0}),hw){var TP=hw.createObjectURL,EP=hw.revokeObjectURL;TP&&YO(yP,"createObjectURL",jO(TP,hw)),EP&&YO(yP,"revokeObjectURL",jO(EP,hw))}ew(yP,"URL"),BO({global:!0,constructor:!0,forced:!XO,sham:!kO},{URL:yP});var xP=W.URL;function RP(t,e,r){var i=void 0===e?null:e,n=function(t,e){var r=atob(t);if(e){for(var i=new Uint8Array(r.length),n=0,o=r.length;n<o;++n)i[n]=r.charCodeAt(n);return String.fromCharCode.apply(null,new Uint16Array(i.buffer))}return r}(t,void 0!==r&&r),o=n.indexOf("\n",10)+1,s=n.substring(o)+(i?"//# sourceMappingURL="+i:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var SP=function(t,e,r){var i;return function(n){return i=i||RP(t,e,r),new Worker(i,n)}}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwp2YXIgd29ya2VyX2NvZGU9ZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIHQ9InVuZGVmaW5lZCIhPXR5cGVvZiBnbG9iYWxUaGlzP2dsb2JhbFRoaXM6InVuZGVmaW5lZCIhPXR5cGVvZiB3aW5kb3c/d2luZG93OiJ1bmRlZmluZWQiIT10eXBlb2YgZ2xvYmFsP2dsb2JhbDoidW5kZWZpbmVkIiE9dHlwZW9mIHNlbGY/c2VsZjp7fSxlPWZ1bmN0aW9uKHQpe3JldHVybiB0JiZ0Lk1hdGg9PU1hdGgmJnR9LHI9ZSgib2JqZWN0Ij09dHlwZW9mIGdsb2JhbFRoaXMmJmdsb2JhbFRoaXMpfHxlKCJvYmplY3QiPT10eXBlb2Ygd2luZG93JiZ3aW5kb3cpfHxlKCJvYmplY3QiPT10eXBlb2Ygc2VsZiYmc2VsZil8fGUoIm9iamVjdCI9PXR5cGVvZiB0JiZ0KXx8ZnVuY3Rpb24oKXtyZXR1cm4gdGhpc30oKXx8RnVuY3Rpb24oInJldHVybiB0aGlzIikoKSxuPWZ1bmN0aW9uKHQpe3RyeXtyZXR1cm4hIXQoKX1jYXRjaCh0KXtyZXR1cm4hMH19LG89IW4oKGZ1bmN0aW9uKCl7dmFyIHQ9ZnVuY3Rpb24oKXt9LmJpbmQoKTtyZXR1cm4iZnVuY3Rpb24iIT10eXBlb2YgdHx8dC5oYXNPd25Qcm9wZXJ0eSgicHJvdG90eXBlIil9KSksaT1vLHU9RnVuY3Rpb24ucHJvdG90eXBlLGM9dS5hcHBseSxhPXUuY2FsbCxmPSJvYmplY3QiPT10eXBlb2YgUmVmbGVjdCYmUmVmbGVjdC5hcHBseXx8KGk/YS5iaW5kKGMpOmZ1bmN0aW9uKCl7cmV0dXJuIGEuYXBwbHkoYyxhcmd1bWVudHMpfSksbD1vLHM9RnVuY3Rpb24ucHJvdG90eXBlLHA9cy5iaW5kLGI9cy5jYWxsLHk9bCYmcC5iaW5kKGIsYiksdj1sP2Z1bmN0aW9uKHQpe3JldHVybiB0JiZ5KHQpfTpmdW5jdGlvbih0KXtyZXR1cm4gdCYmZnVuY3Rpb24oKXtyZXR1cm4gYi5hcHBseSh0LGFyZ3VtZW50cyl9fSxkPWZ1bmN0aW9uKHQpe3JldHVybiJmdW5jdGlvbiI9PXR5cGVvZiB0fSxoPXt9LG09IW4oKGZ1bmN0aW9uKCl7cmV0dXJuIDchPU9iamVjdC5kZWZpbmVQcm9wZXJ0eSh7fSwxLHtnZXQ6ZnVuY3Rpb24oKXtyZXR1cm4gN319KVsxXX0pKSxnPW8sdz1GdW5jdGlvbi5wcm90b3R5cGUuY2FsbCxqPWc/dy5iaW5kKHcpOmZ1bmN0aW9uKCl7cmV0dXJuIHcuYXBwbHkodyxhcmd1bWVudHMpfSxPPXt9LFM9e30ucHJvcGVydHlJc0VudW1lcmFibGUsRT1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yLFA9RSYmIVMuY2FsbCh7MToyfSwxKTtPLmY9UD9mdW5jdGlvbih0KXt2YXIgZT1FKHRoaXMsdCk7cmV0dXJuISFlJiZlLmVudW1lcmFibGV9OlM7dmFyIFQsSSxrPWZ1bmN0aW9uKHQsZSl7cmV0dXJue2VudW1lcmFibGU6ISgxJnQpLGNvbmZpZ3VyYWJsZTohKDImdCksd3JpdGFibGU6ISg0JnQpLHZhbHVlOmV9fSxDPXYsXz1DKHt9LnRvU3RyaW5nKSxGPUMoIiIuc2xpY2UpLEw9bix6PWZ1bmN0aW9uKHQpe3JldHVybiBGKF8odCksOCwtMSl9LEQ9T2JqZWN0LE09digiIi5zcGxpdCksTj1MKChmdW5jdGlvbigpe3JldHVybiFEKCJ6IikucHJvcGVydHlJc0VudW1lcmFibGUoMCl9KSk/ZnVuY3Rpb24odCl7cmV0dXJuIlN0cmluZyI9PXoodCk/TSh0LCIiKTpEKHQpfTpELHg9VHlwZUVycm9yLEE9ZnVuY3Rpb24odCl7aWYobnVsbD09dCl0aHJvdyB4KCJDYW4ndCBjYWxsIG1ldGhvZCBvbiAiK3QpO3JldHVybiB0fSxSPU4sRz1BLFY9ZCxZPWZ1bmN0aW9uKHQpe3JldHVybiJvYmplY3QiPT10eXBlb2YgdD9udWxsIT09dDpWKHQpfSxxPXt9LEI9cSxIPXIsSj1kLEs9ZnVuY3Rpb24odCl7cmV0dXJuIEoodCk/dDp2b2lkIDB9LFE9ZnVuY3Rpb24odCxlKXtyZXR1cm4gYXJndW1lbnRzLmxlbmd0aDwyP0soQlt0XSl8fEsoSFt0XSk6Qlt0XSYmQlt0XVtlXXx8SFt0XSYmSFt0XVtlXX0sVT12KHt9LmlzUHJvdG90eXBlT2YpLFc9USgibmF2aWdhdG9yIiwidXNlckFnZW50Iil8fCIiLFg9cixaPVcsJD1YLnByb2Nlc3MsdHQ9WC5EZW5vLGV0PSQmJiQudmVyc2lvbnN8fHR0JiZ0dC52ZXJzaW9uLHJ0PWV0JiZldC52ODtydCYmKEk9KFQ9cnQuc3BsaXQoIi4iKSlbMF0+MCYmVFswXTw0PzE6KyhUWzBdK1RbMV0pKSwhSSYmWiYmKCEoVD1aLm1hdGNoKC9FZGdlXC8oXGQrKS8pKXx8VFsxXT49NzQpJiYoVD1aLm1hdGNoKC9DaHJvbWVcLyhcZCspLykpJiYoST0rVFsxXSk7dmFyIG50PUksb3Q9bixpdD0hIU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMmJiFvdCgoZnVuY3Rpb24oKXt2YXIgdD1TeW1ib2woKTtyZXR1cm4hU3RyaW5nKHQpfHwhKE9iamVjdCh0KWluc3RhbmNlb2YgU3ltYm9sKXx8IVN5bWJvbC5zaGFtJiZudCYmbnQ8NDF9KSksdXQ9aXQmJiFTeW1ib2wuc2hhbSYmInN5bWJvbCI9PXR5cGVvZiBTeW1ib2wuaXRlcmF0b3IsY3Q9USxhdD1kLGZ0PVUsbHQ9T2JqZWN0LHN0PXV0P2Z1bmN0aW9uKHQpe3JldHVybiJzeW1ib2wiPT10eXBlb2YgdH06ZnVuY3Rpb24odCl7dmFyIGU9Y3QoIlN5bWJvbCIpO3JldHVybiBhdChlKSYmZnQoZS5wcm90b3R5cGUsbHQodCkpfSxwdD1TdHJpbmcsYnQ9ZCx5dD1mdW5jdGlvbih0KXt0cnl7cmV0dXJuIHB0KHQpfWNhdGNoKHQpe3JldHVybiJPYmplY3QifX0sdnQ9VHlwZUVycm9yLGR0PWZ1bmN0aW9uKHQpe2lmKGJ0KHQpKXJldHVybiB0O3Rocm93IHZ0KHl0KHQpKyIgaXMgbm90IGEgZnVuY3Rpb24iKX0saHQ9ZHQsbXQ9aixndD1kLHd0PVksanQ9VHlwZUVycm9yLE90PXtleHBvcnRzOnt9fSxTdD1yLEV0PU9iamVjdC5kZWZpbmVQcm9wZXJ0eSxQdD1mdW5jdGlvbih0LGUpe3RyeXtFdChTdCx0LHt2YWx1ZTplLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMH0pfWNhdGNoKHIpe1N0W3RdPWV9cmV0dXJuIGV9LFR0PSJfX2NvcmUtanNfc2hhcmVkX18iLEl0PXJbVHRdfHxQdChUdCx7fSk7KE90LmV4cG9ydHM9ZnVuY3Rpb24odCxlKXtyZXR1cm4gSXRbdF18fChJdFt0XT12b2lkIDAhPT1lP2U6e30pfSkoInZlcnNpb25zIixbXSkucHVzaCh7dmVyc2lvbjoiMy4yMy40Iixtb2RlOiJwdXJlIixjb3B5cmlnaHQ6IsKpIDIwMTQtMjAyMiBEZW5pcyBQdXNoa2FyZXYgKHpsb2lyb2NrLnJ1KSIsbGljZW5zZToiaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvYmxvYi92My4yMy40L0xJQ0VOU0UiLHNvdXJjZToiaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMifSk7dmFyIGt0PUEsQ3Q9T2JqZWN0LF90PWZ1bmN0aW9uKHQpe3JldHVybiBDdChrdCh0KSl9LEZ0PXYoe30uaGFzT3duUHJvcGVydHkpLEx0PU9iamVjdC5oYXNPd258fGZ1bmN0aW9uKHQsZSl7cmV0dXJuIEZ0KF90KHQpLGUpfSx6dD12LER0PTAsTXQ9TWF0aC5yYW5kb20oKSxOdD16dCgxLi50b1N0cmluZykseHQ9cixBdD1PdC5leHBvcnRzLFJ0PUx0LEd0PWZ1bmN0aW9uKHQpe3JldHVybiJTeW1ib2woIisodm9pZCAwPT09dD8iIjp0KSsiKV8iK050KCsrRHQrTXQsMzYpfSxWdD1pdCxZdD11dCxxdD1BdCgid2tzIiksQnQ9eHQuU3ltYm9sLEh0PUJ0JiZCdC5mb3IsSnQ9WXQ/QnQ6QnQmJkJ0LndpdGhvdXRTZXR0ZXJ8fEd0LEt0PWosUXQ9WSxVdD1zdCxXdD1mdW5jdGlvbih0LGUpe3ZhciByPXRbZV07cmV0dXJuIG51bGw9PXI/dm9pZCAwOmh0KHIpfSxYdD1mdW5jdGlvbih0LGUpe3ZhciByLG47aWYoInN0cmluZyI9PT1lJiZndChyPXQudG9TdHJpbmcpJiYhd3Qobj1tdChyLHQpKSlyZXR1cm4gbjtpZihndChyPXQudmFsdWVPZikmJiF3dChuPW10KHIsdCkpKXJldHVybiBuO2lmKCJzdHJpbmciIT09ZSYmZ3Qocj10LnRvU3RyaW5nKSYmIXd0KG49bXQocix0KSkpcmV0dXJuIG47dGhyb3cganQoIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfSxadD1UeXBlRXJyb3IsJHQ9ZnVuY3Rpb24odCl7aWYoIVJ0KHF0LHQpfHwhVnQmJiJzdHJpbmciIT10eXBlb2YgcXRbdF0pe3ZhciBlPSJTeW1ib2wuIit0O1Z0JiZSdChCdCx0KT9xdFt0XT1CdFt0XTpxdFt0XT1ZdCYmSHQ/SHQoZSk6SnQoZSl9cmV0dXJuIHF0W3RdfSgidG9QcmltaXRpdmUiKSx0ZT1mdW5jdGlvbih0LGUpe2lmKCFRdCh0KXx8VXQodCkpcmV0dXJuIHQ7dmFyIHIsbj1XdCh0LCR0KTtpZihuKXtpZih2b2lkIDA9PT1lJiYoZT0iZGVmYXVsdCIpLHI9S3Qobix0LGUpLCFRdChyKXx8VXQocikpcmV0dXJuIHI7dGhyb3cgWnQoIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfXJldHVybiB2b2lkIDA9PT1lJiYoZT0ibnVtYmVyIiksWHQodCxlKX0sZWU9c3QscmU9ZnVuY3Rpb24odCl7dmFyIGU9dGUodCwic3RyaW5nIik7cmV0dXJuIGVlKGUpP2U6ZSsiIn0sbmU9WSxvZT1yLmRvY3VtZW50LGllPW5lKG9lKSYmbmUob2UuY3JlYXRlRWxlbWVudCksdWU9ZnVuY3Rpb24odCl7cmV0dXJuIGllP29lLmNyZWF0ZUVsZW1lbnQodCk6e319LGNlPSFtJiYhbigoZnVuY3Rpb24oKXtyZXR1cm4gNyE9T2JqZWN0LmRlZmluZVByb3BlcnR5KHVlKCJkaXYiKSwiYSIse2dldDpmdW5jdGlvbigpe3JldHVybiA3fX0pLmF9KSksYWU9bSxmZT1qLGxlPU8sc2U9ayxwZT1mdW5jdGlvbih0KXtyZXR1cm4gUihHKHQpKX0sYmU9cmUseWU9THQsdmU9Y2UsZGU9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjtoLmY9YWU/ZGU6ZnVuY3Rpb24odCxlKXtpZih0PXBlKHQpLGU9YmUoZSksdmUpdHJ5e3JldHVybiBkZSh0LGUpfWNhdGNoKHQpe31pZih5ZSh0LGUpKXJldHVybiBzZSghZmUobGUuZix0LGUpLHRbZV0pfTt2YXIgaGU9bixtZT1kLGdlPS8jfFwucHJvdG90eXBlXC4vLHdlPWZ1bmN0aW9uKHQsZSl7dmFyIHI9T2VbamUodCldO3JldHVybiByPT1FZXx8ciE9U2UmJihtZShlKT9oZShlKTohIWUpfSxqZT13ZS5ub3JtYWxpemU9ZnVuY3Rpb24odCl7cmV0dXJuIFN0cmluZyh0KS5yZXBsYWNlKGdlLCIuIikudG9Mb3dlckNhc2UoKX0sT2U9d2UuZGF0YT17fSxTZT13ZS5OQVRJVkU9Ik4iLEVlPXdlLlBPTFlGSUxMPSJQIixQZT13ZSxUZT1kdCxJZT1vLGtlPXYodi5iaW5kKSxDZT17fSxfZT1tJiZuKChmdW5jdGlvbigpe3JldHVybiA0MiE9T2JqZWN0LmRlZmluZVByb3BlcnR5KChmdW5jdGlvbigpe30pLCJwcm90b3R5cGUiLHt2YWx1ZTo0Mix3cml0YWJsZTohMX0pLnByb3RvdHlwZX0pKSxGZT1ZLExlPVN0cmluZyx6ZT1UeXBlRXJyb3IsRGU9bSxNZT1jZSxOZT1fZSx4ZT1mdW5jdGlvbih0KXtpZihGZSh0KSlyZXR1cm4gdDt0aHJvdyB6ZShMZSh0KSsiIGlzIG5vdCBhbiBvYmplY3QiKX0sQWU9cmUsUmU9VHlwZUVycm9yLEdlPU9iamVjdC5kZWZpbmVQcm9wZXJ0eSxWZT1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yLFllPSJlbnVtZXJhYmxlIixxZT0iY29uZmlndXJhYmxlIixCZT0id3JpdGFibGUiO0NlLmY9RGU/TmU/ZnVuY3Rpb24odCxlLHIpe2lmKHhlKHQpLGU9QWUoZSkseGUociksImZ1bmN0aW9uIj09dHlwZW9mIHQmJiJwcm90b3R5cGUiPT09ZSYmInZhbHVlImluIHImJkJlIGluIHImJiFyLndyaXRhYmxlKXt2YXIgbj1WZSh0LGUpO24mJm4ud3JpdGFibGUmJih0W2VdPXIudmFsdWUscj17Y29uZmlndXJhYmxlOnFlIGluIHI/ci5jb25maWd1cmFibGU6bi5jb25maWd1cmFibGUsZW51bWVyYWJsZTpZZSBpbiByP3IuZW51bWVyYWJsZTpuLmVudW1lcmFibGUsd3JpdGFibGU6ITF9KX1yZXR1cm4gR2UodCxlLHIpfTpHZTpmdW5jdGlvbih0LGUscil7aWYoeGUodCksZT1BZShlKSx4ZShyKSxNZSl0cnl7cmV0dXJuIEdlKHQsZSxyKX1jYXRjaCh0KXt9aWYoImdldCJpbiByfHwic2V0ImluIHIpdGhyb3cgUmUoIkFjY2Vzc29ycyBub3Qgc3VwcG9ydGVkIik7cmV0dXJuInZhbHVlImluIHImJih0W2VdPXIudmFsdWUpLHR9O3ZhciBIZT1DZSxKZT1rLEtlPW0/ZnVuY3Rpb24odCxlLHIpe3JldHVybiBIZS5mKHQsZSxKZSgxLHIpKX06ZnVuY3Rpb24odCxlLHIpe3JldHVybiB0W2VdPXIsdH0sUWU9cixVZT1mLFdlPXYsWGU9ZCxaZT1oLmYsJGU9UGUsdHI9cSxlcj1mdW5jdGlvbih0LGUpe3JldHVybiBUZSh0KSx2b2lkIDA9PT1lP3Q6SWU/a2UodCxlKTpmdW5jdGlvbigpe3JldHVybiB0LmFwcGx5KGUsYXJndW1lbnRzKX19LHJyPUtlLG5yPUx0LG9yPWZ1bmN0aW9uKHQpe3ZhciBlPWZ1bmN0aW9uKHIsbixvKXtpZih0aGlzIGluc3RhbmNlb2YgZSl7c3dpdGNoKGFyZ3VtZW50cy5sZW5ndGgpe2Nhc2UgMDpyZXR1cm4gbmV3IHQ7Y2FzZSAxOnJldHVybiBuZXcgdChyKTtjYXNlIDI6cmV0dXJuIG5ldyB0KHIsbil9cmV0dXJuIG5ldyB0KHIsbixvKX1yZXR1cm4gVWUodCx0aGlzLGFyZ3VtZW50cyl9O3JldHVybiBlLnByb3RvdHlwZT10LnByb3RvdHlwZSxlfSxpcj1mdW5jdGlvbih0LGUpe3ZhciByLG4sbyxpLHUsYyxhLGYsbD10LnRhcmdldCxzPXQuZ2xvYmFsLHA9dC5zdGF0LGI9dC5wcm90byx5PXM/UWU6cD9RZVtsXTooUWVbbF18fHt9KS5wcm90b3R5cGUsdj1zP3RyOnRyW2xdfHxycih0cixsLHt9KVtsXSxkPXYucHJvdG90eXBlO2ZvcihvIGluIGUpcj0hJGUocz9vOmwrKHA/Ii4iOiIjIikrbyx0LmZvcmNlZCkmJnkmJm5yKHksbyksdT12W29dLHImJihjPXQuZG9udENhbGxHZXRTZXQ/KGY9WmUoeSxvKSkmJmYudmFsdWU6eVtvXSksaT1yJiZjP2M6ZVtvXSxyJiZ0eXBlb2YgdT09dHlwZW9mIGl8fChhPXQuYmluZCYmcj9lcihpLFFlKTp0LndyYXAmJnI/b3IoaSk6YiYmWGUoaSk/V2UoaSk6aSwodC5zaGFtfHxpJiZpLnNoYW18fHUmJnUuc2hhbSkmJnJyKGEsInNoYW0iLCEwKSxycih2LG8sYSksYiYmKG5yKHRyLG49bCsiUHJvdG90eXBlIil8fHJyKHRyLG4se30pLHJyKHRyW25dLG8saSksdC5yZWFsJiZkJiYhZFtvXSYmcnIoZCxvLGkpKSl9LHVyPXYoW10uc2xpY2UpLGNyPVR5cGVFcnJvcixhcj1yLGZyPWYsbHI9ZCxzcj11cixwcj1mdW5jdGlvbih0LGUpe2lmKHQ8ZSl0aHJvdyBjcigiTm90IGVub3VnaCBhcmd1bWVudHMiKTtyZXR1cm4gdH0sYnI9L01TSUUgLlwuLy50ZXN0KFcpLHlyPWFyLkZ1bmN0aW9uLHZyPWZ1bmN0aW9uKHQpe3JldHVybiBicj9mdW5jdGlvbihlLHIpe3ZhciBuPXByKGFyZ3VtZW50cy5sZW5ndGgsMSk+MixvPWxyKGUpP2U6eXIoZSksaT1uP3NyKGFyZ3VtZW50cywyKTp2b2lkIDA7cmV0dXJuIHQobj9mdW5jdGlvbigpe2ZyKG8sdGhpcyxpKX06byxyKX06dH0sZHI9e3NldFRpbWVvdXQ6dnIoYXIuc2V0VGltZW91dCksc2V0SW50ZXJ2YWw6dnIoYXIuc2V0SW50ZXJ2YWwpfSxocj1kci5zZXRJbnRlcnZhbDtpcih7Z2xvYmFsOiEwLGJpbmQ6ITAsZm9yY2VkOnIuc2V0SW50ZXJ2YWwhPT1ocn0se3NldEludGVydmFsOmhyfSk7dmFyIG1yPWRyLnNldFRpbWVvdXQ7aXIoe2dsb2JhbDohMCxiaW5kOiEwLGZvcmNlZDpyLnNldFRpbWVvdXQhPT1tcn0se3NldFRpbWVvdXQ6bXJ9KTt2YXIgZ3I9cS5zZXRJbnRlcnZhbCx3cj0hMSxqcj1udWxsO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGZ1bmN0aW9uKHQpe3ZhciBlPXQuZGF0YSxyPWUudHlwZSxuPWUuZGF0YTtzd2l0Y2gocil7Y2FzZSJzdGFydCI6d3J8fCh3cj0hMCxqcj1ncigoZnVuY3Rpb24oKXt3cj0hMSxzZWxmLnBvc3RNZXNzYWdlKCJ0aWNrIil9KSxuLnRpbWUpKTticmVhaztjYXNlInN0b3AiOmNsZWFySW50ZXJ2YWwoanIpLHdyPSExfX0pLCExKTtyZXR1cm57fX0oKTsKCg==",null,!1),AP=function(){return new SP},IP=qf("stream:media"),CP=function(){function t(){var t,e,r,i;this.mediaStream=null,this.videoEl=null,this.canvasEl=null,this.audioContext=null,this.audioSource=null,this.worker=null,this.config=null,this.promise=null,this.onVideoError=Qh(t=this.onVideoError).call(t,this),this.onPause=Qh(e=this.onPause).call(e,this),this.onCanPlay=Qh(r=this.onCanPlay).call(r,this),this.renderCanvasPlay=Qh(i=this.renderCanvasPlay).call(i,this)}return t.prototype.start=function(t){var e=this,r=t.video,i=t.audio,n=t.fileSource;return this.config=t,new VR((function(t,o){if(e.promise={resolve:t,reject:o},e.mediaStream)return IP("stream is existed"),void t(e.mediaStream);e.videoEl||(e.videoEl=Eg()),e.videoEl.muted=!i,r&&!e.canvasEl&&(e.canvasEl=document.createElement("canvas")),r&&!e.worker&&(e.worker=AP()),i&&!e.audioContext&&(e.audioContext=Tg());var s=n instanceof File?xP.createObjectURL(n):n;e.playVideo(s)}))},t.prototype.stop=function(){var t;this.mediaStream?(this.destroy(),cc(t=this.mediaStream.getTracks()).call(t,(function(t){t.stop()})),this.mediaStream=null):IP("stream is not existed")},t.prototype.getResolution=function(){if(!this.mediaStream)return null;var t=this.mediaStream.getVideoTracks();if(0===t.length)return null;var e=t[0].getSettings(),r=e.width,i=e.height;return{width:null!=r?r:this.canvasEl.width,height:null!=i?i:this.canvasEl.height}},t.prototype.getRenderView=function(){return this.canvasEl},t.prototype.onVideoError=function(){this.videoEl.error&&(IP("play video error",this.videoEl.error),this.promise.reject(this.videoEl.error))},t.prototype.onPause=function(){var t=this;IP("video is paused, try to resume"),Bl((function(){t.videoEl.play()}),50)},t.prototype.onCanPlay=function(){if(!this.mediaStream){var t=this.config,e=t.video,r=t.audio,i=null,n=null;if(e){var o=e.frameRate;this.renderCanvasPlay(),IP("start render canvas");try{i=this.canvasEl.captureStream(o)}catch(t){return IP("get video stream error, "+t.toString()),void this.promise.reject(t)}}if(r)try{this.audioSource||(this.audioSource=this.audioContext.createMediaElementSource(this.videoEl));var s=this.audioContext.createMediaStreamDestination();this.audioSource.connect(s),n=s.stream}catch(t){return IP("get audio stream error, "+t.toString()),void this.promise.reject(t)}if(i||n){var a,u=new MediaStream;cc(a=[i,n]).call(a,(function(t){var e,r,i=null===(r=null===(e=null==t?void 0:t.getTracks)||void 0===e?void 0:e.call(t))||void 0===r?void 0:r[0];i&&u.addTrack(i)})),this.mediaStream=u,this.promise.resolve(u)}}},t.prototype.renderCanvasPlay=function(){if(this.canvasEl){var t=this.config.video.resolution,e=this.videoEl,r=this.canvasEl.getContext("2d"),i=t.width,n=t.height,o=e.videoWidth,s=e.videoHeight,a=null,u=null;0===o||0===s?(a=i,u=n):i/n<o/s?(a=i,u=i*s/o):(a=n*o/s,u=n),this.canvasEl.width=a,this.canvasEl.height=u,null==r||r.clearRect(0,0,a,u),null==r||r.fillRect(0,0,a,u),null==r||r.drawImage(e,0,0,o,s,0,0,a,u),this.requestAnimationFrameWrapper(this.renderCanvasPlay)}else IP("canvas destroy, render canvas stop")},t.prototype.setWorkerInterval=function(t,e){var r,i,n=this;null===(r=this.worker)||void 0===r||r.addEventListener("message",t),null===(i=this.worker)||void 0===i||i.postMessage({type:"start",data:{time:e}});return function(){var e,r;null===(e=n.worker)||void 0===e||e.postMessage({type:"stop"}),null===(r=n.worker)||void 0===r||r.removeEventListener("message",t)}},t.prototype.requestAnimationFrameWrapper=function(t){var e=this.config.video.frameRate,r=!1,i=this.setWorkerInterval((function(){!r&&document.hidden&&(r=!0,i(),t())}),1e3/e);requestAnimationFrame((function(){r||(r=!0,i(),t())}))},t.prototype.playVideo=function(t){return nd(this,void 0,void 0,(function(){var e,r;return od(this,(function(i){switch(i.label){case 0:(e=this.videoEl).addEventListener("error",this.onVideoError),e.addEventListener("pause",this.onPause),e.addEventListener("canplay",this.onCanPlay),e.src=t,e.load(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.play()];case 2:return i.sent(),IP("play ok"),[3,4];case 3:return r=i.sent(),IP("play failed, "+r.toString()),this.destroy(),this.promise.reject(r),[3,4];case 4:return[2]}}))}))},t.prototype.destroy=function(){var t,e=this.videoEl;e.removeEventListener("error",this.onVideoError),e.removeEventListener("pause",this.onPause),e.removeEventListener("canplay",this.onCanPlay),this.canvasEl&&(this.canvasEl=null);var r=e.src;e.pause(),e.src="",e.removeAttribute("src"),e.load(),r&&this.config.fileSource instanceof File&&xP.revokeObjectURL(r),this.config=null,this.promise=null,this.audioSource&&(this.audioSource.disconnect(),this.audioSource=null),window.TXLiveAudioContext||(null===(t=this.audioContext)||void 0===t||t.close(),this.audioContext=null),this.worker&&(this.worker.terminate(),this.worker=null),this.videoEl&&(this.videoEl.remove(),this.videoEl=null)},t}(),OP=qf("stream:image"),wP=function(){function t(){var t;this.mediaStream=null,this.imageEl=null,this.canvasEl=null,this.config=null,this.promise=null,this.onLoad=Qh(t=this.onLoad).call(t,this)}return t.prototype.start=function(t){var e=this,r=t.fileSource;return this.config=t,new VR((function(t,i){if(e.promise={resolve:t,reject:i},e.mediaStream)return OP("stream is existed"),void t(e.mediaStream);if(e.imageEl||(e.imageEl=new Image),e.canvasEl||(e.canvasEl=document.createElement("canvas")),r instanceof File){var n=new FileReader;n.onload=function(){e.loadImage(n.result),n.onload=null,n=null},n.readAsDataURL(r)}else e.loadImage(r)}))},t.prototype.stop=function(){var t;this.mediaStream?(this.imageEl.removeEventListener("load",this.onLoad),this.imageEl.src="",this.imageEl=null,this.canvasEl=null,this.config=null,this.promise=null,cc(t=this.mediaStream.getTracks()).call(t,(function(t){t.stop()})),this.mediaStream=null):OP("stream is not existed")},t.prototype.getResolution=function(){if(!this.mediaStream)return null;var t=this.mediaStream.getVideoTracks();if(0===t.length)return null;var e=t[0].getSettings(),r=e.width,i=e.height;return{width:null!=r?r:this.canvasEl.width,height:null!=i?i:this.canvasEl.height}},t.prototype.getRenderView=function(){return this.canvasEl},t.prototype.onLoad=function(){var t=this,e=this.config.video,r=e.frameRate,i=e.resolution;OP("image is loaded, start render canvas");var n=this.canvasEl.getContext("2d"),o=i.width,s=i.height,a=this.imageEl.naturalWidth,u=this.imageEl.naturalHeight,h=null,c=null;0===a||0===u?(h=o,c=s):o/s<a/u?(h=o,c=o*u/a):(h=s*a/u,c=s),this.canvasEl.width=h,this.canvasEl.height=c;!function e(){t.imageEl&&t.canvasEl?(n.clearRect(0,0,h,c),n.fillRect(0,0,h,c),n.drawImage(t.imageEl,0,0,a,u,0,0,h,c),requestAnimationFrame(e)):OP("draw image stop")}();try{var l=this.canvasEl.captureStream(r),d=l.getAudioTracks();cc(d).call(d,(function(t){l.removeTrack(t)})),this.mediaStream=l,this.promise.resolve(l)}catch(t){OP("get image stream error, "+t.toString()),this.promise.reject(t)}},t.prototype.loadImage=function(t){this.imageEl.addEventListener("load",this.onLoad),this.imageEl.src=t},t}(),PP=qf("stream"),NP=function(){function t(t){this.type=null,this.videoConfig=null,this.audioConfig=null,this.fileSource=null,this.onEvent=null,this.instance=null;var e=t.type,r=t.video,i=t.audio,n=t.fileSource,o=t.onEvent;e&&Sl(ap).call(ap,e)?(this.type=e,"file"===e&&this.setFileSource(n),r||i?((r||"screen"===e)&&(this.videoConfig=bI(up)),i&&(this.audioConfig=bI(hp)),o&&"function"==typeof o&&(this.onEvent=o)):PP("video or audio must be existed")):PP("stream type("+e+") is invalid")}return t.prototype.setFileSource=function(t){var e,r;if("file"===this.type)if(t)if("string"==typeof t||t instanceof File){var i="string"==typeof t?nS(e=dp.extension).call(e,(function(e){var r;return gS(r=t.toLowerCase()).call(r,e)})):nS(r=dp.type).call(r,(function(e){return t.type===e}));i?this.fileSource=t:PP("File format is not supported")}else PP("fileSource must be string or file object");else PP("fileSource must be existed");else PP("stream type must be file")},t.prototype.setVideoConfig=function(t){if(this.videoConfig){var e=t.deviceId,r=t.frameRate,i=t.resolution;void 0!==e&&("string"==typeof e?this.videoConfig.deviceId=e:PP("deviceId must be string")),void 0!==r&&"number"==typeof r&&r>0?this.videoConfig.frameRate=r:PP("frameRate must be a number greater than 0"),void 0!==i&&"object"===Nh(i)&&"number"==typeof i.width&&"number"==typeof i.height&&i.width>0&&i.height>0?this.videoConfig.resolution=i:PP("resolution width and height must be a number greater than 0")}},t.prototype.setAudioConfig=function(t){if(this.audioConfig){var e=t.deviceId,r=t.sampleRate,i=t.echoCancellation,n=t.noiseSuppression,o=t.autoGainControl;void 0!==e&&("string"==typeof e?this.audioConfig.deviceId=e:PP("deviceId must be string")),void 0!==r&&"number"==typeof r&&r>0?this.audioConfig.sampleRate=r:PP("sampleRate must be a number greater than 0"),void 0!==i&&(this.audioConfig.echoCancellation=!!i),void 0!==n&&(this.audioConfig.noiseSuppression=!!n),void 0!==o&&(this.audioConfig.autoGainControl=!!o)}},t.prototype.start=function(){return nd(this,void 0,void 0,(function(){var t,e,r,i,n,o,s;return od(this,(function(a){switch(a.label){case 0:if(!this.type)throw PP("start failed, init param type is invalid"),(i=new Error("init param type is invalid")).name="InitializedError",i;if(!this.videoConfig&&!this.audioConfig)throw PP("start failed, init param video or audio must be existed"),(i=new Error("init param video or audio must be existed")).name="InitializedError",i;if("file"===this.type&&!this.fileSource)throw PP("start failed, file source is not existed"),(i=new Error("file source is not existed")).name="NotFoundError",i;var u,h;if(t="media","file"===this.type)if(e=this.fileSource,r="string"==typeof e?nS(u=lp).call(u,(function(t){var r;return gS(r=e.toLowerCase()).call(r,t)})):nS(h=cp).call(h,(function(t){return e.type===t})),"image"===(t=r?"image":"media")&&!this.videoConfig)throw PP("start failed, init param video must be existed"),(i=new Error("init param video must be existed")).name="InitializedError",i;if(!this.instance){switch(n=null,this.type){case"device":n=new EI;break;case"screen":n=new RI;break;case"file":n="media"===t?new CP:new wP}this.instance=n}if(this.instance.mediaStream)return PP("stream is existed"),[2,this.instance.mediaStream];o=void 0,"file"!==this.type?o={video:this.videoConfig,audio:this.audioConfig}:"media"===t?o={video:this.videoConfig,audio:!!this.audioConfig,fileSource:this.fileSource}:"image"===t&&(o={video:this.videoConfig,fileSource:this.fileSource}),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.instance.start(o)];case 2:return s=a.sent(),this.addStopListener(s),[2,s];case 3:throw a.sent();case 4:return[2]}}))}))},t.prototype.stop=function(){var t,e;null===(t=this.instance)||void 0===t||t.stop(),null===(e=this.onEvent)||void 0===e||e.call(this,{type:pp,data:{message:"manual stop"}})},t.prototype.getMediaStream=function(){var t;return null===(t=this.instance)||void 0===t?void 0:t.mediaStream},t.prototype.getVideoTrack=function(){var t,e,r,i;return null===(i=null===(r=null===(e=null===(t=this.instance)||void 0===t?void 0:t.mediaStream)||void 0===e?void 0:e.getVideoTracks)||void 0===r?void 0:r.call(e))||void 0===i?void 0:i[0]},t.prototype.getAudioTrack=function(){var t,e,r,i;return null===(i=null===(r=null===(e=null===(t=this.instance)||void 0===t?void 0:t.mediaStream)||void 0===e?void 0:e.getAudioTracks)||void 0===r?void 0:r.call(e))||void 0===i?void 0:i[0]},t.prototype.getResolution=function(){var t;return null===(t=this.instance)||void 0===t?void 0:t.getResolution()},t.prototype.getRenderView=function(){var t,e;return this.instance&&(this.instance instanceof wP||this.instance instanceof CP)?null===(e=null===(t=this.instance)||void 0===t?void 0:t.getRenderView)||void 0===e?void 0:e.call(t):null},t.prototype.addStopListener=function(t){var e,r=this;"file"!==this.type&&cc(e=t.getTracks()).call(e,(function(e){e.addEventListener("ended",(function i(){var n,o,s,a;PP(e.kind+" track is ended"),e.stop(),null===(o=r.onEvent)||void 0===o||o.call(r,{type:fp,data:{message:"track ended",kind:e.kind}});var u=rd(n=t.getTracks()).call(n,(function(t){return"ended"===t.readyState}));u&&(PP("stream is ended"),null===(s=r.instance)||void 0===s||s.stop(),null===(a=r.onEvent)||void 0===a||a.call(r,{type:pp,data:{message:"stream ended"}})),e.removeEventListener("ended",i,!1)}),!1)}))},t}(),MP=qf("manager:device"),DP=function(){function t(t){this.getCommonData=null;var e=t.getCommonData;this.getCommonData=e}return t.prototype.getDevicesList=function(t){return nd(this,void 0,void 0,(function(){var e,r,i,n;return od(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,navigator.mediaDevices.enumerateDevices()];case 1:var s;return e=o.sent(),r=[],i=[],cc(e).call(e,(function(t){var e=t.kind,n=t.deviceId,o=t.label;"videoinput"===e?r.push({type:"video",deviceId:n,deviceName:o}):"audioinput"===e&&"default"!==n&&i.push({type:"audio",deviceId:n,deviceName:o})})),t?"video"===t?[2,r]:"audio"===t?[2,i]:[2,[]]:[2,ql(s=[]).call(s,r,i)];case 2:throw n=o.sent(),MP("enumerateDevices error: ",n),n;case 3:return[2]}}))}))},t.prototype.getCurrentDevice=function(t,e){return nd(this,void 0,void 0,(function(){var r,i,n,o,s,a,u,h,c,l,d,f,p;return od(this,(function(m){var v;switch(m.label){case 0:if(r=this.getCommonData(),i=r.streamList,n=r.videoEffectManager,!Sl(v=["video","audio"]).call(v,t))throw MP("type is invalid"),new Error("type is invalid");if(n.enabled&&!e)throw MP("streamId is not existed"),new Error("streamId is not existed");if(o="video"===t?"camera":"microphone",!((s=$c(i).call(i,(function(t){return t.type===o&&(!e||t.id===e)})))&&s.source instanceof NP))return[3,5];if(!(a="video"===t?s.source.getVideoTrack():s.source.getAudioTrack()))return[3,5];u=a.getSettings().deviceId,h={type:t,deviceId:u,deviceName:""},m.label=1;case 1:return m.trys.push([1,3,,4]),[4,navigator.mediaDevices.enumerateDevices()];case 2:return c=m.sent(),l=t+"input",(d=$c(c).call(c,(function(t){return t.kind===l&&t.deviceId===u})))&&("default"===u?(f=$c(c).call(c,(function(t){return t.kind===l&&"default"!==t.deviceId&&t.groupId===d.groupId})))&&(h.deviceId=f.deviceId,h.deviceName=f.label):h.deviceName=d.label),[3,4];case 3:return p=m.sent(),MP("enumerateDevices error: ",p),[3,4];case 4:return[2,h];case 5:return[2,null]}}))}))},t.prototype.switchDevice=function(t,e,r){var i;return nd(this,void 0,void 0,(function(){var n,o,s,a,u,h,c,l,d,f,p,m,v,_,y,g,b,T,E,x,R,S,A,I,C;return od(this,(function(O){var w;switch(O.label){case 0:if(n=this.getCommonData(),o=n.streamList,s=n.videoEffectManager,a=n.observer,u=n.videoQuality,h=n.audioQuality,c=n.streamOutput,l=n.isStreamPushing,d=n.connection,f=n.setProcessData,!Sl(w=["video","audio"]).call(w,t))throw MP("type is invalid"),new Error("type is invalid");if(!e)throw MP("deviceId is not existed"),new Error("deviceId is not existed");if(s.enabled&&!r)throw MP("streamId is not existed"),new Error("streamId is not existed");if(p="video"===t?"camera":"microphone",!((m=$c(o).call(o,(function(t){return t.type===p&&(!r||t.id===r)})))&&m.source instanceof NP))return[3,9];v=null,"video"===t?(v=new NP({type:"device",video:!0,audio:!1,onEvent:function(t){var e,r;t.type===pp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(r=a.onWarning)||void 0===r||r.call(a,Zf.TXLIVE_WARNING_CAMERA_INTERRUPTED,"interrupted",{streamId:m.id}))}}),_=u.frameRate,y=u.width,g=u.height,v.setVideoConfig({deviceId:e,frameRate:_,resolution:{width:y,height:g}})):(v=new NP({type:"device",video:!1,audio:!0,onEvent:function(t){var e,r;t.type===pp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(r=a.onWarning)||void 0===r||r.call(a,Zf.TXLIVE_WARNING_MICROPHONE_INTERRUPTED,"interrupted",{streamId:m.id}))}}),b=h.sampleRate,T=h.echoCancellation,E=h.noiseSuppression,x=h.autoGainControl,v.setAudioConfig({deviceId:e,sampleRate:b,echoCancellation:T,noiseSuppression:E,autoGainControl:x})),R=m.source,m.source=v,O.label=1;case 1:return O.trys.push([1,7,,8]),[4,v.start()];case 2:return O.sent(),s.enabled||"video"!==t?[3,5]:(S=R.getVideoTrack(),A=v.getVideoTrack(),c&&(S?c.removeTrack(S):(I=c.getTracks(),cc(I).call(I,(function(e){e.kind===t&&"ended"===e.readyState&&c.removeTrack(e)}))),c.addTrack(A)),l&&d?[4,d.replaceStreamTrack(A)]:[3,4]);case 3:O.sent(),O.label=4;case 4:return[3,6];case 5:m.track.setSource(v),f(),O.label=6;case 6:return R.stop(),MP("switch "+("video"===t?"camera":"microphone")+" successfully"),[3,8];case 7:throw C=O.sent(),null===(i=a.onWarning)||void 0===i||i.call(a,"video"===t?Zf.TXLIVE_WARNING_CAMERA_START_FAILED:Zf.TXLIVE_WARNING_MICROPHONE_START_FAILED,C.toString(),null),C;case 8:return[3,10];case 9:MP("stream is not existed"),O.label=10;case 10:return[2]}}))}))},t.prototype.switchCamera=function(t,e){return this.switchDevice("video",t,e)},t.prototype.switchMicrophone=function(t,e){return this.switchDevice("audio",t,e)},t}();yr({target:"Array",stat:!0},{isArray:br});var LP,UP=W.Array.isArray,FP={width:1280,height:720},GP={video:["video","image"],audio:["audio"],text:["text"]};!function(t){t[t.NONE=0]="NONE",t[t.LEFT_RIGHT=1]="LEFT_RIGHT",t[t.UP_DOWN=2]="UP_DOWN",t[t.ALL=3]="ALL"}(LP||(LP={}));var BP={font:"fontFamily",font_size:"fontSize",font_color:"fill",bold:"fontWeight",italic:"fontStyle",shadow_color:"dropShadowColor",shadow_alpha:"dropShadowAlpha",stroke_color:"stroke",stroke_thickness:"strokeThickness"},kP={threshold:{value:-24,min:-100,max:0},ratio:{value:12,min:1,max:20},knee:{value:30,min:0,max:40},attack:{value:3,min:0,max:1e3},release:{value:250,min:0,max:1e3}},XP=qf("process:helper"),HP=function(){function t(t,e){this.data={},this.data.id=Ff(),this.data.type=t,this.data.order=0;var r={};r.id=Ff(8),r.type=t,e&&(r.source=e,e instanceof HTMLImageElement&&(r.type="image")),this.data.items=[r]}return t.prototype.setSource=function(t){var e=this.data,r=e.type,i=e.items[0];"video"===r||"audio"===r?t?"video"!==r||t instanceof NP||t instanceof MediaStream||t instanceof HTMLVideoElement||t instanceof HTMLImageElement?"audio"!==r||t instanceof NP||t instanceof MediaStream||t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?(i.source=t,t instanceof HTMLImageElement&&(i.type="image"),this.data.items[0]=id({},i)):XP("audio source is invalid"):XP("video source is invalid"):XP("source must be existed"):XP("type("+r+") is invalid")},t.prototype.setOrder=function(t){"number"==typeof t?this.data.order=t:XP("order must be a number")},t.prototype.setLayout=function(t){var e;if("video"===this.data.type){var r=t.width,i=t.height,n=t.x,o=t.y,s=rd(e=[r,i,n,o]).call(e,(function(t){return"number"==typeof t}));if(s)if(r<0||i<0)XP("width or height must be a number greater than or equal to 0");else{var a=this.data.items[0];this.data.items[0]=id(id({},a),{width:r,height:i,position:{x:n,y:o}})}else XP("layout params must be number")}else XP("type is "+this.data.type+", setLayout is not working")},t.prototype.setPosition=function(t,e){var r;if("video"===this.data.type||"text"===this.data.type){var i=rd(r=[t,e]).call(r,(function(t){return"number"==typeof t}));if(i){var n=this.data.items[0];this.data.items[0]=id(id({},n),{position:{x:t,y:e}})}else XP("position params must be number")}else XP("type is "+this.data.type+", setPosition is not working")},t.prototype.setSize=function(t,e){var r;if("video"===this.data.type){var i=rd(r=[t,e]).call(r,(function(t){return"number"==typeof t}));if(i)if(t<0||e<0)XP("width or height must be a number greater than or equal to 0");else{var n=this.data.items[0];this.data.items[0]=id(id({},n),{width:t,height:e})}else XP("size params must be number")}else XP("type is "+this.data.type+", setSize is not working")},t.prototype.setMirror=function(t){if("video"===this.data.type)if("number"!=typeof t||t<LP.NONE||t>LP.ALL)XP("mirror type must be a number between 0 and 3");else{var e=this.data.items[0],r=e.operations;if(void 0!==r||t!==LP.NONE){var i=Sc(r=r||[]).call(r,(function(t){return"image_mirror"===t.type})),n=function(t){-1!==i?r[i]=t:r.push(t)};switch(t){case LP.NONE:-1!==i&&Vc(r).call(r,i,1);break;case LP.LEFT_RIGHT:n({type:"image_mirror",params:{left_right:1}});break;case LP.UP_DOWN:n({type:"image_mirror",params:{up_down:1}});break;case LP.ALL:n({type:"image_mirror",params:{left_right:1,up_down:1}})}this.data.items[0]=id(id({},e),{operations:r})}}else XP("type is "+this.data.type+", setMirror is not working")},t.prototype.setVolume=function(t){if("video"===this.data.type||"audio"===this.data.type){var e=this.data.items[0];if("image"!==e.type)if("number"==typeof t){var r=e.operations,i=void 0===r?[]:r,n=Sc(i).call(i,(function(t){return"audio_volumes"===t.type})),o={type:"audio_volumes",params:{all:t}};-1!==n?i[n]=o:i.push(o),this.data.items[0]=id(id({},e),{operations:i})}else XP("volume must be a number");else XP("type is image, setVolume is not working")}else XP("type is "+this.data.type+", setVolume is not working")},t.prototype.setCompressor=function(t){var e;if("video"===this.data.type||"audio"===this.data.type){var r=this.data.items[0];if("image"!==r.type){var i=r.operations,n=void 0===i?[]:i,o=Sc(n).call(n,(function(t){return"audio_compressor"===t.type}));if(t){if(rd(e=rl(t)).call(e,(function(e){var r=kP[e];if(!r)return XP("param "+e+" is invalid"),!1;var i=t[e];return!("number"!=typeof i||i<r.min||i>r.max)||(XP("param "+e+" must be a number between "+r.min+" and "+r.max),!1)}))){var s={type:"audio_compressor",params:id({},t)};-1!==o?n[o]=s:n.push(s),this.data.items[0]=id(id({},r),{operations:n})}}else-1!==o&&(Vc(n).call(n,o,1),this.data.items[0]=id(id({},r),{operations:n}))}else XP("type is image, setCompressor is not working")}else XP("type is "+this.data.type+", setCompressor is not working")},t.prototype.setNormalFilter=function(t){var e;if("video"===this.data.type){var r=this.data.items[0],i=r.operations,n=void 0===i?[]:i,o=Sc(n).call(n,(function(t){return"image_filter_normal"===t.type}));if(t){if(rd(e=rl(t)).call(e,(function(e){var r=t[e];return!("number"!=typeof r||r<-100||r>100)||(XP("param "+e+" must be a number between -100 and 100"),!1)}))){var s={type:"image_filter_normal",params:id({},t)};-1!==o?n[o]=s:n.push(s),this.data.items[0]=id(id({},r),{operations:n})}}else-1!==o&&(Vc(n).call(n,o,1),this.data.items[0]=id(id({},r),{operations:n}))}else XP("type is "+this.data.type+", setNormalFilter is not working")},t.prototype.setText=function(t,e){if("text"===this.data.type)if(t)if("object"!==Nh(e)||UP(e)||null===e)XP("style is invalid");else{var r=this.data.items[0];this.data.items[0]=id(id({},r),{content:{text:t,text_style:e}})}else XP("text content is not existed");else XP("type is "+this.data.type+", setText is not working")},t}(),jP=function(t,e){var r;if(Sl(r=rl(GP)).call(r,t)){if("video"===t||"audio"===t){if(!e)return void XP("source must be existed");if(!("video"!==t||e instanceof NP||e instanceof MediaStream||e instanceof HTMLVideoElement||e instanceof HTMLImageElement))return void XP("video source is invalid");if(!("audio"!==t||e instanceof NP||e instanceof MediaStream||e instanceof HTMLVideoElement||e instanceof HTMLAudioElement))return void XP("audio source is invalid")}return new HP(t,e)}XP("type("+t+") is invalid")},VP=qf("manager:video"),YP=function(){function t(t){this.enabled=!1,this.getCommonData=null,this.config={videoWidth:null,videoHeight:null,videoFramerate:null,backgroundColor:null};var e=t.getCommonData;this.getCommonData=e}return t.prototype.enableMixing=function(t){var e=this.getCommonData(),r=e.streamList,i=e.streamOutput;r.length>0||i?VP("stream is existed, please stop streaming first"):this.enabled=!!t},t.prototype.setMixingConfig=function(t){if(t){var e=t.videoWidth,r=t.videoHeight,i=t.videoFramerate,n=t.backgroundColor;void 0!==e&&("number"==typeof e&&e>0?this.config.videoWidth=e:VP("videoWidth must be a number greater than 0")),void 0!==r&&("number"==typeof r&&r>0?this.config.videoHeight=r:VP("videoHeight must be a number greater than 0")),void 0!==i&&("number"==typeof i&&i>0?this.config.videoFramerate=i:VP("videoFramerate must be a number greater than 0")),void 0!==n&&("number"==typeof n&&n>=0&&n<=16777215?this.config.backgroundColor=n:VP("backgroundColor must be a valid color number"));var o=this.getCommonData().effectProcess;if(o){var s=this.getMixingConfig(),a=s.videoWidth,u=s.videoHeight,h=s.videoFramerate,c=s.backgroundColor;o.setResolution({width:a,height:u}),o.setFrameRate(h),o.setBackgroundColor(c)}}},t.prototype.getMixingConfig=function(){var t=this.getCommonData().videoQuality,e=t.frameRate,r=t.width,i=t.height,n=this.config,o=n.videoWidth,s=n.videoHeight,a=n.videoFramerate,u=n.backgroundColor;return{videoWidth:null!=o?o:r,videoHeight:null!=s?s:i,videoFramerate:null!=a?a:e,backgroundColor:null!=u?u:0}},t.prototype.setLayout=function(t){var e,r;if(t){var i=this.getCommonData(),n=i.streamList,o=i.setProcessData,s=UP(t)?t:[t],a=function(t){var e=t.streamId,r=t.x,i=t.y,o=t.width,s=t.height,a=t.zOrder,u=$c(n).call(n,(function(t){var r,i=t.source,n=i instanceof NP?i.getMediaStream():i;return(null===(r=null==n?void 0:n.getVideoTracks())||void 0===r?void 0:r.length)&&t.id===e}));u?(u.track.setOrder(a),u.track.setSize(o,s),u.track.setPosition(r,i)):VP("stream "+e+" is not existed")};try{for(var u=sd(s),h=u.next();!h.done;h=u.next()){a(h.value)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}o()}},t.prototype.getLayout=function(t){var e,r;if(!t)return VP("streamId is not existed"),null;var i=this.getCommonData().streamList,n=$c(i).call(i,(function(e){return e.id===t}));if(!n)return VP("stream "+t+" is not existed"),null;var o=n.track.data,s=o.items[0];return{streamId:t,zOrder:o.order,x:null===(e=s.position)||void 0===e?void 0:e.x,y:null===(r=s.position)||void 0===r?void 0:r.y,width:s.width,height:s.height}},t.prototype.setMirror=function(t){var e,r;if(t){var i=this.getCommonData(),n=i.streamList,o=i.setProcessData,s=UP(t)?t:[t],a=function(t){var e=t.streamId,r=t.mirrorType,i=$c(n).call(n,(function(t){var r,i=t.source,n=i instanceof NP?i.getMediaStream():i;return(null===(r=null==n?void 0:n.getVideoTracks())||void 0===r?void 0:r.length)&&t.id===e}));i?i.track.setMirror(r):VP("stream "+e+" is not existed")};try{for(var u=sd(s),h=u.next();!h.done;h=u.next()){a(h.value)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}o()}},t.prototype.setNormalFilter=function(t){var e,r;if(t){var i=this.getCommonData(),n=i.streamList,o=i.setProcessData,s=UP(t)?t:[t],a=function(t){var e=t.streamId,r=t.contrast,i=void 0===r?0:r,o=t.brightness,s=void 0===o?0:o,a=t.saturation,u=void 0===a?0:a,h=$c(n).call(n,(function(t){var r,i=t.source,n=i instanceof NP?i.getMediaStream():i;return(null===(r=null==n?void 0:n.getVideoTracks())||void 0===r?void 0:r.length)&&t.id===e}));h?h.track.setNormalFilter(0===i&&0===s&&0===u?null:{contrast:i,brightness:s,saturation:u}):VP("stream "+e+" is not existed")};try{for(var u=sd(s),h=u.next();!h.done;h=u.next()){a(h.value)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}o()}},t.prototype.setWatermark=function(t){var e,r,i,n,o=this.getCommonData(),s=o.effectTrackList,a=o.setProcessData,u=vc(s).call(s,(function(t){return"video"===t.data.type})),h=function(t){var e=Sc(s).call(s,(function(e){return e===t}));Vc(s).call(s,e,1)};try{for(var c=sd(u),l=c.next();!l.done;l=c.next()){h(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}if(t){var d=UP(t)?t:[t];try{for(var f=sd(d),p=f.next();!p.done;p=f.next()){var m=p.value,v=m.image,_=m.x,y=m.y,g=m.width,b=m.height,T=m.zOrder;if(v&&v instanceof HTMLImageElement){var E=jP("video",v);E.setOrder(T),E.setSize(g,b),E.setPosition(_,y),s.push(E)}else VP("image is invalid")}}catch(t){i={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}a()}else a()},t.prototype.setText=function(t){var e,r,i,n,o=this.getCommonData(),s=o.effectTrackList,a=o.setProcessData,u=vc(s).call(s,(function(t){return"text"===t.data.type})),h=function(t){var e=Sc(s).call(s,(function(e){return e===t}));Vc(s).call(s,e,1)};try{for(var c=sd(u),l=c.next();!l.done;l=c.next()){h(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}if(t){var d=UP(t)?t:[t];try{for(var f=sd(d),p=f.next();!p.done;p=f.next()){var m=p.value,v=m.text,_=m.style,y=m.x,g=m.y,b=m.zOrder;if(v&&"string"==typeof v){var T=jP("text");T.setText(v,_),T.setOrder(b),T.setPosition(y,g),s.push(T)}else VP("text is invalid")}}catch(t){i={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}a()}else a()},t}(),WP=qf("manager:audio"),zP=function(){function t(t){this.getCommonData=null;var e=t.getCommonData;this.getCommonData=e}return t.prototype.setVolume=function(t,e){var r=this.getCommonData(),i=r.videoEffectManager,n=r.streamList,o=r.setProcessData;if("number"==typeof t)if(!i.enabled||e){var s=$c(n).call(n,(function(t){var r,i=t.source,n=i instanceof NP?i.getMediaStream():i;return(null===(r=null==n?void 0:n.getAudioTracks())||void 0===r?void 0:r.length)&&(!e||t.id===e)}));s?(s.track.setVolume(t),o()):WP("stream is not existed")}else WP("streamId is not existed");else WP("volume must be a number")},t}(),ZP=W.setInterval,KP=W,qP=c;KP.JSON||(KP.JSON={stringify:JSON.stringify});var JP=function(t,e,r){return qP(KP.JSON.stringify,null,arguments)},QP=JP,$P="https://webrtcpush.myqcloud.com/webrtc/v1",tN=function(t,e){return fetch(t,{body:QP(e),cache:"no-cache",credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST",mode:"cors"}).then((function(t){if(200!==t.status)throw new Error("status Code:"+t.status);return t.json()}))},eN=function(t){var e;return Yl(e=t.split("\r\n")).call(e,(function(t){return Sl(t).call(t,"a=fmtp:111")?t+";stereo=1":t})).join("\r\n")},rN=function(t,e,r){var i="AS";"firefox"===Uf.browserDetails.browser&&(e*=1e3,i="TIAS");var n=new RegExp("m="+t+" (.*)\r\nc=IN (.*)\r\nb="+i+":(.*)\r\n"),o=new RegExp("m="+t+" (.*)\r\nc=IN (.*)\r\n"),s="m="+t+" $1\r\nc=IN $2\r\nb="+i+":"+e+"\r\n";return r=n.test(r)?r.replace(n,s):r.replace(o,s)},iN=qf("connection"),nN=function(){function t(t){var e,r,i;void 0===t&&(t={}),this.status=rp,this.url=null,this.stream=null,this.bitrate={video:null,audio:null},this.listener={onEvent:null,onStatusUpdate:null,onStatisticsUpdate:null},this.promise=null,this.peerConnection=null,this.negotiating=!1,this.intervalId=null,this.lastStatsReport=null,this.sessionId=null;var n=t.url,o=t.streamSource,s=t.videoBitrate,a=t.audioBitrate,u=t.onEvent,h=t.onStatusUpdate,c=t.onStatisticsUpdate;n&&this.setUrl(n),o&&this.setStreamSource(o),s&&this.setVideoBitrate(s),a&&this.setAudioBitrate(a),u&&"function"==typeof u&&(this.listener.onEvent=u),h&&"function"==typeof h&&(this.listener.onStatusUpdate=h),c&&"function"==typeof c&&(this.listener.onStatisticsUpdate=c),this.onIceConnectionStateChange=Qh(e=this.onIceConnectionStateChange).call(e,this),this.onConnectionStateChange=Qh(r=this.onConnectionStateChange).call(r,this),this.onNegotiationNeeded=Qh(i=this.onNegotiationNeeded).call(i,this)}return t.prototype.setUrl=function(t){if(t){var e=function(t){var e=/^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_]+)(?:\/)([^?#]*)(?:\?*)(?:[^?#]*)/.exec(t);return e?e[1]:null}(t);null!==e?this.url=t:iN("url is invalid")}else iN("url is not existed")},t.prototype.setStreamSource=function(t){t?t instanceof MediaStream||t instanceof NP?this.stream=t instanceof MediaStream?t:t.getMediaStream():iN("streamSource is invalid"):iN("streamSource is not existed")},t.prototype.setVideoBitrate=function(t){"number"==typeof t&&t>0?this.setBitrate("video",t):iN("videoBitrate must be a number greater than 0")},t.prototype.setAudioBitrate=function(t){"number"==typeof t&&t>0?this.setBitrate("audio",t):iN("audioBitrate must be a number greater than 0")},t.prototype.start=function(){var t=this,e=this,r=e.status,i=e.url,n=e.stream;return new VR((function(e,o){t.promise={resolve:e,reject:o};var s=function(t){var e=new Error(t);return e.name="CheckError",e};return i?n?r!==rp?(iN("stream is pushing"),void o(s("stream is pushing"))):void t.startConnect():(iN("stream is invalid"),void o(s("stream is invalid"))):(iN("url is invalid"),void o(s("url is invalid")))}))},t.prototype.stop=function(){if(this.url&&this.sessionId){try{t={streamurl:this.url,sessionid:this.sessionId},nd(void 0,void 0,void 0,(function(){var e,r,i,n;return od(this,(function(o){switch(o.label){case 0:e=$P+"/stopstream",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,tN(e,t)];case 2:if(r=o.sent(),i=r.errcode,n=r.errmsg,0!==i)throw new Error("stop stream failed, errCode:"+i+", errmsg:"+n);return[2,r];case 3:throw o.sent();case 4:return[2]}}))}))}catch(t){iN(t.message)}this.sessionId=null}var t;this.stopConnect()},t.prototype.replaceStreamTrack=function(t){return nd(this,void 0,void 0,(function(){var e,r;return od(this,(function(i){var n;switch(i.label){case 0:if(this.status!==np)throw iN("no stream is pushing"),new Error("no stream is pushing");if(!(t instanceof MediaStreamTrack))throw iN("newTrack must be MediaStreamTrack"),new Error("newTrack must be MediaStreamTrack");i.label=1;case 1:return i.trys.push([1,4,,5]),(e=$c(n=this.peerConnection.getSenders()).call(n,(function(e){return e.track&&e.track.kind===t.kind})))?[4,e.replaceTrack(t)]:[3,3];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:throw r=i.sent(),iN("sender replaceTrack failed"),r;case 5:return[2]}}))}))},t.prototype.getLocalDescription=function(){var t;return null===(t=this.peerConnection)||void 0===t?void 0:t.localDescription},t.prototype.getRemoteDescription=function(){var t;return null===(t=this.peerConnection)||void 0===t?void 0:t.remoteDescription},t.prototype.startConnect=function(){var t,e,r,i=this;try{this.peerConnection=new RTCPeerConnection({iceServers:[],bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"})}catch(t){return iN("create connection error, "+t.toString()),void this.promise.reject(t)}this.status=ip,null===(r=(e=this.listener).onStatusUpdate)||void 0===r||r.call(e,{type:ip,data:{message:"connecting"}}),this.negotiating=!1,this.peerConnection.addEventListener("iceconnectionstatechange",this.onIceConnectionStateChange),this.peerConnection.addEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.addEventListener("negotiationneeded",this.onNegotiationNeeded),cc(t=this.stream.getTracks()).call(t,(function(t){i.peerConnection.addTrack(t,i.stream)}))},t.prototype.stopConnect=function(t){var e,r;void 0===t&&(t="manual stop"),this.status!==rp&&(this.destroyConnect(),null===(r=(e=this.listener).onStatusUpdate)||void 0===r||r.call(e,{type:rp,data:{message:t}}))},t.prototype.destroyConnect=function(){this.status=rp,this.negotiating=!1,this.lastStatsReport=null,this.promise=null,this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.peerConnection&&(this.peerConnection.removeEventListener("iceconnectionstatechange",this.onIceConnectionStateChange),this.peerConnection.removeEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.removeEventListener("negotiationneeded",this.onNegotiationNeeded),this.peerConnection.close(),this.peerConnection=null)},t.prototype.onIceConnectionStateChange=function(){switch(iN("onIceConnectionStateChange: "+this.peerConnection.iceConnectionState),this.peerConnection.iceConnectionState){case"failed":case"disconnected":iN("iceConnection disconnected, please try again"),this.promise.reject(new Error("connection disconnected")),this.stopConnect("connection disconnected")}},t.prototype.onConnectionStateChange=function(){var t,e;switch(iN("onConnectionStateChange: "+this.peerConnection.connectionState),this.peerConnection.connectionState){case"failed":case"disconnected":iN("connection disconnected, please try again"),this.promise.reject(new Error("connection disconnected")),this.stopConnect("connection disconnected");break;case"connected":iN("connection connected"),this.status=np,null===(e=(t=this.listener).onStatusUpdate)||void 0===e||e.call(t,{type:np,data:{message:"connected"}});var r=this.bitrate,i=r.video,n=r.audio;i&&this.setBitrate("video",i),n&&this.setBitrate("audio",n),this.startStatReport(),this.promise.resolve()}},t.prototype.onNegotiationNeeded=function(){iN("onNegotiationNeeded"),this.createOffer()},t.prototype.createOffer=function(){return nd(this,void 0,void 0,(function(){var t,e;return od(this,(function(r){switch(r.label){case 0:if(this.negotiating||"stable"!==this.peerConnection.signalingState)return[2];this.negotiating=!0,r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,this.peerConnection.createOffer()];case 2:return(t=r.sent()).sdp=eN(t.sdp),[4,this.peerConnection.setLocalDescription(t)];case 3:return r.sent(),this.sendOffer(this.peerConnection.localDescription),[3,6];case 4:return e=r.sent(),iN("setLocalDescription error, "+e.toString()),this.promise.reject(e),this.destroyConnect(),[3,6];case 5:return this.negotiating=!1,[7];case 6:return[2]}}))}))},t.prototype.sendOffer=function(t){var e,r,i,n;return nd(this,void 0,void 0,(function(){var o,s,a,u;return od(this,(function(h){switch(h.label){case 0:null===(r=(e=this.listener).onEvent)||void 0===r||r.call(e,{type:op,data:{message:"request push start"}}),h.label=1;case 1:return h.trys.push([1,3,,4]),[4,(c={streamurl:this.url,sessionid:Ff(),localsdp:t},nd(void 0,void 0,void 0,(function(){var t,e,r,i,n;return od(this,(function(o){switch(o.label){case 0:t=$P+"/pushstream",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,tN(t,c)];case 2:if(e=o.sent(),r=e.errcode,i=e.errmsg,n=e.remotesdp,0!==r)throw new Error("push stream failed, errCode:"+r+", errMsg:"+i);return[2,{remoteSdp:n,sessionId:c.sessionid}];case 3:throw o.sent();case 4:return[2]}}))})))];case 2:return o=h.sent(),s=o.remoteSdp,a=o.sessionId,null===(n=(i=this.listener).onEvent)||void 0===n||n.call(i,{type:sp,data:{message:"request push success"}}),this.sessionId=a,this.handleAnswer(s),[3,4];case 3:return u=h.sent(),iN(u.message),u.name="RequestError",this.promise.reject(u),this.destroyConnect(),[3,4];case 4:return[2]}var c}))}))},t.prototype.handleAnswer=function(t){return nd(this,void 0,void 0,(function(){var e;return od(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.peerConnection.setRemoteDescription(new RTCSessionDescription(t))];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),iN("setRemoteDescription error, "+e.toString()),this.promise.reject(e),this.destroyConnect(),[3,3];case 3:return[2]}}))}))},t.prototype.setBitrate=function(t,e){return nd(this,void 0,void 0,(function(){var r,i,n,o,s,a,u,h,c,l;return od(this,(function(d){var f;switch(d.label){case 0:if(this.bitrate[t]=e,this.status!==np)return[2];if(r=Uf.browserDetails,i=r.browser,n=r.version,!(("chrome"===i||"safari"===i||"firefox"===i&&n>=64)&&"RTCRtpSender"in window&&"setParameters"in window.RTCRtpSender.prototype))return[3,5];if(!(o=$c(f=this.peerConnection.getSenders()).call(f,(function(e){return e.track&&e.track.kind===t}))))return[3,4];(s=o.getParameters()).encodings&&0!==s.encodings.length||(s.encodings=[{}]),s.encodings[0].maxBitrate=1e3*e,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,o.setParameters(s)];case 2:return d.sent(),iN(t+" bandwidth is set to "+e+" kbps"),[3,4];case 3:return d.sent(),iN("failed to set bandwidth by setting maxBitrate"),[3,4];case 4:return[2];case 5:return d.trys.push([5,9,,10]),[4,this.peerConnection.createOffer()];case 6:return(a=d.sent()).sdp=eN(a.sdp),[4,this.peerConnection.setLocalDescription(a)];case 7:return d.sent(),u=this.peerConnection.remoteDescription,h=u.type,c=u.sdp,l={type:h,sdp:rN(t,e,c)},iN("applying bandwidth restriction to setRemoteDescription"),[4,this.peerConnection.setRemoteDescription(l)];case 8:return d.sent(),[3,10];case 9:return d.sent(),iN("failed to setRemoteDescription with bandwidth restriction"),[3,10];case 10:return[2]}}))}))},t.prototype.startStatReport=function(){var t=this;this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.intervalId=ZP((function(){return nd(t,void 0,void 0,(function(){var t,e,r,i;return od(this,(function(n){switch(n.label){case 0:return this.peerConnection?[4,this.peerConnection.getStats(null)]:[2];case 1:return t=n.sent(),e=function(t,e){if(void 0===e&&(e=null),e){var r=null,i=null,n=null;if(cc(t).call(t,(function(t){"track"===t.type&&("video"===t.kind||t.frameWidth)&&(r=t.id),"outbound-rtp"===t.type&&("video"===t.kind||"video"===t.mediaType?i=t.id:"audio"!==t.kind&&"audio"!==t.mediaType||(n=t.id))})),i){var o=t.get(r),s=t.get(i),a=e.get(r),u=e.get(i);if(u){var h=(s.timestamp-u.timestamp)/1e3,c=void 0;void 0!==s.framesPerSecond?c=s.framesPerSecond:void 0!==s.framerateMean?c=s.framerateMean:void 0!==(null==o?void 0:o.framesSent)&&void 0!==(null==a?void 0:a.framesSent)&&h&&(c=(o.framesSent-a.framesSent)/h);var l=void 0;void 0!==s.bytesSent&&void 0!==u.bytesSent&&h&&(l=8*(s.bytesSent-u.bytesSent)/h);var d=void 0;void 0!==s.totalEncodeTime&&void 0!==s.framesEncoded&&void 0!==u.totalEncodeTime&&void 0!==u.framesEncoded&&(d=s.framesEncoded-u.framesEncoded?(s.totalEncodeTime-u.totalEncodeTime)/(s.framesEncoded-u.framesEncoded)*1e3:s.totalEncodeTime/s.framesEncoded*1e3);var f=void 0;void 0!==s.totalPacketSendDelay&&void 0!==s.packetsSent&&void 0!==u.totalPacketSendDelay&&void 0!==u.packetsSent&&(f=s.packetsSent-u.packetsSent?(s.totalPacketSendDelay-u.totalPacketSendDelay)/(s.packetsSent-u.packetsSent)*1e3:s.totalPacketSendDelay/s.packetsSent*1e3);var p=t.get(n),m=e.get(n),v=void 0;return void 0!==(null==p?void 0:p.bytesSent)&&void 0!==(null==m?void 0:m.bytesSent)&&h&&(v=8*(p.bytesSent-m.bytesSent)/h),{timestamp:s.timestamp,video:{bitrate:l&&Number(l.toFixed(2)),framesPerSecond:c&&Vg(c.toString(),10),frameWidth:null==o?void 0:o.frameWidth,frameHeight:null==o?void 0:o.frameHeight,framesEncoded:s.framesEncoded,framesSent:null==o?void 0:o.framesSent,packetsSent:s.packetsSent,nackCount:s.nackCount,firCount:s.firCount,pliCount:s.pliCount,frameEncodeAvgTime:d&&Number(d.toFixed(2)),packetSendDelay:f&&Number(f.toFixed(2))},audio:{bitrate:v&&Number(v.toFixed(2)),packetsSent:null==p?void 0:p.packetsSent}}}}}}(t,this.lastStatsReport),this.lastStatsReport=t,e&&(null===(i=(r=this.listener).onStatisticsUpdate)||void 0===i||i.call(r,e)),[2]}}))}))}),1e3)},t}();var oN=setTimeout;function sN(t){return Boolean(t&&void 0!==t.length)}function aN(){}function uN(t){if(!(this instanceof uN))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],pN(t,this)}function hN(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,uN._immediateFn((function(){var r=1===t._state?e.onFulfilled:e.onRejected;if(null!==r){var i;try{i=r(t._value)}catch(t){return void lN(e.promise,t)}cN(e.promise,i)}else(1===t._state?cN:lN)(e.promise,t._value)}))):t._deferreds.push(e)}function cN(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof uN)return t._state=3,t._value=e,void dN(t);if("function"==typeof r)return void pN((i=r,n=e,function(){i.apply(n,arguments)}),t)}t._state=1,t._value=e,dN(t)}catch(e){lN(t,e)}var i,n}function lN(t,e){t._state=2,t._value=e,dN(t)}function dN(t){2===t._state&&0===t._deferreds.length&&uN._immediateFn((function(){t._handled||uN._unhandledRejectionFn(t._value)}));for(var e=0,r=t._deferreds.length;e<r;e++)hN(t,t._deferreds[e]);t._deferreds=null}function fN(t,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=r}function pN(t,e){var r=!1;try{t((function(t){r||(r=!0,cN(e,t))}),(function(t){r||(r=!0,lN(e,t))}))}catch(t){if(r)return;r=!0,lN(e,t)}}uN.prototype.catch=function(t){return this.then(null,t)},uN.prototype.then=function(t,e){var r=new this.constructor(aN);return hN(this,new fN(t,e,r)),r},uN.prototype.finally=function(t){var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){return e.reject(r)}))}))},uN.all=function(t){return new uN((function(e,r){if(!sN(t))return r(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var n=i.length;function o(t,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,(function(e){o(t,e)}),r)}i[t]=s,0==--n&&e(i)}catch(t){r(t)}}for(var s=0;s<i.length;s++)o(s,i[s])}))},uN.allSettled=function(t){return new this((function(e,r){if(!t||void 0===t.length)return r(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var n=i.length;function o(t,r){if(r&&("object"==typeof r||"function"==typeof r)){var s=r.then;if("function"==typeof s)return void s.call(r,(function(e){o(t,e)}),(function(r){i[t]={status:"rejected",reason:r},0==--n&&e(i)}))}i[t]={status:"fulfilled",value:r},0==--n&&e(i)}for(var s=0;s<i.length;s++)o(s,i[s])}))},uN.resolve=function(t){return t&&"object"==typeof t&&t.constructor===uN?t:new uN((function(e){e(t)}))},uN.reject=function(t){return new uN((function(e,r){r(t)}))},uN.race=function(t){return new uN((function(e,r){if(!sN(t))return r(new TypeError("Promise.race accepts an array"));for(var i=0,n=t.length;i<n;i++)uN.resolve(t[i]).then(e,r)}))},uN._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){oN(t,0)},uN._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var mN=Object.getOwnPropertySymbols,vN=Object.prototype.hasOwnProperty,_N=Object.prototype.propertyIsEnumerable;function yN(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var gN=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(t){i[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,i,n=yN(t),o=1;o<arguments.length;o++){for(var s in r=Object(arguments[o]))vN.call(r,s)&&(n[s]=r[s]);if(mN){i=mN(r);for(var a=0;a<i.length;a++)_N.call(r,i[a])&&(n[i[a]]=r[i[a]])}}return n};"undefined"==typeof globalThis&&("undefined"!=typeof self?self.globalThis=self:"undefined"!=typeof global&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=uN),Object.assign||(Object.assign=gN);if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!globalThis.performance||!globalThis.performance.now){var bN=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-bN}}for(var TN=Date.now(),EN=["ms","moz","webkit","o"],xN=0;xN<EN.length&&!globalThis.requestAnimationFrame;++xN){var RN=EN[xN];globalThis.requestAnimationFrame=globalThis[RN+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[RN+"CancelAnimationFrame"]||globalThis[RN+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),r=16+TN-e;return r<0&&(r=0),TN=e,globalThis.self.setTimeout((function(){TN=Date.now(),t(performance.now())}),r)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array);var SN=/iPhone/i,AN=/iPod/i,IN=/iPad/i,CN=/\biOS-universal(?:.+)Mac\b/i,ON=/\bAndroid(?:.+)Mobile\b/i,wN=/Android/i,PN=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,NN=/Silk/i,MN=/Windows Phone/i,DN=/\bWindows(?:.+)ARM\b/i,LN=/BlackBerry/i,UN=/BB10/i,FN=/Opera Mini/i,GN=/\b(CriOS|Chrome)(?:.+)Mobile/i,BN=/Mobile(?:.+)Firefox\b/i,kN=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};var XN,HN,jN,VN,YN,WN,zN,ZN,KN,qN,JN,QN,$N,tM,eM,rM,iM,nM,oM,sM=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,i=r.split("[FBAN");void 0!==i[1]&&(r=i[0]),void 0!==(i=r.split("Twitter"))[1]&&(r=i[0]);var n=function(t){return function(e){return e.test(t)}}(r),o={apple:{phone:n(SN)&&!n(MN),ipod:n(AN),tablet:!n(SN)&&(n(IN)||kN(e))&&!n(MN),universal:n(CN),device:(n(SN)||n(AN)||n(IN)||n(CN)||kN(e))&&!n(MN)},amazon:{phone:n(PN),tablet:!n(PN)&&n(NN),device:n(PN)||n(NN)},android:{phone:!n(MN)&&n(PN)||!n(MN)&&n(ON),tablet:!n(MN)&&!n(PN)&&!n(ON)&&(n(NN)||n(wN)),device:!n(MN)&&(n(PN)||n(NN)||n(ON)||n(wN))||n(/\bokhttp\b/i)},windows:{phone:n(MN),tablet:n(DN),device:n(MN)||n(DN)},other:{blackberry:n(LN),blackberry10:n(UN),opera:n(FN),firefox:n(BN),chrome:n(GN),device:n(LN)||n(UN)||n(FN)||n(BN)||n(GN)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(globalThis.navigator);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(XN||(XN={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(HN||(HN={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(jN||(jN={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(VN||(VN={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(YN||(YN={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(WN||(WN={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(zN||(zN={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(ZN||(ZN={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(KN||(KN={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(qN||(qN={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(JN||(JN={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(QN||(QN={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}($N||($N={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(tM||(tM={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(eM||(eM={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(rM||(rM={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(iM||(iM={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(nM||(nM={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(oM||(oM={}));var aM={MIPMAP_TEXTURES:QN.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:nM.NONE,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(sM.tablet||sM.phone){var r;if(sM.apple.device)if(r=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(r[1],10)<11&&(e=!1);if(sM.android.device)if(r=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(r[1],10)<7&&(e=!1)}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:eM.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:JN.CLAMP,SCALE_MODE:qN.LINEAR,PRECISION_VERTEX:rM.HIGH,PRECISION_FRAGMENT:sM.apple.device?rM.HIGH:rM.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!sM.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},uM={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n<o;n++)s[n]=i[n].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,n,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var u,h,c=this._events[a],l=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,n),!0;case 5:return c.fn.call(c.context,e,i,n,o),!0;case 6:return c.fn.call(c.context,e,i,n,o,s),!0}for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];c.fn.apply(c.context,u)}else{var d,f=c.length;for(h=0;h<f;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),l){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,i);break;case 4:c[h].fn.call(c[h].context,e,i,n);break;default:if(!u)for(d=1,u=new Array(l-1);d<l;d++)u[d-1]=arguments[d];c[h].fn.apply(c[h].context,u)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,i,n){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||n&&!a.once||i&&a.context!==i||s(this,o);else{for(var u=0,h=[],c=a.length;u<c;u++)(a[u].fn!==e||n&&!a[u].once||i&&a[u].context!==i)&&h.push(a[u]);h.length?this._events[o]=1===h.length?h[0]:h:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a}(uM);var hM=uM.exports,cM={exports:{}};function lM(t,e,r){r=r||2;var i,n,o,s,a,u,h,c=e&&e.length,l=c?e[0]*r:t.length,d=dM(t,0,l,r,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(t,e,r,i){var n,o,s,a=[];for(n=0,o=e.length;n<o;n++)(s=dM(t,e[n]*i,n<o-1?e[n+1]*i:t.length,i,!1))===s.next&&(s.steiner=!0),a.push(xM(s));for(a.sort(gM),n=0;n<a.length;n++)r=bM(a[n],r);return r}(t,e,d,r)),t.length>80*r){i=o=t[0],n=s=t[1];for(var p=r;p<l;p+=r)(a=t[p])<i&&(i=a),(u=t[p+1])<n&&(n=u),a>o&&(o=a),u>s&&(s=u);h=0!==(h=Math.max(o-i,s-n))?32767/h:0}return pM(d,f,r,i,n,h,0),f}function dM(t,e,r,i,n){var o,s;if(n===UM(t,e,r,i)>0)for(o=e;o<r;o+=i)s=MM(o,t[o],t[o+1],s);else for(o=r-i;o>=e;o-=i)s=MM(o,t[o],t[o+1],s);return s&&IM(s,s.next)&&(DM(s),s=s.next),s}function fM(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!IM(i,i.next)&&0!==AM(i.prev,i,i.next))i=i.next;else{if(DM(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function pM(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{0===n.z&&(n.z=EM(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,s,a,u,h=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e<h&&(a++,i=i.nextZ);e++);for(u=h;a>0||u>0&&i;)0!==a&&(0===u||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,h*=2}while(s>1)}(n)}(t,i,n,o);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?vM(t,i,n,o):mM(t))e.push(a.i/r|0),e.push(t.i/r|0),e.push(u.i/r|0),DM(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?pM(t=_M(fM(t),e,r),e,r,i,n,o,2):2===s&&yM(t,e,r,i,n,o):pM(fM(t),e,r,i,n,o,1);break}}}function mM(t){var e=t.prev,r=t,i=t.next;if(AM(e,r,i)>=0)return!1;for(var n=e.x,o=r.x,s=i.x,a=e.y,u=r.y,h=i.y,c=n<o?n<s?n:s:o<s?o:s,l=a<u?a<h?a:h:u<h?u:h,d=n>o?n>s?n:s:o>s?o:s,f=a>u?a>h?a:h:u>h?u:h,p=i.next;p!==e;){if(p.x>=c&&p.x<=d&&p.y>=l&&p.y<=f&&RM(n,a,o,u,s,h,p.x,p.y)&&AM(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function vM(t,e,r,i){var n=t.prev,o=t,s=t.next;if(AM(n,o,s)>=0)return!1;for(var a=n.x,u=o.x,h=s.x,c=n.y,l=o.y,d=s.y,f=a<u?a<h?a:h:u<h?u:h,p=c<l?c<d?c:d:l<d?l:d,m=a>u?a>h?a:h:u>h?u:h,v=c>l?c>d?c:d:l>d?l:d,_=EM(f,p,e,r,i),y=EM(m,v,e,r,i),g=t.prevZ,b=t.nextZ;g&&g.z>=_&&b&&b.z<=y;){if(g.x>=f&&g.x<=m&&g.y>=p&&g.y<=v&&g!==n&&g!==s&&RM(a,c,u,l,h,d,g.x,g.y)&&AM(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,b.x>=f&&b.x<=m&&b.y>=p&&b.y<=v&&b!==n&&b!==s&&RM(a,c,u,l,h,d,b.x,b.y)&&AM(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;g&&g.z>=_;){if(g.x>=f&&g.x<=m&&g.y>=p&&g.y<=v&&g!==n&&g!==s&&RM(a,c,u,l,h,d,g.x,g.y)&&AM(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;b&&b.z<=y;){if(b.x>=f&&b.x<=m&&b.y>=p&&b.y<=v&&b!==n&&b!==s&&RM(a,c,u,l,h,d,b.x,b.y)&&AM(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function _M(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!IM(n,o)&&CM(n,i,i.next,o)&&PM(n,o)&&PM(o,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(o.i/r|0),DM(i),DM(i.next),i=t=o),i=i.next}while(i!==t);return fM(i)}function yM(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&SM(s,a)){var u=NM(s,a);return s=fM(s,s.next),u=fM(u,u.next),pM(s,e,r,i,n,o,0),void pM(u,e,r,i,n,o,0)}a=a.next}s=s.next}while(s!==t)}function gM(t,e){return t.x-e.x}function bM(t,e){var r=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s&&(s=a,r=i.x<i.next.x?i:i.next,a===n))return r}i=i.next}while(i!==e);if(!r)return null;var u,h=r,c=r.x,l=r.y,d=1/0;i=r;do{n>=i.x&&i.x>=c&&n!==i.x&&RM(o<l?n:s,o,c,l,o<l?s:n,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(n-i.x),PM(i,t)&&(u<d||u===d&&(i.x>r.x||i.x===r.x&&TM(r,i)))&&(r=i,d=u)),i=i.next}while(i!==h);return r}(t,e);if(!r)return e;var i=NM(r,t);return fM(i,i.next),fM(r,r.next)}function TM(t,e){return AM(t.prev,t,e.prev)<0&&AM(e.next,t,t.next)<0}function EM(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function xM(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function RM(t,e,r,i,n,o,s,a){return(n-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(r-s)*(e-a)&&(r-s)*(o-a)>=(n-s)*(i-a)}function SM(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&CM(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(PM(t,e)&&PM(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(AM(t.prev,t,e.prev)||AM(t,e.prev,e))||IM(t,e)&&AM(t.prev,t,t.next)>0&&AM(e.prev,e,e.next)>0)}function AM(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function IM(t,e){return t.x===e.x&&t.y===e.y}function CM(t,e,r,i){var n=wM(AM(t,e,r)),o=wM(AM(t,e,i)),s=wM(AM(r,i,t)),a=wM(AM(r,i,e));return n!==o&&s!==a||(!(0!==n||!OM(t,r,e))||(!(0!==o||!OM(t,i,e))||(!(0!==s||!OM(r,t,i))||!(0!==a||!OM(r,e,i)))))}function OM(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function wM(t){return t>0?1:t<0?-1:0}function PM(t,e){return AM(t.prev,t,t.next)<0?AM(t,e,t.next)>=0&&AM(t,t.prev,e)>=0:AM(t,e,t.prev)<0||AM(t,t.next,e)<0}function NM(t,e){var r=new LM(t.i,t.x,t.y),i=new LM(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function MM(t,e,r,i){var n=new LM(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function DM(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function LM(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function UM(t,e,r,i){for(var n=0,o=e,s=r-i;o<r;o+=i)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}cM.exports=lM,cM.exports.default=lM,lM.deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,s=Math.abs(UM(t,0,o,r));if(n)for(var a=0,u=e.length;a<u;a++){var h=e[a]*r,c=a<u-1?e[a+1]*r:t.length;s-=Math.abs(UM(t,h,c,r))}var l=0;for(a=0;a<i.length;a+=3){var d=i[a]*r,f=i[a+1]*r,p=i[a+2]*r;l+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===s&&0===l?0:Math.abs((l-s)/s)},lM.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var s=0;s<e;s++)r.vertices.push(t[n][o][s]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r};var FM=cM.exports,GM={exports:{}};!function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,u,h=2147483647,c=36,l=/^xn--/,d=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,v=String.fromCharCode;function _(t){throw RangeError(p[t])}function y(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function g(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+y((t=t.replace(f,".")).split("."),e).join(".")}function b(t){for(var e,r,i=[],n=0,o=t.length;n<o;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<o?56320==(64512&(r=t.charCodeAt(n++)))?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--):i.push(e);return i}function T(t){return y(t,(function(t){var e="";return t>65535&&(e+=v((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=v(t)})).join("")}function E(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,r){var i=0;for(t=r?m(t/700):t>>1,t+=m(t/e);t>455;i+=c)t=m(t/35);return m(i+36*t/(t+38))}function R(t){var e,r,i,n,o,s,a,u,l,d,f,p=[],v=t.length,y=0,g=128,b=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i<r;++i)t.charCodeAt(i)>=128&&_("not-basic"),p.push(t.charCodeAt(i));for(n=r>0?r+1:0;n<v;){for(o=y,s=1,a=c;n>=v&&_("invalid-input"),((u=(f=t.charCodeAt(n++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:c)>=c||u>m((h-y)/s))&&_("overflow"),y+=u*s,!(u<(l=a<=b?1:a>=b+26?26:a-b));a+=c)s>m(h/(d=c-l))&&_("overflow"),s*=d;b=x(y-o,e=p.length+1,0==o),m(y/e)>h-g&&_("overflow"),g+=m(y/e),y%=e,p.splice(y++,0,g)}return T(p)}function S(t){var e,r,i,n,o,s,a,u,l,d,f,p,y,g,T,R=[];for(p=(t=b(t)).length,e=128,r=0,o=72,s=0;s<p;++s)(f=t[s])<128&&R.push(v(f));for(i=n=R.length,n&&R.push("-");i<p;){for(a=h,s=0;s<p;++s)(f=t[s])>=e&&f<a&&(a=f);for(a-e>m((h-r)/(y=i+1))&&_("overflow"),r+=(a-e)*y,e=a,s=0;s<p;++s)if((f=t[s])<e&&++r>h&&_("overflow"),f==e){for(u=r,l=c;!(u<(d=l<=o?1:l>=o+26?26:l-o));l+=c)T=u-d,g=c-d,R.push(v(E(d+T%g,0))),u=m(T/g);R.push(v(E(u,0))),o=x(r,y,i==n),r=0,++i}++r,++e}return R.join("")}if(a={version:"1.3.2",ucs2:{decode:b,encode:T},decode:R,encode:S,toASCII:function(t){return g(t,(function(t){return d.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return g(t,(function(t){return l.test(t)?R(t.slice(4).toLowerCase()):t}))}},n&&o)if(t.exports==n)o.exports=a;else for(u in a)a.hasOwnProperty(u)&&(n[u]=a[u]);else i.punycode=a}(e)}(GM,GM.exports);var BM={};function kM(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var XM=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};BM.decode=BM.parse=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var u=0;u<a;++u){var h,c,l,d,f=t[u].replace(o,"%20"),p=f.indexOf(r);p>=0?(h=f.substr(0,p),c=f.substr(p+1)):(h=f,c=""),l=decodeURIComponent(h),d=decodeURIComponent(c),kM(n,l)?Array.isArray(n[l])?n[l].push(d):n[l]=[n[l],d]:n[l]=d}return n},BM.encode=BM.stringify=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(XM(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(XM(t))})).join(e):n+encodeURIComponent(XM(t[i]))})).join(e):i?encodeURIComponent(XM(i))+r+encodeURIComponent(XM(t)):""};var HM=GM.exports,jM={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}},VM=AD,YM=function(t,e){return AD(t,!1,!0).resolve(e)},WM=function(t){jM.isString(t)&&(t=AD(t));return t instanceof zM?t.format():zM.prototype.format.call(t)};function zM(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var ZM,KM,qM,JM,QM,$M,tD,eD,rD,iD,nD,oD,sD,aD,uD,hD,cD,lD,dD,fD=/^([a-z0-9.+-]+:)/i,pD=/:[0-9]*$/,mD=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,vD=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),_D=["'"].concat(vD),yD=["%","/","?",";","#"].concat(_D),gD=["/","?","#"],bD=/^[+a-z0-9A-Z_-]{0,63}$/,TD=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ED={javascript:!0,"javascript:":!0},xD={javascript:!0,"javascript:":!0},RD={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},SD=BM;function AD(t,e,r){if(t&&jM.isObject(t)&&t instanceof zM)return t;var i=new zM;return i.parse(t,e,r),i}zM.prototype.parse=function(t,e,r){if(!jM.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(n);if(s=s.trim(),!r&&1===t.split("#").length){var a=mD.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?SD.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=fD.exec(s);if(u){var h=(u=u[0]).toLowerCase();this.protocol=h,s=s.substr(u.length)}if(r||u||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===s.substr(0,2);!c||u&&xD[u]||(s=s.substr(2),this.slashes=!0)}if(!xD[u]&&(c||u&&!RD[u])){for(var l,d,f=-1,p=0;p<gD.length;p++){-1!==(m=s.indexOf(gD[p]))&&(-1===f||m<f)&&(f=m)}-1!==(d=-1===f?s.lastIndexOf("@"):s.lastIndexOf("@",f))&&(l=s.slice(0,d),s=s.slice(d+1),this.auth=decodeURIComponent(l)),f=-1;for(p=0;p<yD.length;p++){var m;-1!==(m=s.indexOf(yD[p]))&&(-1===f||m<f)&&(f=m)}-1===f&&(f=s.length),this.host=s.slice(0,f),s=s.slice(f),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var _=this.hostname.split(/\./),y=(p=0,_.length);p<y;p++){var g=_[p];if(g&&!g.match(bD)){for(var b="",T=0,E=g.length;T<E;T++)g.charCodeAt(T)>127?b+="x":b+=g[T];if(!b.match(bD)){var x=_.slice(0,p),R=_.slice(p+1),S=g.match(TD);S&&(x.push(S[1]),R.unshift(S[2])),R.length&&(s="/"+R.join(".")+s),this.hostname=x.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=HM.toASCII(this.hostname));var A=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+A,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!ED[h])for(p=0,y=_D.length;p<y;p++){var C=_D[p];if(-1!==s.indexOf(C)){var O=encodeURIComponent(C);O===C&&(O=escape(C)),s=s.split(C).join(O)}}var w=s.indexOf("#");-1!==w&&(this.hash=s.substr(w),s=s.slice(0,w));var P=s.indexOf("?");if(-1!==P?(this.search=s.substr(P),this.query=s.substr(P+1),e&&(this.query=SD.parse(this.query)),s=s.slice(0,P)):e&&(this.search="",this.query={}),s&&(this.pathname=s),RD[h]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){A=this.pathname||"";var N=this.search||"";this.path=A+N}return this.href=this.format(),this},zM.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&jM.isObject(this.query)&&Object.keys(this.query).length&&(o=SD.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||RD[e])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})),e+n+r+(s=s.replace("#","%23"))+i},zM.prototype.resolve=function(t){return this.resolveObject(AD(t,!1,!0)).format()},zM.prototype.resolveObject=function(t){if(jM.isString(t)){var e=new zM;e.parse(t,!1,!0),t=e}for(var r=new zM,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var u=s[a];"protocol"!==u&&(r[u]=t[u])}return RD[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!RD[t.protocol]){for(var h=Object.keys(t),c=0;c<h.length;c++){var l=h[c];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||xD[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var f=r.pathname||"",p=r.search||"";r.path=f+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var m=r.pathname&&"/"===r.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),_=v||m||r.host&&t.pathname,y=_,g=r.pathname&&r.pathname.split("/")||[],b=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!RD[r.protocol]);if(b&&(r.hostname="",r.port=null,r.host&&(""===g[0]?g[0]=r.host:g.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),_=_&&(""===d[0]||""===g[0])),v)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,g=d;else if(d.length)g||(g=[]),g.pop(),g=g.concat(d),r.search=t.search,r.query=t.query;else if(!jM.isNullOrUndefined(t.search)){if(b)r.hostname=r.host=g.shift(),(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,jM.isNull(r.pathname)&&jM.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=g.slice(-1)[0],E=(r.host||t.host||g.length>1)&&("."===T||".."===T)||""===T,x=0,R=g.length;R>=0;R--)"."===(T=g[R])?g.splice(R,1):".."===T?(g.splice(R,1),x++):x&&(g.splice(R,1),x--);if(!_&&!y)for(;x--;x)g.unshift("..");!_||""===g[0]||g[0]&&"/"===g[0].charAt(0)||g.unshift(""),E&&"/"!==g.join("/").substr(-1)&&g.push("");var S,A=""===g[0]||g[0]&&"/"===g[0].charAt(0);b&&(r.hostname=r.host=A?"":g.length?g.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(_=_||r.host&&g.length)&&!A&&g.unshift(""),g.length?r.pathname=g.join("/"):(r.pathname=null,r.path=null),jM.isNull(r.pathname)&&jM.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},zM.prototype.parseHost=function(){var t=this.host,e=pD.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(ZM||(ZM={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(KM||(KM={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(qM||(qM={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(JM||(JM={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(QM||(QM={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}($M||($M={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(tD||(tD={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(eD||(eD={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(rD||(rD={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(iD||(iD={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(nD||(nD={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(oD||(oD={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(sD||(sD={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(aD||(aD={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(uD||(uD={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(hD||(hD={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(cD||(cD={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(lD||(lD={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(dD||(dD={}));var ID={parse:VM,format:WM,resolve:YM};aM.RETINA_PREFIX=/@([0-9\.]+)x/,aM.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var CD,OD=!1;function wD(t){var e;if(!OD){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS 6.4.2 - ✰ "+t+" ✰  %c  %c  http://www.pixijs.com/  %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+t+" - http://www.pixijs.com/");OD=!0}}var PD={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function ND(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function MD(t){var e=t.toString(16);return"#"+(e="000000".substring(0,6-e.length)+e)}function DD(t){return"string"==typeof t&&"#"===(t=PD[t.toLowerCase()]||t)[0]&&(t=t.slice(1)),parseInt(t,16)}function LD(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var UD=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[JM.NORMAL_NPM]=JM.NORMAL,t[JM.ADD_NPM]=JM.ADD,t[JM.SCREEN_NPM]=JM.SCREEN,e[JM.NORMAL]=JM.NORMAL_NPM,e[JM.ADD]=JM.ADD_NPM,e[JM.SCREEN]=JM.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function FD(t,e){return UD[e?1:0][t]}function GD(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function BD(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function kD(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}function XD(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function HD(t){return!(t&t-1||!t)}function jD(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}function VD(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i<o;++i)t[i]=t[i+r];t.length=o}}function YD(t){return 0===t?0:t<0?-1:1}var WD=0;function zD(){return++WD}var ZD={};function KD(t,e,r){if(void 0===r&&(r=3),!ZD[e]){var i=(new Error).stack;void 0===i?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(i=i.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(i))),ZD[e]=!0}}var qD,JD={},QD=Object.create(null),$D=Object.create(null),tL=function(){function t(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||aM.RESOLUTION,this.resize(t,e)}return t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),t}();function eL(t,e){var r=aM.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1}var rL,iL=2*Math.PI,nL=180/Math.PI,oL=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(rL||(rL={}));var sL=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},t}(),aL=[new sL,new sL,new sL,new sL],uL=function(){function t(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=rL.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},t.prototype.intersects=function(t,e){if(!e){var r=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=r)return!1;var i=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>i}var n=this.left,o=this.right,s=this.top,a=this.bottom;if(o<=n||a<=s)return!1;var u=aL[0].set(t.left,t.top),h=aL[1].set(t.left,t.bottom),c=aL[2].set(t.right,t.top),l=aL[3].set(t.right,t.bottom);if(c.x<=u.x||h.y<=u.y)return!1;var d=Math.sign(e.a*e.d-e.b*e.c);if(0===d)return!1;if(e.apply(u,u),e.apply(h,h),e.apply(c,c),e.apply(l,l),Math.max(u.x,h.x,c.x,l.x)<=n||Math.min(u.x,h.x,c.x,l.x)>=o||Math.max(u.y,h.y,c.y,l.y)<=s||Math.min(u.y,h.y,c.y,l.y)>=a)return!1;var f=d*(h.y-u.y),p=d*(u.x-h.x),m=f*n+p*s,v=f*o+p*s,_=f*n+p*a,y=f*o+p*a;if(Math.max(m,v,_,y)<=f*u.x+p*u.y||Math.min(m,v,_,y)>=f*l.x+p*l.y)return!1;var g=d*(u.y-c.y),b=d*(c.x-u.x),T=g*n+b*s,E=g*o+b*s,x=g*n+b*a,R=g*o+b*a;return!(Math.max(T,E,x,R)<=g*u.x+b*u.y||Math.min(T,E,x,R)>=g*l.x+b*l.y)},t.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(n-i,0),this},t.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=n-i,this},t.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),hL=function(){function t(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),this.x=t,this.y=e,this.radius=r,this.type=rL.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,i=this.x-t,n=this.y-e;return(i*=i)+(n*=n)<=r},t.prototype.getBounds=function(){return new uL(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},t}(),cL=function(){function t(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=t,this.y=e,this.width=r,this.height=i,this.type=rL.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return(r*=r)+(i*=i)<=1},t.prototype.getBounds=function(){return new uL(this.x-this.width,this.y-this.height,this.width,this.height)},t.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),lL=function(){function t(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];var i=Array.isArray(e[0])?e[0]:e;if("number"!=typeof i[0]){for(var n=[],o=0,s=i.length;o<s;o++)n.push(i[o].x,i[o].y);i=n}this.points=i,this.type=rL.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;n<i;o=n++){var s=this.points[2*n],a=this.points[2*n+1],u=this.points[2*o],h=this.points[2*o+1];a>e!=h>e&&t<(e-a)/(h-a)*(u-s)+s&&(r=!r)}return r},t.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(t,e){return t+", "+e}),"")+"]"},t}(),dL=function(){function t(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=rL.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;var i=t-(this.x+r),n=e-(this.y+r),o=r*r;if(i*i+n*n<=o)return!0;if((i=t-(this.x+this.width-r))*i+n*n<=o)return!0;if(i*i+(n=e-(this.y+this.height-r))*n<=o)return!0;if((i=t-(this.x+r))*i+n*n<=o)return!0}return!1},t.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},t}(),fL=function(){function t(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),this._x=r,this._y=i,this.cb=t,this.scope=e}return t.prototype.clone=function(e,r){return void 0===e&&(e=this.cb),void 0===r&&(r=this.scope),new t(e,r,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},t.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),pL=function(){function t(t,e,r,i,n,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},t.prototype.apply=function(t,e){e=e||new sL;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new sL;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,n=t.y;return e.x=this.d*r*i+-this.c*r*n+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*n+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},t.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},t.prototype.setTransform=function(t,e,r,i,n,o,s,a,u){return this.a=Math.cos(s+u)*n,this.b=Math.sin(s+u)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=t.pivot,s=-Math.atan2(-i,n),a=Math.atan2(r,e),u=Math.abs(s+a);return u<1e-5||Math.abs(iL-u)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*r+o.y*n),t},t.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),mL=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],vL=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],_L=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],yL=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],gL=[],bL=[],TL=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];gL.push(e);for(var r=0;r<16;r++)for(var i=TL(mL[t]*mL[r]+_L[t]*vL[r]),n=TL(vL[t]*mL[r]+yL[t]*vL[r]),o=TL(mL[t]*_L[r]+_L[t]*yL[r]),s=TL(vL[t]*_L[r]+yL[t]*yL[r]),a=0;a<16;a++)if(mL[a]===i&&vL[a]===n&&_L[a]===o&&yL[a]===s){e.push(a);break}}for(t=0;t<16;t++){var u=new pL;u.set(mL[t],vL[t],_L[t],yL[t],0,0),bL.push(u)}}();var EL={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return mL[t]},uY:function(t){return vL[t]},vX:function(t){return _L[t]},vY:function(t){return yL[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return gL[t][e]},sub:function(t,e){return gL[t][EL.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?EL.S:EL.N:2*Math.abs(e)<=Math.abs(t)?t>0?EL.E:EL.W:e>0?t>0?EL.SE:EL.SW:t>0?EL.NE:EL.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=bL[EL.inv(e)];n.tx=r,n.ty=i,t.append(n)}},xL=function(){function t(){this.worldTransform=new pL,this.localTransform=new pL,this.position=new fL(this.onChange,this,0,0),this.scale=new fL(this.onChange,this,1,1),this.pivot=new fL(this.onChange,this,0,0),this.skew=new fL(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();aM.SORTABLE_CHILDREN=!1;var RL=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?uL.EMPTY:((t=t||new uL(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,e){var r=t.a,i=t.b,n=t.c,o=t.d,s=t.tx,a=t.ty,u=r*e.x+n*e.y+s,h=i*e.x+o*e.y+a;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)},t.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=o<e?o:e,r=s<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[2])<e?o:e,r=(s=t[3])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[4])<e?o:e,r=(s=t[5])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[6])<e?o:e,r=(s=t[7])<r?s:r,i=o>i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},t.prototype.addFrame=function(t,e,r,i,n){this.addFrameMatrix(t.worldTransform,e,r,i,n)},t.prototype.addFrameMatrix=function(t,e,r,i,n){var o=t.a,s=t.b,a=t.c,u=t.d,h=t.tx,c=t.ty,l=this.minX,d=this.minY,f=this.maxX,p=this.maxY,m=o*e+a*r+h,v=s*e+u*r+c;l=m<l?m:l,d=v<d?v:d,f=m>f?m:f,p=v>p?v:p,l=(m=o*i+a*r+h)<l?m:l,d=(v=s*i+u*r+c)<d?v:d,f=m>f?m:f,p=v>p?v:p,l=(m=o*e+a*n+h)<l?m:l,d=(v=s*e+u*n+c)<d?v:d,f=m>f?m:f,p=v>p?v:p,l=(m=o*i+a*n+h)<l?m:l,d=(v=s*i+u*n+c)<d?v:d,f=m>f?m:f,p=v>p?v:p,this.minX=l,this.minY=d,this.maxX=f,this.maxY=p},t.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;a<r;a+=2){var u=t[a],h=t[a+1];i=u<i?u:i,n=h<n?h:n,o=u>o?u:o,s=h>s?h:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},t.prototype.addVertices=function(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)},t.prototype.addVerticesMatrix=function(t,e,r,i,n,o){void 0===n&&(n=0),void 0===o&&(o=n);for(var s=t.a,a=t.b,u=t.c,h=t.d,c=t.tx,l=t.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,v=r;v<i;v+=2){var _=e[v],y=e[v+1],g=s*_+u*y+c,b=h*y+a*_+l;d=Math.min(d,g-n),p=Math.max(p,g+n),f=Math.min(f,b-o),m=Math.max(m,b+o)}this.minX=d,this.minY=f,this.maxX=p,this.maxY=m},t.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<r?t.minY:r,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},t.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=n&&i<=o){var s=this.minX,a=this.minY,u=this.maxX,h=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>u?n:u,this.maxY=o>h?o:h}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=n&&i<=o){var s=this.minX,a=this.minY,u=this.maxX,h=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>u?n:u,this.maxY=o>h?o:h}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,r,i,n,o){t-=n,e-=o,r+=n,i+=o,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>r?this.maxX:r,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>i?this.maxY:i},t}(),SL=function(t,e){return SL=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},SL(t,e)};function AL(t,e){function r(){this.constructor=t}SL(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var IL,CL,OL,wL,PL,NL,ML,DL,LL,UL,FL,GL,BL,kL,XL,HL,jL,VL,YL,WL=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new xL,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new RL,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return AL(e,t),e.mixin=function(t){for(var r=Object.keys(t),i=0;i<r.length;++i){var n=r[i];Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t,n))}},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new uL),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new uL),t=this._localBoundsRect),this._localBounds||(this._localBounds=new RL);var e=this.transform,r=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var i=this._bounds,n=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=r,this.transform=e,this._bounds=i,this._bounds.updateID+=this._boundsID-n,o},e.prototype.toGlobal=function(t,e,r){return void 0===r&&(r=!1),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,r,i){return e&&(t=e.toGlobal(t,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,r,i,n,o,s,a,u){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===u&&(u=0),this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=n,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=u,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new zL),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*nL},set:function(t){this.transform.rotation=t*oL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){if(this._mask!==t){var e;if(this._mask)(e=this._mask.maskObject||this._mask)._maskRefCount--,0===e._maskRefCount&&(e.renderable=!0,e.isMask=!1);if(this._mask=t,this._mask)0===(e=this._mask.maskObject||this._mask)._maskRefCount&&(e.renderable=!1,e.isMask=!0),e._maskRefCount++}},enumerable:!1,configurable:!0}),e}(hM),zL=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return AL(e,t),e}(WL);function ZL(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}WL.prototype.displayObjectUpdateTransform=WL.prototype.updateTransform,function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(IL||(IL={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(CL||(CL={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(OL||(OL={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(wL||(wL={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(PL||(PL={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(NL||(NL={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(ML||(ML={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(DL||(DL={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(LL||(LL={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(UL||(UL={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(FL||(FL={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(GL||(GL={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(BL||(BL={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(kL||(kL={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(XL||(XL={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(HL||(HL={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(jL||(jL={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(VL||(VL={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(YL||(YL={}));var KL=function(t){function e(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=aM.SORTABLE_CHILDREN,e.sortDirty=!1,e}return AL(e,t),e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var i=0;i<e.length;i++)this.addChild(e[i]);else{var n=e[0];n.parent&&n.parent.removeChild(n),n.parent=this,this.sortDirty=!0,n.transform._parentID=-1,this.children.push(n),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this)}return e[0]},e.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}},e.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);VD(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var i=0;i<e.length;i++)this.removeChild(e[i]);else{var n=e[0],o=this.children.indexOf(n);if(-1===o)return null;n.parent=null,n.transform._parentID=-1,VD(this.children,o,1),this._boundsID++,this.onChildrenChange(o),n.emit("removed",this),this.emit("childRemoved",n,this,o)}return e[0]},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,VD(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var r,i=t,n=e-i;if(n>0&&n<=e){r=this.children.splice(i,n);for(var o=0;o<r.length;++o)r[o].parent=null,r[o].transform&&(r[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(o=0;o<r.length;++o)r[o].emit("removed",this),this.emit("childRemoved",r[o],this,o);return r}if(0===n&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,r=this.children.length;e<r;++e){var i=this.children[e];i._lastSortedIndex=e,t||0===i.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(ZL),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var r=this.children[t];r.visible&&r.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var r=e._mask.maskObject||e._mask;r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(e,r){void 0===r&&(r=!1);var i=t.prototype.getLocalBounds.call(this,e);if(!r)for(var n=0,o=this.children.length;n<o;++n){var s=this.children[n];s.visible&&s.updateTransform()}return i},e.prototype._calculateBounds=function(){},e.prototype._renderWithCulling=function(t){var r=t.renderTexture.sourceFrame;if(r.width>0&&r.height>0){var i,n;if(this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==e.prototype._render&&(i=this.getBounds(!0)),i&&r.intersects(i,n))this._render(t);else if(this.cullArea)return;for(var o=0,s=this.children.length;o<s;++o){var a=this.children[o],u=a.cullable;a.cullable=u||!this.cullArea,a.render(t),a.cullable=u}}},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){var e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var i=0;i<e.length;i++)e[i].enabled&&this._enabledFilters.push(e[i])}var n=e&&this._enabledFilters&&this._enabledFilters.length||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==jL.NONE));if(n&&t.batch.flush(),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);i=0;for(var o=this.children.length;i<o;++i)this.children[i].render(t)}n&&t.batch.flush(),r&&t.mask.pop(this),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var r="boolean"==typeof e?e:e&&e.children,i=this.removeChildren(0,this.children.length);if(r)for(var n=0;n<i.length;++n)i[n].destroy(e)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},enumerable:!1,configurable:!0}),e}(WL);KL.prototype.containerUpdateTransform=KL.prototype.updateTransform;WL.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var qL,JL=function(){function t(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(sM.tablet||sM.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),t.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2..toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",(function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e},t.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},t.prototype.activate=function(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(t=this.renderer.view.parentNode)||void 0===t||t.appendChild(this.div))},t.prototype.deactivate=function(){var t;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(t=this.div.parentNode)||void 0===t||t.removeChild(this.div))},t.prototype.updateAccessibleObjects=function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);var e=t.children;if(e)for(var r=0;r<e.length;r++)this.updateAccessibleObjects(e[r])}},t.prototype.update=function(){var t=performance.now();if(!(sM.android.device&&t<this.androidUpdateCount)&&(this.androidUpdateCount=t+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),r=e.left,i=e.top,n=e.width,o=e.height,s=this.renderer,a=s.width,u=s.height,h=s.resolution,c=n/a*h,l=o/u*h,d=this.div;d.style.left=r+"px",d.style.top=i+"px",d.style.width=a+"px",d.style.height=u+"px";for(var f=0;f<this.children.length;f++){var p=this.children[f];if(p.renderId!==this.renderId)p._accessibleActive=!1,VD(this.children,f,1),this.div.removeChild(p._accessibleDiv),this.pool.push(p._accessibleDiv),p._accessibleDiv=null,f--;else{d=p._accessibleDiv;var m=p.hitArea,v=p.worldTransform;p.hitArea?(d.style.left=(v.tx+m.x*v.a)*c+"px",d.style.top=(v.ty+m.y*v.d)*l+"px",d.style.width=m.width*v.a*c+"px",d.style.height=m.height*v.d*l+"px"):(m=p.getBounds(),this.capHitArea(m),d.style.left=m.x*c+"px",d.style.top=m.y*l+"px",d.style.width=m.width*c+"px",d.style.height=m.height*l+"px",d.title!==p.accessibleTitle&&null!==p.accessibleTitle&&(d.title=p.accessibleTitle),d.getAttribute("aria-label")!==p.accessibleHint&&null!==p.accessibleHint&&d.setAttribute("aria-label",p.accessibleHint)),p.accessibleTitle===d.title&&p.tabIndex===d.tabIndex||(d.title=p.accessibleTitle,d.tabIndex=p.tabIndex,this.debug&&this.updateDebugHTML(d))}}this.renderId++}},t.prototype.updateDebugHTML=function(t){t.innerHTML="type: "+t.type+"</br> title : "+t.title+"</br> tabIndex: "+t.tabIndex},t.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,r=e.width,i=e.height;t.x+t.width>r&&(t.width=r-t.x),t.y+t.height>i&&(t.height=i-t.y)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"click",i),e.dispatchEvent(r,"pointertap",i),e.dispatchEvent(r,"tap",i)},t.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"mouseover",i)},t.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"mouseout",i)},t.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},t.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t}();aM.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(qL||(qL={}));var QL=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),$L=function(){function t(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new QL(null,null,1/0),this.deltaMS=1/aM.TARGET_FPMS,this.elapsedMS=1/aM.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,r){return void 0===r&&(r=qL.NORMAL),this._addListener(new QL(t,e,r))},t.prototype.addOnce=function(t,e,r){return void 0===r&&(r=qL.NORMAL),this._addListener(new QL(t,e,r,!0))},t.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r<this._minElapsedMS)return;this._lastFrame=t-r%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*aM.TARGET_FPMS;for(var i=this._head,n=i.next;n;)n=n.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,aM.TARGET_FPMS);this._maxElapsedMS=1/r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared},enumerable:!1,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system},enumerable:!1,configurable:!0}),t}(),tU=function(){function t(){}return t.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,qL.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?$L.shared:new $L,t.autoStart&&this.start()},t.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t}(),eU=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new sL,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)},t.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}(),rU=function(t,e){return rU=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},rU(t,e)};var iU=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),nU=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return 0!=(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return 0!=(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return 0!=(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),oU=function(){function t(){this._tempPoint=new sL}return t.prototype.recursiveFindHit=function(t,e,r,i,n){if(!e||!e.visible)return!1;var o=t.data.global,s=!1,a=n=e.interactive||n,u=!0;if(e.hitArea?(i&&(e.worldTransform.applyInverse(o,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?s=!0:(i=!1,u=!1)),a=!1):e._mask&&i&&(e._mask.containsPoint&&e._mask.containsPoint(o)||(i=!1)),u&&e.interactiveChildren&&e.children)for(var h=e.children,c=h.length-1;c>=0;c--){var l=h[c],d=this.recursiveFindHit(t,l,r,i,a);if(d){if(!l.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},t.prototype.findHit=function(t,e,r,i){this.recursiveFindHit(t,e,r,i,!1)},t}(),sU={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};WL.mixin(sU);var aU={target:null,data:{global:null}},uU=function(t){function e(e,r){var i=t.call(this)||this;return r=r||{},i.renderer=e,i.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,i.interactionFrequency=r.interactionFrequency||10,i.mouse=new eU,i.mouse.identifier=1,i.mouse.global.set(-999999),i.activeInteractionData={},i.activeInteractionData[1]=i.mouse,i.interactionDataPool=[],i.eventData=new iU,i.interactionDOMElement=null,i.moveWhenInside=!1,i.eventsAdded=!1,i.tickerAdded=!1,i.mouseOverRenderer=!("PointerEvent"in globalThis),i.supportsTouchEvents="ontouchstart"in globalThis,i.supportsPointerEvents=!!globalThis.PointerEvent,i.onPointerUp=i.onPointerUp.bind(i),i.processPointerUp=i.processPointerUp.bind(i),i.onPointerCancel=i.onPointerCancel.bind(i),i.processPointerCancel=i.processPointerCancel.bind(i),i.onPointerDown=i.onPointerDown.bind(i),i.processPointerDown=i.processPointerDown.bind(i),i.onPointerMove=i.onPointerMove.bind(i),i.processPointerMove=i.processPointerMove.bind(i),i.onPointerOut=i.onPointerOut.bind(i),i.processPointerOverOut=i.processPointerOverOut.bind(i),i.onPointerOver=i.onPointerOver.bind(i),i.cursorStyles={default:"inherit",pointer:"pointer"},i.currentCursorMode=null,i.cursor=null,i.resolution=1,i.delayedEvents=[],i.search=new oU,i._tempDisplayObject=new zL,i._eventListenerOptions={capture:!0,passive:!1},i._useSystemTicker=void 0===r.useSystemTicker||r.useSystemTicker,i.setTargetElement(i.renderer.view,i.renderer.resolution),i}return function(t,e){function r(){this.constructor=t}rU(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,e){return aU.target=null,aU.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(aU,e,null,!0),aU.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&($L.system.add(this.tickerUpdate,this,qL.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&($L.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement)if(this._didMove)this._didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var e=this.activeInteractionData[t];if(e.originalEvent&&"touch"!==e.pointerType){var r=this.configureInteractionEventForDOMEvent(this.eventData,e.originalEvent,e);this.processInteractive(r,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){t=t||"default";var e=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(e=!1),this.currentCursorMode!==t){this.currentCursorMode=t;var r=this.cursorStyles[t];if(r)switch(typeof r){case"string":e&&(this.interactionDOMElement.style.cursor=r);break;case"function":r(t);break;case"object":e&&Object.assign(this.interactionDOMElement.style,r)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,e,r){r.stopPropagationHint&&t!==r.stopsPropagatingAt||(r.currentTarget=t,r.type=e,t.emit(e,r),t[e]&&t[e](r))},e.prototype.delayDispatchEvent=function(t,e,r){this.delayedEvents.push({displayObject:t,eventString:e,eventData:r})},e.prototype.mapPositionToPoint=function(t,e,r){var i;i=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var n=1/this.resolution;t.x=(e-i.left)*(this.interactionDOMElement.width/i.width)*n,t.y=(r-i.top)*(this.interactionDOMElement.height/i.height)*n},e.prototype.processInteractive=function(t,e,r,i){var n=this.search.findHit(t,e,r,i),o=this.delayedEvents;if(!o.length)return n;t.stopPropagationHint=!1;var s=o.length;this.delayedEvents=[];for(var a=0;a<s;a++){var u=o[a],h=u.displayObject,c=u.eventString,l=u.eventData;l.stopsPropagatingAt===h&&(l.stopPropagationHint=!0),this.dispatchEvent(h,c,l)}return n},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);if(s.data.originalEvent=t,this.processInteractive(s,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",s),"touch"===n.pointerType)this.emit("touchstart",s);else if("mouse"===n.pointerType||"pen"===n.pointerType){var a=2===n.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,e,r){var i=t.data,n=t.data.identifier;if(r)if(e.trackedPointers[n]||(e.trackedPointers[n]=new nU(n)),this.dispatchEvent(e,"pointerdown",t),"touch"===i.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;o?e.trackedPointers[n].rightDown=!0:e.trackedPointers[n].leftDown=!0,this.dispatchEvent(e,o?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,r){for(var i=this.normalizeToPointerData(t),n=i.length,o=t.target!==this.interactionDOMElement?"outside":"",s=0;s<n;s++){var a=i[s],u=this.getInteractionDataForPointerId(a),h=this.configureInteractionEventForDOMEvent(this.eventData,a,u);if(h.data.originalEvent=t,this.processInteractive(h,this.lastObjectRendered,r,e||!o),this.emit(e?"pointercancel":"pointerup"+o,h),"mouse"===a.pointerType||"pen"===a.pointerType){var c=2===a.button;this.emit(c?"rightup"+o:"mouseup"+o,h)}else"touch"===a.pointerType&&(this.emit(e?"touchcancel":"touchend"+o,h),this.releaseInteractionDataForPointerId(a.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,e){var r=t.data,i=t.data.identifier;void 0!==e.trackedPointers[i]&&(delete e.trackedPointers[i],this.dispatchEvent(e,"pointercancel",t),"touch"===r.pointerType&&this.dispatchEvent(e,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,e,r){var i=t.data,n=t.data.identifier,o=e.trackedPointers[n],s="touch"===i.pointerType,a="mouse"===i.pointerType||"pen"===i.pointerType,u=!1;if(a){var h=2===i.button,c=nU.FLAGS,l=h?c.RIGHT_DOWN:c.LEFT_DOWN,d=void 0!==o&&o.flags&l;r?(this.dispatchEvent(e,h?"rightup":"mouseup",t),d&&(this.dispatchEvent(e,h?"rightclick":"click",t),u=!0)):d&&this.dispatchEvent(e,h?"rightupoutside":"mouseupoutside",t),o&&(h?o.rightDown=!1:o.leftDown=!1)}r?(this.dispatchEvent(e,"pointerup",t),s&&this.dispatchEvent(e,"touchend",t),o&&(a&&!u||this.dispatchEvent(e,"pointertap",t),s&&(this.dispatchEvent(e,"tap",t),o.over=!1))):o&&(this.dispatchEvent(e,"pointerupoutside",t),s&&this.dispatchEvent(e,"touchendoutside",t)),o&&o.none&&delete e.trackedPointers[n]},e.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this._didMove=!0,this.cursor=null);for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);s.data.originalEvent=t,this.processInteractive(s,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",s),"touch"===n.pointerType&&this.emit("touchmove",s),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",s)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,r){var i=t.data,n="touch"===i.pointerType,o="mouse"===i.pointerType||"pen"===i.pointerType;o&&this.processPointerOverOut(t,e,r),this.moveWhenInside&&!r||(this.dispatchEvent(e,"pointermove",t),n&&this.dispatchEvent(e,"touchmove",t),o&&this.dispatchEvent(e,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,this.processInteractive(i,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",i),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",i):this.releaseInteractionDataForPointerId(r.identifier)}},e.prototype.processPointerOverOut=function(t,e,r){var i=t.data,n=t.data.identifier,o="mouse"===i.pointerType||"pen"===i.pointerType,s=e.trackedPointers[n];r&&!s&&(s=e.trackedPointers[n]=new nU(n)),void 0!==s&&(r&&this.mouseOverRenderer?(s.over||(s.over=!0,this.delayDispatchEvent(e,"pointerover",t),o&&this.delayDispatchEvent(e,"mouseover",t)),o&&null===this.cursor&&(this.cursor=e.cursor)):s.over&&(s.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),o&&this.dispatchEvent(e,"mouseout",t),s.none&&delete e.trackedPointers[n]))},e.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",i),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",i)},e.prototype.getInteractionDataForPointerId=function(t){var e,r=t.pointerId;return 1===r||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[r]?e=this.activeInteractionData[r]:((e=this.interactionDataPool.pop()||new eU).identifier=r,this.activeInteractionData[r]=e),e.copyEvent(t),e},e.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},e.prototype.configureInteractionEventForDOMEvent=function(t,e,r){return t.data=r,this.mapPositionToPoint(r.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=r.global.x,e.globalY=r.global.y),r.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var r=0,i=t.changedTouches.length;r<i;r++){var n=t.changedTouches[r];void 0===n.button&&(n.button=t.touches.length?1:0),void 0===n.buttons&&(n.buttons=t.touches.length?1:0),void 0===n.isPrimary&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===n.width&&(n.width=n.radiusX||1),void 0===n.height&&(n.height=n.radiusY||1),void 0===n.tiltX&&(n.tiltX=0),void 0===n.tiltY&&(n.tiltY=0),void 0===n.pointerType&&(n.pointerType="touch"),void 0===n.pointerId&&(n.pointerId=n.identifier||0),void 0===n.pressure&&(n.pressure=n.force||.5),void 0===n.twist&&(n.twist=0),void 0===n.tangentialPressure&&(n.tangentialPressure=0),void 0===n.layerX&&(n.layerX=n.offsetX=n.clientX),void 0===n.layerY&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,e.push(n)}else if(globalThis.MouseEvent&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof globalThis.PointerEvent))e.push(t);else{var o=t;void 0===o.isPrimary&&(o.isPrimary=!0),void 0===o.width&&(o.width=1),void 0===o.height&&(o.height=1),void 0===o.tiltX&&(o.tiltX=0),void 0===o.tiltY&&(o.tiltY=0),void 0===o.pointerType&&(o.pointerType="mouse"),void 0===o.pointerId&&(o.pointerId=1),void 0===o.pressure&&(o.pressure=.5),void 0===o.twist&&(o.twist=0),void 0===o.tangentialPressure&&(o.tangentialPressure=0),o.isNormalized=!0,e.push(o)}return e},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e}(hM),hU=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,r,i,n,o,s,a){if(arguments.length>8)throw new Error("max arguments reached");var u=this,h=u.name,c=u.items;this._aliasCount++;for(var l=0,d=c.length;l<d;l++)c[l][h](t,e,r,i,n,o,s,a);return c===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(hU.prototype,{dispatch:{value:hU.prototype.emit},run:{value:hU.prototype.emit}}),aM.PREFER_ENV=sM.any?ZM.WEBGL:ZM.WEBGL2,aM.STRICT_TEXTURE_CACHE=!1;var cU=[];function lU(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=cU.length-1;n>=0;--n){var o=cU[n];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var dU=function(t,e){return dU=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},dU(t,e)};function fU(t,e){function r(){this.constructor=t}dU(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var pU=function(){return pU=Object.assign||function(t){for(var e,r=arguments,i=1,n=arguments.length;i<n;i++)for(var o in e=r[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pU.apply(this,arguments)};var mU=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new hU("setRealSize"),this.onUpdate=new hU("update"),this.onError=new hU("onError")}return t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(t,e,r){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},t.test=function(t,e){return!1},t}(),vU=function(t){function e(e,r){var i=this,n=r||{},o=n.width,s=n.height;if(!o||!s)throw new Error("BufferResource width or height invalid");return(i=t.call(this,o,s)||this).data=e,i}return fU(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===sD.UNPACK);var n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?i.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,i.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(mU),_U={scaleMode:iD.NEAREST,format:$M.RGBA,alphaMode:sD.NPM},yU=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null);var i=t.call(this)||this,n=(r=r||{}).alphaMode,o=r.mipmap,s=r.anisotropicLevel,a=r.scaleMode,u=r.width,h=r.height,c=r.wrapMode,l=r.format,d=r.type,f=r.target,p=r.resolution,m=r.resourceOptions;return!e||e instanceof mU||((e=lU(e,m)).internal=!0),i.resolution=p||aM.RESOLUTION,i.width=Math.round((u||0)*i.resolution)/i.resolution,i.height=Math.round((h||0)*i.resolution)/i.resolution,i._mipmap=void 0!==o?o:aM.MIPMAP_TEXTURES,i.anisotropicLevel=void 0!==s?s:aM.ANISOTROPIC_LEVEL,i._wrapMode=c||aM.WRAP_MODE,i._scaleMode=void 0!==a?a:aM.SCALE_MODE,i.format=l||$M.RGBA,i.type=d||eD.UNSIGNED_BYTE,i.target=f||tD.TEXTURE_2D,i.alphaMode=void 0!==n?n:sD.UNPACK,i.uid=zD(),i.touched=0,i.isPowerOfTwo=!1,i._refreshPOT(),i._glTextures={},i.dirtyId=0,i.dirtyStyleId=0,i.cacheId=null,i.valid=u>0&&h>0,i.textureCacheIds=[],i.destroyed=!1,i.resource=null,i._batchEnabled=0,i._batchLocation=0,i.parentTextureArray=null,i.setResource(e),i}return fU(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=HD(this.realWidth)&&HD(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete $D[this.cacheId],delete QD[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,r,i){void 0===i&&(i=aM.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;if(n)o=t;else{if(!t._pixiId){var s=r&&r.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+zD()}o=t._pixiId}var a=$D[o];if(n&&i&&!a)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return a||((a=new e(t,r)).cacheId=o,e.addToCache(a,o)),a},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new vU(t,{width:r,height:i}),s=t instanceof Float32Array?eD.FLOAT:eD.UNSIGNED_BYTE;return new e(o,Object.assign(_U,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),$D[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),$D[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=$D[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete $D[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)delete $D[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(hM),gU=function(t){function e(e,r){var i=this,n=r||{},o=n.width,s=n.height;(i=t.call(this,o,s)||this).items=[],i.itemDirtyIds=[];for(var a=0;a<e;a++){var u=new yU;i.items.push(u),i.itemDirtyIds.push(-2)}return i.length=e,i._load=null,i.baseTexture=null,i}return fU(e,t),e.prototype.initFromArray=function(t,e){for(var r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof mU?this.addResourceAt(t[r],r):this.addResourceAt(lU(t[r],e),r))},e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map((function(t){return t.resource})).filter((function(t){return t})).map((function(t){return t.load()}));return this._load=Promise.all(e).then((function(){var e=t.items[0],r=e.realWidth,i=e.realHeight;return t.resize(r,i),Promise.resolve(t)})),this._load},e}(mU),bU=function(t){function e(e,r){var i,n,o=this,s=r||{},a=s.width,u=s.height;return Array.isArray(e)?(i=e,n=e.length):n=e,o=t.call(this,n,{width:a,height:u})||this,i&&o.initFromArray(i,r),o}return fU(e,t),e.prototype.addBaseTextureAt=function(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=tD.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,e,r){var i=this,n=i.length,o=i.itemDirtyIds,s=i.items,a=t.gl;r.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,n,0,e.format,r.type,null);for(var u=0;u<n;u++){var h=s[u];o[u]<h.dirtyId&&(o[u]=h.dirtyId,h.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,u,h.resource.width,h.resource.height,1,e.format,r.type,h.resource.source))}return!0},e}(gU),TU=function(t){function e(e){var r=this,i=e,n=i.naturalWidth||i.videoWidth||i.width,o=i.naturalHeight||i.videoHeight||i.height;return(r=t.call(this,n,o)||this).source=e,r.noSubImage=!1,r}return fU(e,t),e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=function(t,e){if(void 0===e&&(e=globalThis.location),0===t.indexOf("data:"))return"";e=e||globalThis.location,qD||(qD=document.createElement("a")),qD.href=t;var r=ID.parse(qD.href),i=!r.port&&""===e.port||r.port===e.port;return r.hostname===e.hostname&&i&&r.protocol===e.protocol?"":"anonymous"}(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;if((i=i||this.source)instanceof HTMLImageElement){if(!i.complete||0===i.naturalWidth)return!1}else if(i instanceof HTMLVideoElement&&i.readyState<=1)return!1;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===sD.UNPACK),this.noSubImage||e.target!==n.TEXTURE_2D||r.width!==o||r.height!==s?(r.width=o,r.height=s,n.texImage2D(e.target,0,r.internalFormat,e.format,r.type,i)):n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,r.type,i),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source,r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(r,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(mU),EU=function(t){function e(e){return t.call(this,e)||this}return fU(e,t),e.test=function(t){var e=globalThis.OffscreenCanvas;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(TU),xU=function(t){function e(r,i){var n=this,o=i||{},s=o.width,a=o.height,u=o.autoLoad,h=o.linkBaseTexture;if(r&&r.length!==e.SIDES)throw new Error("Invalid length. Got "+r.length+", expected 6");n=t.call(this,6,{width:s,height:a})||this;for(var c=0;c<e.SIDES;c++)n.items[c].target=tD.TEXTURE_CUBE_MAP_POSITIVE_X+c;return n.linkBaseTexture=!1!==h,r&&n.initFromArray(r,i),!1!==u&&n.load(),n}return fU(e,t),e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=tD.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,e,r){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=tD.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},e.prototype.upload=function(t,r,i){for(var n=this.itemDirtyIds,o=0;o<e.SIDES;o++){var s=this.items[o];n[o]<s.dirtyId&&(s.valid&&s.resource?(s.resource.upload(t,s,i),n[o]=s.dirtyId):n[o]<-1&&(t.gl.texImage2D(s.target,0,i.internalFormat,r.realWidth,r.realHeight,0,r.format,i.type,null),n[o]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(gU),RU=function(t){function e(e,r){var i=this;if(r=r||{},!(e instanceof HTMLImageElement)){var n=new Image;TU.crossOrigin(n,e,r.crossorigin),n.src=e,e=n}return i=t.call(this,e)||this,!e.complete&&i._width&&i._height&&(i._width=0,i._height=0),i.url=e.src,i._process=null,i.preserveBitmap=!1,i.createBitmap=(void 0!==r.createBitmap?r.createBitmap:aM.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,i.alphaMode="number"==typeof r.alphaMode?r.alphaMode:null,i.bitmap=null,i._load=null,!1!==r.autoLoad&&i.load(),i}return fU(e,t),e.prototype.load=function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((function(t,r){var i=e.source;e.url=i.src;var n=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?n():(i.onload=n,i.onerror=function(t){r(t),e.onError.emit(t)})}))),this._load},e.prototype.process=function(){var t=this,e=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);var r=globalThis.createImageBitmap,i=!e.crossOrigin||"anonymous"===e.crossOrigin;return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then((function(t){return t.blob()})).then((function(i){return r(i,0,0,e.width,e.height,{premultiplyAlpha:t.alphaMode===sD.UNPACK?"premultiply":"none"})})).then((function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))})),this._process},e.prototype.upload=function(e,r,i){if("number"==typeof this.alphaMode&&(r.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0,o=r._glTextures;for(var s in o){var a=o[s];if(a!==i&&a.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return"string"==typeof t||t instanceof HTMLImageElement},e}(TU),SU=function(t){function e(e,r){var i=this;return r=r||{},(i=t.call(this,document.createElement("canvas"))||this)._width=0,i._height=0,i.svg=e,i.scale=r.scale||1,i._overrideWidth=r.width,i._overrideHeight=r.height,i._resolve=null,i._crossorigin=r.crossorigin,i._load=null,!1!==r.autoLoad&&i.load(),i}return fU(e,t),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise((function(r){if(t._resolve=function(){t.resize(t.source.width,t.source.height),r(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}))),this._load},e.prototype._loadSvg=function(){var t=this,e=new Image;TU.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=function(r){t._resolve&&(e.onerror=null,t.onError.emit(r))},e.onload=function(){if(t._resolve){var r=e.width,i=e.height;if(!r||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var n=r*t.scale,o=i*t.scale;(t._overrideWidth||t._overrideHeight)&&(n=t._overrideWidth||t._overrideHeight/i*r,o=t._overrideHeight||t._overrideWidth/r*i),n=Math.round(n),o=Math.round(o);var s=t.source;s.width=n,s.height=o,s._pixiId="canvas_"+zD(),s.getContext("2d").drawImage(e,0,0,r,i,0,0,n,o),t._resolve(),t._resolve=null}}},e.getSize=function(t){var r=e.SVG_SIZE.exec(t),i={};return r&&(i[r[1]]=Math.round(parseFloat(r[3])),i[r[5]]=Math.round(parseFloat(r[7]))),i},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,r){return"svg"===r||"string"==typeof t&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(t)||"string"==typeof t&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(TU),AU=function(t){function e(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var s=r[0].src||r[0];TU.crossOrigin(o,s,i.crossorigin);for(var a=0;a<r.length;++a){var u=document.createElement("source"),h=r[a],c=h.src,l=h.mime,d=(c=c||r[a]).split("?").shift().toLowerCase(),f=d.slice(d.lastIndexOf(".")+1);l=l||e.MIME_TYPES[f]||"video/"+f,u.src=c,u.type=l,o.appendChild(u)}r=o}return(n=t.call(this,r)||this).noSubImage=!0,n._autoUpdate=!0,n._isConnectedToTicker=!1,n._updateFPS=i.updateFPS||0,n._msToNextUpdate=0,n.autoPlay=!1!==i.autoPlay,n._load=null,n._resolve=null,n._onCanPlay=n._onCanPlay.bind(n),n._onError=n._onError.bind(n),!1!==i.autoLoad&&n.load(),n}return fU(e,t),e.prototype.update=function(e){if(!this.destroyed){var r=$L.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-r),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((function(r){t.valid?r(t):(t._resolve=r,e.load())})),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&($L.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&($L.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&($L.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?($L.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&($L.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,r){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(TU),IU=function(t){function e(e){return t.call(this,e)||this}return fU(e,t),e.test=function(t){return!!globalThis.createImageBitmap&&t instanceof ImageBitmap},e}(TU);cU.push(RU,IU,EU,AU,SU,vU,xU,bU);var CU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fU(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===sD.UNPACK);var n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?i.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,i.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0},e}(vU),OU=function(){function t(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new hU("disposeFramebuffer"),this.multisample=lD.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new yU(null,{scaleMode:iD.NEAREST,resolution:1,mipmap:oD.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new yU(new CU(null,{width:this.width,height:this.height}),{scaleMode:iD.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:oD.OFF,format:$M.DEPTH_COMPONENT,type:eD.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r<this.colorTextures.length;r++){var i=this.colorTextures[r],n=i.resolution;i.setSize(t/n,e/n)}if(this.depthTexture){n=this.depthTexture.resolution;this.depthTexture.setSize(t/n,e/n)}}},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},t}(),wU=function(t){function e(e){void 0===e&&(e={});var r=this;if("number"==typeof e){var i=arguments[0],n=arguments[1],o=arguments[2],s=arguments[3];e={width:i,height:n,scaleMode:o,resolution:s}}return e.width=e.width||100,e.height=e.height||100,e.multisample=void 0!==e.multisample?e.multisample:lD.NONE,(r=t.call(this,null,e)||this).mipmap=oD.OFF,r.valid=!0,r.clearColor=[0,0,0,0],r.framebuffer=new OU(r.realWidth,r.realHeight).addColorTexture(0,r),r.framebuffer.multisample=e.multisample,r.maskStack=[],r.filterStack=[{}],r}return fU(e,t),e.prototype.resize=function(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(yU),PU=function(){function t(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return t.prototype.set=function(t,e,r){var i=e.width,n=e.height;if(r){var o=t.width/2/i,s=t.height/2/n,a=t.x/i+o,u=t.y/n+s;r=EL.add(r,EL.NW),this.x0=a+o*EL.uX(r),this.y0=u+s*EL.uY(r),r=EL.add(r,2),this.x1=a+o*EL.uX(r),this.y1=u+s*EL.uY(r),r=EL.add(r,2),this.x2=a+o*EL.uX(r),this.y2=u+s*EL.uY(r),r=EL.add(r,2),this.x3=a+o*EL.uX(r),this.y3=u+s*EL.uY(r)}else this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},t.prototype.toString=function(){return"[@pixi/core:TextureUvs x0="+this.x0+" y0="+this.y0+" x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+" x3="+this.x3+" y3="+this.y3+"]"},t}(),NU=new PU;function MU(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}var DU=function(t){function e(r,i,n,o,s,a){var u=t.call(this)||this;if(u.noFrame=!1,i||(u.noFrame=!0,i=new uL(0,0,1,1)),r instanceof e&&(r=r.baseTexture),u.baseTexture=r,u._frame=i,u.trim=o,u.valid=!1,u._uvs=NU,u.uvMatrix=null,u.orig=n||i,u._rotate=Number(s||0),!0===s)u._rotate=2;else if(u._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return u.defaultAnchor=a?new sL(a.x,a.y):new sL(0,0),u._updateID=0,u.textureCacheIds=[],r.valid?u.noFrame?r.valid&&u.onBaseTextureUpdated(r):u.frame=i:r.once("loaded",u.onBaseTextureUpdated,u),u.noFrame&&r.on("update",u.onBaseTextureUpdated,u),u}return fU(e,t),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var r=this.baseTexture.resource;r&&r.url&&QD[r.url]&&e.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),r=this._frame===this.orig?t:this.orig.clone(),i=new e(this.baseTexture,!this.noFrame&&t,r,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(i._frame=t),i},e.prototype.updateUvs=function(){this._uvs===NU&&(this._uvs=new PU),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,r,i){void 0===r&&(r={}),void 0===i&&(i=aM.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;if(n)o=t;else if(t instanceof yU){if(!t.cacheId){var s=r&&r.pixiIdPrefix||"pixiid";t.cacheId=s+"-"+zD(),yU.addToCache(t,t.cacheId)}o=t.cacheId}else{if(!t._pixiId){s=r&&r.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+zD()}o=t._pixiId}var a=QD[o];if(n&&i&&!a)throw new Error('The cacheId "'+o+'" does not exist in TextureCache.');return a||t instanceof yU?!a&&t instanceof yU&&(a=new e(t),e.addToCache(a,o)):(r.resolution||(r.resolution=eL(t)),(a=new e(new yU(t,r))).baseTexture.cacheId=o,yU.addToCache(a.baseTexture,o),e.addToCache(a,o)),a},e.fromURL=function(t,r){var i=Object.assign({autoLoad:!1},null==r?void 0:r.resourceOptions),n=e.from(t,Object.assign({resourceOptions:i},r),!1),o=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):o.load().then((function(){return Promise.resolve(n)}))},e.fromBuffer=function(t,r,i,n){return new e(yU.fromBuffer(t,r,i,n))},e.fromLoader=function(t,r,i,n){var o=new yU(t,Object.assign({scaleMode:aM.SCALE_MODE,resolution:eL(r)},n)),s=o.resource;s instanceof RU&&(s.url=r);var a=new e(o);return i||(i=r),yU.addToCache(a.baseTexture,i),e.addToCache(a,i),i!==r&&(yU.addToCache(a.baseTexture,r),e.addToCache(a,r)),a.baseTexture.valid?Promise.resolve(a):new Promise((function(t){a.baseTexture.once("loaded",(function(){return t(a)}))}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),QD[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),QD[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=QD[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete QD[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)QD[t.textureCacheIds[i]]===t&&delete QD[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,r=t.y,i=t.width,n=t.height,o=e+i>this.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",u="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,h="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+a+" "+h)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new yU),MU(e._EMPTY),MU(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=document.createElement("canvas"),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),e._WHITE=new e(new yU(new EU(t))),MU(e._WHITE),MU(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(hM),LU=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return fU(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,r){void 0===r&&(r=!0);var i=this.baseTexture.resolution,n=Math.round(t*i)/i,o=Math.round(e*i)/i;this.valid=n>0&&o>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(n,o),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var r=arguments,i=[],n=1;n<arguments.length;n++)i[n-1]=r[n];return"number"==typeof t&&(KD("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:i[0],scaleMode:i[1],resolution:i[2]}),new e(new wU(t))},e}(DU),UU=function(){function t(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(t,e,r){void 0===r&&(r=lD.NONE);var i=new wU(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new LU(i)},t.prototype.getOptimalTexture=function(t,e,r,i){var n;void 0===r&&(r=1),void 0===i&&(i=lD.NONE),t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?n=i>1?-i:-1:(n=((65535&(t=XD(t)))<<16|65535&(e=XD(e)))>>>0,i>1&&(n+=4294967296*i)),this.texturePool[n]||(this.texturePool[n]=[]);var o=this.texturePool[n].pop();return o||(o=this.createTexture(t,e,i)),o.filterPoolKey=n,o.setResolution(r),o},t.prototype.getFilterTexture=function(t,e,r){var i=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||lD.NONE);return i.filterFrame=t.filterFrame,i},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i<r.length;i++)r[i].destroy(!0)}this.texturePool={}},t.prototype.setScreenSize=function(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){for(var e in this.enableFullScreen=t.width>0&&t.height>0,this.texturePool)if(Number(e)<0){var r=this.texturePool[e];if(r)for(var i=0;i<r.length;i++)r[i].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}},t.SCREEN_KEY=-1,t}(),FU=function(){function t(t,e,r,i,n,o,s){void 0===e&&(e=0),void 0===r&&(r=!1),void 0===i&&(i=eD.FLOAT),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s}return t.prototype.destroy=function(){this.buffer=null},t.from=function(e,r,i,n,o){return new t(e,r,i,n,o)},t}(),GU=0,BU=function(){function t(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=GU++,this.disposeRunner=new hU("disposeBuffer")}return t.prototype.update=function(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(t.prototype,"index",{get:function(){return this.type===dD.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?dD.ELEMENT_ARRAY_BUFFER:dD.ARRAY_BUFFER},enumerable:!1,configurable:!0}),t.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new t(e)},t}(),kU={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var XU={5126:4,5123:2,5121:1},HU=0,jU={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},VU=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=HU++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new hU("disposeGeometry"),this.refCount=0}return t.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===r&&(r=0),void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof BU||(e instanceof Array&&(e=new Float32Array(e)),e=new BU(e));var u=t.split("|");if(u.length>1){for(var h=0;h<u.length;h++)this.addAttribute(u[h],e,r,i,n);return this}var c=this.buffers.indexOf(e);return-1===c&&(this.buffers.push(e),c=this.buffers.length-1),this.attributes[t]=new FU(c,r,i,n,o,s,a),this.instanced=this.instanced||a,this},t.prototype.getAttribute=function(t){return this.attributes[t]},t.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},t.prototype.addIndex=function(t){return t instanceof BU||(t instanceof Array&&(t=new Uint16Array(t)),t=new BU(t)),t.type=dD.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},t.prototype.getIndex=function(){return this.indexBuffer},t.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],r=[],i=new BU;for(t in this.attributes){var n=this.attributes[t],o=this.buffers[n.buffer];e.push(o.data),r.push(n.size*XU[n.type]/4),n.buffer=0}for(i.data=function(t,e){for(var r=0,i=0,n={},o=0;o<t.length;o++)i+=e[o],r+=t[o].length;var s=new ArrayBuffer(4*r),a=null,u=0;for(o=0;o<t.length;o++){var h=e[o],c=t[o],l=kD(c);n[l]||(n[l]=new kU[l](s)),a=n[l];for(var d=0;d<c.length;d++)a[(d/h|0)*i+u+d%h]=c[d];u+=h}return new Float32Array(s)}(e,r),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},t.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},t.prototype.clone=function(){for(var e=new t,r=0;r<this.buffers.length;r++)e.buffers[r]=new BU(this.buffers[r].data.slice(0));for(var r in this.attributes){var i=this.attributes[r];e.attributes[r]=new FU(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=dD.ELEMENT_ARRAY_BUFFER),e},t.merge=function(e){for(var r,i=new t,n=[],o=[],s=[],a=0;a<e.length;a++){r=e[a];for(var u=0;u<r.buffers.length;u++)o[u]=o[u]||0,o[u]+=r.buffers[u].data.length,s[u]=0}for(a=0;a<r.buffers.length;a++)n[a]=new(jU[kD(r.buffers[a].data)])(o[a]),i.buffers[a]=new BU(n[a]);for(a=0;a<e.length;a++){r=e[a];for(u=0;u<r.buffers.length;u++)n[u].set(r.buffers[u].data,s[u]),s[u]+=r.buffers[u].data.length}if(i.attributes=r.attributes,r.indexBuffer){i.indexBuffer=i.buffers[r.buffers.indexOf(r.indexBuffer)],i.indexBuffer.type=dD.ELEMENT_ARRAY_BUFFER;var h=0,c=0,l=0,d=0;for(a=0;a<r.buffers.length;a++)if(r.buffers[a]!==r.indexBuffer){d=a;break}for(var a in r.attributes){var f=r.attributes[a];(0|f.buffer)===d&&(c+=f.size*XU[f.type]/4)}for(a=0;a<e.length;a++){var p=e[a].indexBuffer.data;for(u=0;u<p.length;u++)i.indexBuffer.data[u+l]+=h;h+=e[a].buffers[d].data.length/c,l+=p.length}}return i},t}(),YU=function(t){function e(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return fU(e,t),e}(VU),WU=function(t){function e(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new BU(e.vertices),e.uvBuffer=new BU(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return fU(e,t),e.prototype.map=function(t,e){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(VU),zU=0,ZU=function(){function t(t,e,r){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=zU++,this.static=!!e,this.ubo=!!r,t instanceof BU?(this.buffer=t,this.buffer.type=dD.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new BU(new Float32Array(1)),this.buffer.type=dD.UNIFORM_BUFFER,this.autoManage=!0))}return t.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},t.prototype.add=function(e,r,i){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new t(r,i)},t.from=function(e,r,i){return new t(e,r,i)},t.uboFrom=function(e,r){return new t(e,null==r||r,!0)},t}(),KU=function(){function t(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=lD.NONE,this.sourceFrame=new uL,this.destinationFrame=new uL,this.bindingSourceFrame=new uL,this.bindingDestinationFrame=new uL,this.filters=[],this.transform=null}return t.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},t}(),qU=[new sL,new sL,new sL,new sL],JU=new pL,QU=function(){function t(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new UU,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new YU,this.quadUv=new WU,this.tempRect=new uL,this.activeState={},this.globalUniforms=new ZU({outputFrame:new uL,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return t.prototype.push=function(t,e){for(var r,i,n=this.renderer,o=this.defaultFilterStack,s=this.statePool.pop()||new KU,a=this.renderer.renderTexture,u=e[0].resolution,h=e[0].multisample,c=e[0].padding,l=e[0].autoFit,d=null===(r=e[0].legacy)||void 0===r||r,f=1;f<e.length;f++){var p=e[f];u=Math.min(u,p.resolution),h=Math.min(h,p.multisample),c=this.useMaxPadding?Math.max(c,p.padding):c+p.padding,l=l&&p.autoFit,d=d||null===(i=p.legacy)||void 0===i||i}1===o.length&&(this.defaultFilterStack[0].renderTexture=a.current),o.push(s),s.resolution=u,s.multisample=h,s.legacy=d,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(c);var m=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB(JU.copyFrom(n.projection.transform).invert(),m),l?(s.sourceFrame.fit(m),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(m)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,u,h),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;var v=this.tempRect;v.x=0,v.y=0,v.width=s.sourceFrame.width,v.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=n.projection.transform,n.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,v),n.framebuffer.clear(0,0,0,0)},t.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;var i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;var n=i.inputSize,o=i.inputPixel,s=i.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],o[0]=Math.round(n[0]*e.resolution),o[1]=Math.round(n[1]*e.resolution),o[2]=1/o[0],o[3]=1/o[1],s[0]=.5*o[2],s[1]=.5*o[3],s[2]=e.sourceFrame.width*n[2]-.5*o[2],s[3]=e.sourceFrame.height*n[3]-.5*o[3],e.legacy){var a=i.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();var u=t[t.length-1];if(this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,u.renderTexture,aD.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var h=e.renderTexture,c=this.getOptimalFilterTexture(h.width,h.height,e.resolution);c.filterFrame=h.filterFrame;var l=0;for(l=0;l<r.length-1;++l){1===l&&e.multisample>1&&((c=this.getOptimalFilterTexture(h.width,h.height,e.resolution)).filterFrame=h.filterFrame),r[l].apply(this,h,c,aD.CLEAR,e);var d=h;h=c,c=d}r[l].apply(this,h,u.renderTexture,aD.BLEND,e),l>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)},t.prototype.bindAndClear=function(t,e){void 0===e&&(e=aD.CLEAR);var r=this.renderer,i=r.renderTexture,n=r.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,i.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&n.stateId||this.forceClear;(e===aD.CLEAR||e===aD.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},t.prototype.applyFilter=function(t,e,r,i){var n=this.renderer;n.state.set(t.state),this.bindAndClear(r,i),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(QM.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(QM.TRIANGLE_STRIP))},t.prototype.calculateSpriteMatrix=function(t,e){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=e._texture.orig,s=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo(pL.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},t.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},t.prototype.getOptimalFilterTexture=function(t,e,r,i){return void 0===r&&(r=1),void 0===i&&(i=lD.NONE),this.texturePool.getOptimalTexture(t,e,r,i)},t.prototype.getFilterTexture=function(t,e,r){if("number"==typeof t){var i=t;t=e,e=i}t=t||this.activeState.renderTexture;var n=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||lD.NONE);return n.filterFrame=t.filterFrame,n},t.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},t.prototype.emptyPool=function(){this.texturePool.clear(!0)},t.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},t.prototype.transformAABB=function(t,e){var r=qU[0],i=qU[1],n=qU[2],o=qU[3];r.set(e.left,e.top),i.set(e.left,e.bottom),n.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(n,n),t.apply(o,o);var s=Math.min(r.x,i.x,n.x,o.x),a=Math.min(r.y,i.y,n.y,o.y),u=Math.max(r.x,i.x,n.x,o.x),h=Math.max(r.y,i.y,n.y,o.y);e.x=s,e.y=a,e.width=u-s,e.height=h-a},t.prototype.roundFrame=function(t,e,r,i,n){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(n){var o=n.a,s=n.b,a=n.c,u=n.d;if((Math.abs(s)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(n=n?JU.copyFrom(n):JU.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}},t}(),$U=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),tF=function(){function t(t){this.renderer=t,this.emptyRenderer=new $U(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var r=this.renderer.texture.boundTextures,i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},t.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,u=0;u<s;u++){var h=n[u],c=h._batchLocation;if(c>=0&&c<i&&e[c]===h)o[u]=c;else for(;a<i;){var l=e[a];if(!l||l._batchEnabled!==r||l._batchLocation!==a){o[u]=a,h._batchLocation=a,e[a]=h;break}a++}}},t.prototype.destroy=function(){this.renderer=null},t}(),eF=0,rF=function(){function t(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(t.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),t.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=eF++,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},t.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=eF++,this.renderer.runners.contextChange.emit(t)},t.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},t.prototype.createContext=function(t,e){var r;if(aM.PREFER_ENV>=ZM.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},t.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},t.prototype.handleContextLost=function(t){t.preventDefault()},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},t.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},t.prototype.validateContext=function(t){var e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},t}(),iF=function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=lD.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},nF=new uL,oF=function(){function t(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new OU(10,10),this.msaaSamples=null}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new uL,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;aM.PREFER_ENV===ZM.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},t.prototype.bind=function(t,e,r){void 0===r&&(r=0);var i=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=r),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o<t.colorTextures.length;o++){var s=t.colorTextures[o];this.renderer.texture.unbind(s.parentTextureArray||s)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){var a=e.width>>r,u=e.height>>r,h=a/e.width;this.setViewport(e.x*h,e.y*h,a,u)}else{a=t.width>>r,u=t.height>>r;this.setViewport(0,0,a,u)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},t.prototype.setViewport=function(t,e,r,i){var n=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),n.width===r&&n.height===i&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=r,n.height=i,this.gl.viewport(t,e,r,i))},Object.defineProperty(t.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),t.prototype.clear=function(t,e,r,i,n){void 0===n&&(n=qM.COLOR|qM.DEPTH);var o=this.gl;o.clearColor(t,e,r,i),o.clear(n)},t.prototype.initFramebuffer=function(t){var e=this.gl,r=new iF(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r},t.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height)),r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var i=t.colorTextures,n=i.length;e.drawBuffers||(n=Math.min(n,1));for(var o=0;o<n;o++){var s=i[o],a=s.parentTextureArray||s;this.renderer.texture.bind(a,0)}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)},t.prototype.updateFramebuffer=function(t,e){var r=this.gl,i=t.glFramebuffers[this.CONTEXT_UID],n=t.colorTextures,o=n.length;r.drawBuffers||(o=Math.min(o,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?(i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.RGBA8,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));for(var s=[],a=0;a<o;a++){var u=n[a],h=u.parentTextureArray||u;this.renderer.texture.bind(h,0),0===a&&i.msaaBuffer||(r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+a,u.target,h._glTextures[this.CONTEXT_UID].texture,e),s.push(r.COLOR_ATTACHMENT0+a))}if((s.length>1&&r.drawBuffers(s),t.depthTexture)&&this.writeDepthTexture){var c=t.depthTexture;this.renderer.texture.bind(c,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null):(i.stencil=i.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,i.stencil))},t.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},t.prototype.detectSamples=function(t){var e=this.msaaSamples,r=lD.NONE;if(t<=1||null===e)return r;for(var i=0;i<e.length;i++)if(e[i]<=t){r=e[i];break}return 1===r&&(r=lD.NONE),r},t.prototype.blit=function(t,e,r){var i=this,n=i.current,o=i.renderer,s=i.gl,a=i.CONTEXT_UID;if(2===o.context.webGLVersion&&n){var u=n.glFramebuffers[a];if(u){if(!t){if(!u.msaaBuffer)return;var h=n.colorTextures[0];if(!h)return;u.blitFramebuffer||(u.blitFramebuffer=new OU(n.width,n.height),u.blitFramebuffer.addColorTexture(0,h)),(t=u.blitFramebuffer).colorTextures[0]!==h&&(t.colorTextures[0]=h,t.dirtyId++,t.dirtyFormat++),t.width===n.width&&t.height===n.height||(t.width=n.width,t.height=n.height,t.dirtyId++,t.dirtySize++)}e||((e=nF).width=n.width,e.height=n.height),r||(r=e);var c=e.width===r.width&&e.height===r.height;this.bind(t),s.bindFramebuffer(s.READ_FRAMEBUFFER,u.framebuffer),s.blitFramebuffer(e.left,e.top,e.right,e.bottom,r.left,r.top,r.right,r.bottom,s.COLOR_BUFFER_BIT,c?s.NEAREST:s.LINEAR)}}},t.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},t.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r<e.length;r++)this.disposeFramebuffer(e[r],t)},t.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.stencil=!0;var r=t.width,i=t.height,n=this.gl,o=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,o),e.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,e.multisample,n.DEPTH24_STENCIL8,r,i):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,r,i),e.stencil=o,n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,o)}}},t.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new uL},t.prototype.destroy=function(){this.renderer=null},t}(),sF={5126:4,5123:2,5121:1},aF=function(){function t(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return t.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){var r=this.renderer.context.extensions.vertexArrayObject;aM.PREFER_ENV===ZM.WEBGL_LEGACY&&(r=null),r?(t.createVertexArray=function(){return r.createVertexArrayOES()},t.bindVertexArray=function(t){return r.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return r.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(2!==e.webGLVersion){var i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=function(t,e){return i.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,r,n,o){return i.drawElementsInstancedANGLE(t,e,r,n,o)},t.drawArraysInstanced=function(t,e,r,n){return i.drawArraysInstancedANGLE(t,e,r,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},t.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var r=this.gl,i=t.glVertexArrayObjects[this.CONTEXT_UID],n=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},n=!0);var o=i[e.program.id]||this.initGeometryVao(t,e,n);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?r.bindVertexArray(o):this.activateVao(t,e.program)),this.updateBuffers()},t.prototype.reset=function(){this.unbind()},t.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.renderer.buffer,r=0;r<t.buffers.length;r++){var i=t.buffers[r];e.update(i)}},t.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},t.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o,i[o].location);return n.join("-")},t.prototype.initGeometryVao=function(t,e,r){void 0===r&&(r=!0);var i=this.gl,n=this.CONTEXT_UID,o=this.renderer.buffer,s=e.program;s.glPrograms[n]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,s);var a=this.getSignature(t,s),u=t.glVertexArrayObjects[this.CONTEXT_UID],h=u[a];if(h)return u[s.id]=h,h;var c=t.buffers,l=t.attributes,d={},f={};for(var p in c)d[p]=0,f[p]=0;for(var p in l)!l[p].size&&s.attributeData[p]?l[p].size=s.attributeData[p].size:l[p].size||console.warn("PIXI Geometry attribute '"+p+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[l[p].buffer]+=l[p].size*sF[l[p].type];for(var p in l){var m=l[p],v=m.size;void 0===m.stride&&(d[m.buffer]===v*sF[m.type]?m.stride=0:m.stride=d[m.buffer]),void 0===m.start&&(m.start=f[m.buffer],f[m.buffer]+=v*sF[m.type])}h=i.createVertexArray(),i.bindVertexArray(h);for(var _=0;_<c.length;_++){var y=c[_];o.bind(y),r&&y._glBuffers[n].refCount++}return this.activateVao(t,s),this._activeVao=h,u[s.id]=h,u[a]=h,h},t.prototype.disposeGeometry=function(t,e){var r;if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var i=t.glVertexArrayObjects[this.CONTEXT_UID],n=this.gl,o=t.buffers,s=null===(r=this.renderer)||void 0===r?void 0:r.buffer;if(t.disposeRunner.remove(this),i){if(s)for(var a=0;a<o.length;a++){var u=o[a]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,0!==u.refCount||e||s.dispose(o[a],e))}if(!e)for(var h in i)if("g"===h[0]){var c=i[h];this._activeVao===c&&this.unbind(),n.deleteVertexArray(c)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t)},t.prototype.activateVao=function(t,e){var r=this.gl,i=this.CONTEXT_UID,n=this.renderer.buffer,o=t.buffers,s=t.attributes;t.indexBuffer&&n.bind(t.indexBuffer);var a=null;for(var u in s){var h=s[u],c=o[h.buffer],l=c._glBuffers[i];if(e.attributeData[u]){a!==l&&(n.bind(c),a=l);var d=e.attributeData[u].location;if(r.enableVertexAttribArray(d),r.vertexAttribPointer(d,h.size,h.type||r.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(d,1)}}}},t.prototype.draw=function(t,e,r,i){var n=this.gl,o=this._activeGeometry;if(o.indexBuffer){var s=o.indexBuffer.data.BYTES_PER_ELEMENT,a=2===s?n.UNSIGNED_SHORT:n.UNSIGNED_INT;2===s||4===s&&this.canUseUInt32ElementIndex?o.instanced?n.drawElementsInstanced(t,e||o.indexBuffer.data.length,a,(r||0)*s,i||1):n.drawElements(t,e||o.indexBuffer.data.length,a,(r||0)*s):console.warn("unsupported index buffer type: uint32")}else o.instanced?n.drawArraysInstanced(t,r,e||o.getSize(),i||1):n.drawArrays(t,r,e||o.getSize());return this},t.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},t.prototype.destroy=function(){this.renderer=null},t}(),uF=function(){function t(t){void 0===t&&(t=null),this.type=cD.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=aM.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(t.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=cD.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},t.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},t}();function hF(t,e,r){var i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function cF(t,e){var r=t.getShaderSource(e).split("\n").map((function(t,e){return e+": "+t})),i=t.getShaderInfoLog(e),n=i.split("\n"),o={},s=n.map((function(t){return parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))})).filter((function(t){return!(!t||o[t])&&(o[t]=!0,!0)})),a=[""];s.forEach((function(t){r[t-1]="%c"+r[t-1]+"%c",a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));var u=r.join("\n");a[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function lF(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=!1;return e}function dF(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return lF(2*e);case"bvec3":return lF(3*e);case"bvec4":return lF(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var fF,pF={},mF=pF;function vF(){if(!fF){fF=hD.MEDIUM;var t=function(){if(mF===pF||mF&&mF.isContextLost()){var t=document.createElement("canvas"),e=void 0;aM.PREFER_ENV>=ZM.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),mF=e}return mF}();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);fF=e.precision?hD.HIGH:hD.MEDIUM}}return fF}function _F(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===hD.HIGH&&r!==hD.HIGH&&(i=hD.MEDIUM),"precision "+i+" float;\n"+t}return r!==hD.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var yF={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function gF(t){return yF[t]}var bF=null,TF={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function EF(t,e){if(!bF){var r=Object.keys(TF);bF={};for(var i=0;i<r.length;++i){var n=r[i];bF[t[n]]=TF[n]}}return bF[e]}var xF=[{test:function(t){return"float"===t.type&&1===t.size},code:function(t){return'\n            if(uv["'+t+'"] !== ud["'+t+'"].value)\n            {\n                ud["'+t+'"].value = uv["'+t+'"]\n                gl.uniform1f(ud["'+t+'"].location, uv["'+t+'"])\n            }\n            '}},{test:function(t){return("sampler2D"===t.type||"samplerCube"===t.type||"sampler2DArray"===t.type)&&1===t.size&&!t.isArray},code:function(t){return't = syncData.textureCount++;\n\n            renderer.texture.bind(uv["'+t+'"], t);\n\n            if(ud["'+t+'"].value !== t)\n            {\n                ud["'+t+'"].value = t;\n                gl.uniform1i(ud["'+t+'"].location, t);\n; // eslint-disable-line max-len\n            }'}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&void 0!==e.a},code:function(t){return'\n            gl.uniformMatrix3fv(ud["'+t+'"].location, false, uv["'+t+'"].toArray(true));\n            '},codeUbo:function(t){return"\n                var "+t+"_matrix = uv."+t+".toArray(true);\n\n                data[offset] = "+t+"_matrix[0];\n                data[offset+1] = "+t+"_matrix[1];\n                data[offset+2] = "+t+"_matrix[2];\n        \n                data[offset + 4] = "+t+"_matrix[3];\n                data[offset + 5] = "+t+"_matrix[4];\n                data[offset + 6] = "+t+"_matrix[5];\n        \n                data[offset + 8] = "+t+"_matrix[6];\n                data[offset + 9] = "+t+"_matrix[7];\n                data[offset + 10] = "+t+"_matrix[8];\n            "}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&void 0!==e.x},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    gl.uniform2f(ud["'+t+'"].location, v.x, v.y);\n                }'},codeUbo:function(t){return"\n                v = uv."+t+";\n\n                data[offset] = v.x;\n                data[offset+1] = v.y;\n            "}},{test:function(t){return"vec2"===t.type&&1===t.size},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    gl.uniform2f(ud["'+t+'"].location, v[0], v[1]);\n                }\n            '}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&void 0!==e.width},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    cv[2] = v.width;\n                    cv[3] = v.height;\n                    gl.uniform4f(ud["'+t+'"].location, v.x, v.y, v.width, v.height)\n                }'},codeUbo:function(t){return"\n                    v = uv."+t+";\n\n                    data[offset] = v.x;\n                    data[offset+1] = v.y;\n                    data[offset+2] = v.width;\n                    data[offset+3] = v.height;\n                "}},{test:function(t){return"vec4"===t.type&&1===t.size},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    cv[2] = v[2];\n                    cv[3] = v[3];\n\n                    gl.uniform4f(ud["'+t+'"].location, v[0], v[1], v[2], v[3])\n                }'}}],RF={float:"\n    if (cv !== v)\n    {\n        cu.value = v;\n        gl.uniform1f(location, v);\n    }",vec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2f(location, v[0], v[1])\n    }",vec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3f(location, v[0], v[1], v[2])\n    }",vec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n    }",int:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",ivec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2i(location, v[0], v[1]);\n    }",ivec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3i(location, v[0], v[1], v[2]);\n    }",ivec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n    }",uint:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1ui(location, v);\n    }",uvec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2ui(location, v[0], v[1]);\n    }",uvec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3ui(location, v[0], v[1], v[2]);\n    }",uvec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n    }",bool:"\n    if (cv !== v)\n    {\n        cu.value = v;\n        gl.uniform1i(location, v);\n    }",bvec2:"\n    if (cv[0] != v[0] || cv[1] != v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2i(location, v[0], v[1]);\n    }",bvec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3i(location, v[0], v[1], v[2]);\n    }",bvec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n    }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},SF={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var AF,IF=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function CF(t){for(var e="",r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+="if(test == "+r+".0){}");return e}var OF=0,wF={},PF=function(){function t(e,r,i){void 0===i&&(i="pixi-shader"),this.id=OF++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(i=i.replace(/\s+/g,"-"),wF[i]?(wF[i]++,i+="-"+wF[i]):wF[i]=1,this.vertexSrc="#define SHADER_NAME "+i+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+"\n"+this.fragmentSrc,this.vertexSrc=_F(this.vertexSrc,aM.PRECISION_VERTEX,hD.HIGH),this.fragmentSrc=_F(this.fragmentSrc,aM.PRECISION_FRAGMENT,vF())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),t.from=function(e,r,i){var n=e+r,o=JD[n];return o||(JD[n]=o=new t(e,r,i)),o},t}(),NF=function(){function t(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof ZU?e:new ZU(e):new ZU({})}return t.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var r in e.uniforms){var i=e.uniforms[r];if(i.group&&this.checkUniformExists(t,i))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(e,r,i){return new t(PF.from(e,r),i)},t}(),MF=function(){function t(){this.data=0,this.blendMode=JM.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(t.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(t){!!(32&this.data)!==t&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==JM.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},t.for2d=function(){var e=new t;return e.depthTest=!1,e.blend=!0,e},t}(),DF=function(t){function e(r,i,n){var o=this,s=PF.from(r||e.defaultVertexSrc,i||e.defaultFragmentSrc);return(o=t.call(this,s,n)||this).padding=0,o.resolution=aM.FILTER_RESOLUTION,o.multisample=aM.FILTER_MULTISAMPLE,o.enabled=!0,o.autoFit=!0,o.state=new MF,o}return fU(e,t),e.prototype.apply=function(t,e,r,i,n){t.applyFilter(this,e,r,i)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),e}(NF),LF=new pL,UF=function(){function t(t,e){this._texture=t,this.mapCoord=new pL,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,i=0;i<t.length;i+=2){var n=t[i],o=t[i+1];e[i]=n*r.a+o*r.c+r.tx,e[i+1]=n*r.b+o*r.d+r.ty}return e},t.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var r=e._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);var i=e.orig,n=e.trim;n&&(LF.set(i.width/n.width,0,0,i.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(LF));var o=e.baseTexture,s=this.uClampFrame,a=this.clampMargin/o.resolution,u=this.clampOffset;return s[0]=(e._frame.x+a+u)/o.width,s[1]=(e._frame.y+a+u)/o.height,s[2]=(e._frame.x+e._frame.width-a+u)/o.width,s[3]=(e._frame.y+e._frame.height-a+u)/o.height,this.uClampOffset[0]=u/o.realWidth,this.uClampOffset[1]=u/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0},t}(),FF=function(t){function e(e,r,i){var n=this,o=null;return"string"!=typeof e&&void 0===r&&void 0===i&&(o=e,e=void 0,r=void 0,i=void 0),(n=t.call(this,e||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n",r||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n    float clip = step(3.5,\n        step(maskClamp.x, vMaskCoord.x) +\n        step(maskClamp.y, vMaskCoord.y) +\n        step(vMaskCoord.x, maskClamp.z) +\n        step(vMaskCoord.y, maskClamp.w));\n\n    vec4 original = texture2D(uSampler, vTextureCoord);\n    vec4 masky = texture2D(mask, vMaskCoord);\n    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n    original *= (alphaMul * masky.r * alpha * clip);\n\n    gl_FragColor = original;\n}\n",i)||this).maskSprite=o,n.maskMatrix=new pL,n}return fU(e,t),Object.defineProperty(e.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),e.prototype.apply=function(t,e,r,i){var n=this._maskSprite,o=n._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new UF(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,e,r,i))},e}(DF),GF=function(){function t(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return t.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},t.prototype.push=function(t,e){var r=e;if(!r.isMaskData){var i=this.maskDataPool.pop()||new uF;i.pooled=!0,i.maskObject=e,r=i}var n=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(r.copyCountersOrReset(n),r.autoDetect&&this.detect(r),r._target=t,r.type!==cD.SPRITE&&this.maskStack.push(r),r.enabled)switch(r.type){case cD.SCISSOR:this.renderer.scissor.push(r);break;case cD.STENCIL:this.renderer.stencil.push(r);break;case cD.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r)}r.type===cD.SPRITE&&this.maskStack.push(r)},t.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case cD.SCISSOR:this.renderer.scissor.pop();break;case cD.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case cD.SPRITE:this.popSpriteMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){var r=this.maskStack[this.maskStack.length-1];r.type===cD.SPRITE&&r._filters&&(r._filters[0].maskSprite=r.maskObject)}}},t.prototype.detect=function(t){t.maskObject.isSprite?t.type=cD.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=cD.SCISSOR:t.type=cD.STENCIL},t.prototype.pushSpriteMask=function(t){var e,r,i=t.maskObject,n=t._target,o=t._filters;o||(o=this.alphaMaskPool[this.alphaMaskIndex])||(o=this.alphaMaskPool[this.alphaMaskIndex]=[new FF]);var s,a,u=this.renderer,h=u.renderTexture;if(h.current){var c=h.current;s=t.resolution||c.resolution,a=null!==(e=t.multisample)&&void 0!==e?e:c.multisample}else s=t.resolution||u.resolution,a=null!==(r=t.multisample)&&void 0!==r?r:u.multisample;o[0].resolution=s,o[0].multisample=a,o[0].maskSprite=i;var l=n.filterArea;n.filterArea=i.getBounds(!0),u.filter.push(n,o),n.filterArea=l,t._filters||this.alphaMaskIndex++},t.prototype.popSpriteMask=function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},t.prototype.destroy=function(){this.renderer=null},t}(),BF=function(){function t(t){this.renderer=t,this.maskStack=[],this.glConst=0}return t.prototype.getStackLength=function(){return this.maskStack.length},t.prototype.setMaskStack=function(t){var e=this.renderer.gl,r=this.getStackLength();this.maskStack=t;var i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},t.prototype._useCurrent=function(){},t.prototype.destroy=function(){this.renderer=null,this.maskStack=null},t}(),kF=new pL,XF=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.SCISSOR_TEST,r}return fU(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){if(!t._scissorRectLocal){var e=t._scissorRect,r=t.maskObject,i=this.renderer,n=i.renderTexture;r.renderable=!0;var o=r.getBounds();this.roundFrameToPixels(o,n.current?n.current.resolution:i.resolution,n.sourceFrame,n.destinationFrame,i.projection.transform),r.renderable=!1,e&&o.fit(e),t._scissorRectLocal=o}},e.isMatrixRotated=function(t){if(!t)return!1;var e=t.a,r=t.b,i=t.c,n=t.d;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)},e.prototype.testScissor=function(t){var r=t.maskObject;if(!r.isFastRect||!r.isFastRect())return!1;if(e.isMatrixRotated(r.worldTransform))return!1;if(e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var i=t._scissorRectLocal;return i.width>0&&i.height>0},e.prototype.roundFrameToPixels=function(t,r,i,n,o){e.isMatrixRotated(o)||((o=o?kF.copyFrom(o):kF.identity()).translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(o,t),t.fit(n),t.x=Math.round(t.x*r),t.y=Math.round(t.y*r),t.width=Math.round(t.width*r),t.height=Math.round(t.height*r))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(){var t=this.renderer.gl;this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},e}(BF),HF=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return fU(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?e.disable(e.STENCIL_TEST):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(BF),jF=function(){function t(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new pL,this.transform=null}return t.prototype.update=function(t,e,r,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,i),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},t.prototype.calculateProjection=function(t,e,r,i){var n=this.projectionMatrix,o=i?-1:1;n.identity(),n.a=1/e.width*2,n.d=o*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-o-e.y*n.d},t.prototype.setTransform=function(t){},t.prototype.destroy=function(){this.renderer=null},t}(),VF=new uL,YF=new uL,WF=function(){function t(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new uL,this.destinationFrame=new uL,this.viewportFrame=new uL}return t.prototype.bind=function(t,e,r){void 0===t&&(t=null);var i,n,o,s=this.renderer;this.current=t,t?(o=(i=t.baseTexture).resolution,e||(VF.width=t.frame.width,VF.height=t.frame.height,e=VF),r||(YF.x=t.frame.x,YF.y=t.frame.y,YF.width=e.width,YF.height=e.height,r=YF),n=i.framebuffer):(o=s.resolution,e||(VF.width=s.screen.width,VF.height=s.screen.height,e=VF),r||((r=VF).width=e.width,r.height=e.height));var a=this.viewportFrame;a.x=r.x*o,a.y=r.y*o,a.width=r.width*o,a.height=r.height*o,t||(a.y=s.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(n,a),this.renderer.projection.update(r,e,o,!n),t?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)},t.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor;var r=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,n=r.width!==i.width||r.height!==i.height;if(n){var o=this.viewportFrame,s=o.x,a=o.y,u=o.width,h=o.height;s=Math.round(s),a=Math.round(a),u=Math.round(u),h=Math.round(h),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(s,a,u,h)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),n&&this.renderer.scissor.pop()},t.prototype.resize=function(){this.bind(null)},t.prototype.reset=function(){this.bind(null)},t.prototype.destroy=function(){this.renderer=null},t}();function zF(t,e,r,i,n){r.buffer.update(n)}var ZF={float:"\n        data[offset] = v;\n    ",vec2:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n    ",vec3:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n\n    ",vec4:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n        data[offset+3] = v[3];\n    ",mat2:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n\n        data[offset+4] = v[2];\n        data[offset+5] = v[3];\n    ",mat3:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n\n        data[offset + 4] = v[3];\n        data[offset + 5] = v[4];\n        data[offset + 6] = v[5];\n\n        data[offset + 8] = v[6];\n        data[offset + 9] = v[7];\n        data[offset + 10] = v[8];\n    ",mat4:"\n        for(var i = 0; i < 16; i++)\n        {\n            data[offset + i] = v[i];\n        }\n    "},KF={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function qF(t,e){if(!t.autoManage)return{size:0,syncFunc:zF};for(var r=function(t,e){var r=[];for(var i in t)e[i]&&r.push(e[i]);return r.sort((function(t,e){return t.index-e.index})),r}(t.uniforms,e),i=function(t){for(var e=t.map((function(t){return{data:t,offset:0,dataLen:0,dirty:0}})),r=0,i=0,n=0,o=0;o<e.length;o++){var s=e[o];if(r=KF[s.data.type],s.data.size>1&&(r=Math.max(r,16)*s.data.size),s.dataLen=r,i%r!=0&&i<16){var a=i%r%16;i+=a,n+=a}i+r>16?(n=16*Math.ceil(n/16),s.offset=n,n+=r,i=r):(s.offset=n,i+=r,n+=r)}return{uboElements:e,size:n=16*Math.ceil(n/16)}}(r),n=i.uboElements,o=i.size,s=["\n    var v = null;\n    var v2 = null;\n    var cv = null;\n    var t = 0;\n    var gl = renderer.gl\n    var index = 0;\n    var data = buffer.data;\n    "],a=0;a<n.length;a++){for(var u=n[a],h=t.uniforms[u.data.name],c=u.data.name,l=!1,d=0;d<xF.length;d++){var f=xF[d];if(f.codeUbo&&f.test(u.data,h)){s.push("offset = "+u.offset/4+";",xF[d].codeUbo(u.data.name,h)),l=!0;break}}if(!l)if(u.data.size>1){var p=gF(u.data.type),m=Math.max(KF[u.data.type]/16,1),v=p/m,_=(4-v%4)%4;s.push("\n                cv = ud."+c+".value;\n                v = uv."+c+";\n                offset = "+u.offset/4+";\n\n                t = 0;\n\n                for(var i=0; i < "+u.data.size*m+"; i++)\n                {\n                    for(var j = 0; j < "+v+"; j++)\n                    {\n                        data[offset++] = v[t++];\n                    }\n                    offset += "+_+";\n                }\n\n                ")}else{var y=ZF[u.data.type];s.push("\n                cv = ud."+c+".value;\n                v = uv."+c+";\n                offset = "+u.offset/4+";\n                "+y+";\n                ")}}return s.push("\n       renderer.buffer.update(buffer);\n    "),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join("\n"))}}var JF=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function QF(t,e){var r=hF(t,t.VERTEX_SHADER,e.vertexSrc),i=hF(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();if(t.attachShader(n,r),t.attachShader(n,i),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||function(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||cF(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||cF(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,n,r,i),e.attributeData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;n<i;n++){var o=e.getActiveAttrib(t,n);if(0!==o.name.indexOf("gl_")){var s=EF(e,o.type),a={type:s,name:o.name,size:gF(s),location:e.getAttribLocation(t,o.name)};r[o.name]=a}}return r}(n,t),e.uniformData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var o=e.getActiveUniform(t,n),s=o.name.replace(/\[.*?\]$/,""),a=!!o.name.match(/\[.*?\]$/),u=EF(e,o.type);r[s]={name:s,index:n,type:u,size:o.size,isArray:a,value:dF(u,o.size)}}return r}(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var o=Object.keys(e.attributeData);o.sort((function(t,e){return t>e?1:-1}));for(var s=0;s<o.length;s++)e.attributeData[o[s]].location=s,t.bindAttribLocation(n,s,o[s]);t.linkProgram(n)}t.deleteShader(r),t.deleteShader(i);var a={};for(var s in e.uniformData){var u=e.uniformData[s];a[s]={location:t.getUniformLocation(n,s),value:dF(u.type,u.size)}}return new JF(n,a)}var $F=0,tG={textureCount:0,uboCount:0},eG=function(){function t(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=$F++}return t.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof AF)return AF;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");AF=!0===t({a:"b"},"a","b")}catch(t){AF=!1}return AF}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},t.prototype.contextChange=function(t){this.gl=t,this.reset()},t.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var r=t.program,i=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==r&&(this.program=r,this.gl.useProgram(i.program)),e||(tG.textureCount=0,tG.uboCount=0,this.syncUniformGroup(t.uniformGroup,tG)),i},t.prototype.setUniforms=function(t){var e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)},t.prototype.syncUniformGroup=function(t,e){var r=this.getGlProgram();t.static&&t.dirtyId===r.uniformDirtyGroups[t.id]||(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))},t.prototype.syncUniforms=function(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)},t.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){var r,i=["\n        var v = null;\n        var cv = null;\n        var cu = null;\n        var t = 0;\n        var gl = renderer.gl;\n    "];for(var n in t.uniforms){var o=e[n];if(o){for(var s=t.uniforms[n],a=!1,u=0;u<xF.length;u++)if(xF[u].test(o,s)){i.push(xF[u].code(n,s)),a=!0;break}if(!a){var h=(1===o.size?RF:SF)[o.type].replace("location",'ud["'+n+'"].location');i.push('\n            cu = ud["'+n+'"];\n            cv = cu.value;\n            v = uv["'+n+'"];\n            '+h+";")}}else(null===(r=t.uniforms[n])||void 0===r?void 0:r.group)&&(t.uniforms[n].ubo?i.push("\n                        renderer.shader.syncUniformBufferGroup(uv."+n+", '"+n+"');\n                    "):i.push("\n                        renderer.shader.syncUniformGroup(uv."+n+", syncData);\n                    "))}return new Function("ud","uv","renderer","syncData",i.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},t.prototype.syncUniformBufferGroup=function(t,e){var r=this.getGlProgram();if(!t.static||0!==t.dirtyId||!r.uniformGroups[t.id]){t.dirtyId=0;var i=r.uniformGroups[t.id]||this.createSyncBufferGroup(t,r,e);t.buffer.update(),i(r.uniformData,t.uniforms,this.renderer,tG,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,r.uniformBufferBindings[e])},t.prototype.createSyncBufferGroup=function(t,e,r){var i=this.renderer.gl;this.renderer.buffer.bind(t.buffer);var n=this.gl.getUniformBlockIndex(e.program,r);e.uniformBufferBindings[r]=this.shader.uniformBindCount,i.uniformBlockBinding(e.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;var o=this.getSignature(t,this.shader.program.uniformData,"ubo"),s=this._uboCache[o];if(s||(s=this._uboCache[o]=qF(t,this.shader.program.uniformData)),t.autoManage){var a=new Float32Array(s.size/4);t.buffer.update(a)}return e.uniformGroups[t.id]=s.syncFunc,e.uniformGroups[t.id]},t.prototype.getSignature=function(t,e,r){var i=t.uniforms,n=[r+"-"];for(var o in i)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")},t.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},t.prototype.generateProgram=function(t){var e=this.gl,r=t.program,i=QF(e,r);return r.glPrograms[this.renderer.CONTEXT_UID]=i,i},t.prototype.reset=function(){this.program=null,this.shader=null},t.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},t}();var rG=function(){function t(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=JM.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new MF,this.defaultState.blend=!0}return t.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[JM.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.ADD]=[t.ONE,t.ONE],e[JM.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.NONE]=[0,0],e[JM.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[JM.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[JM.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[JM.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[JM.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[JM.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[JM.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[JM.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[JM.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[JM.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},t.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,r=0;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(r=0;r<this.checks.length;r++)this.checks[r](this,t)},t.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},t.prototype.setBlend=function(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},t.prototype.setOffset=function(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},t.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},t.prototype.setDepthMask=function(t){this.gl.depthMask(t)},t.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},t.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},t.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],r=this.gl;2===e.length?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}},t.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},t.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},t.prototype.updateCheck=function(t,e){var r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):e||-1===r||this.checks.splice(r,1)},t.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},t.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},t.prototype.destroy=function(){this.gl=null},t}(),iG=function(){function t(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=aM.GC_MAX_IDLE,this.checkCountMax=aM.GC_MAX_CHECK_COUNT,this.mode=aM.GC_MODE}return t.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==uD.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;i<e.length;i++){var n=e[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i<e.length;i++)null!==e[i]&&(e[o++]=e[i]);e.length=o}},t.prototype.unload=function(t){var e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(var i=t.children.length-1;i>=0;i--)this.unload(t.children[i])},t.prototype.destroy=function(){this.renderer=null},t}();var nG=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=eD.UNSIGNED_BYTE,this.internalFormat=$M.RGBA,this.samplerType=0},oG=function(){function t(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new yU,this.hasIntegerTextures=!1}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){var e,r,i,n,o,s,a,u,h,c,l,d,f,p,m,v,_,y,g,b,T,E,x;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?((e={})[eD.UNSIGNED_BYTE]=((r={})[$M.RGBA]=t.RGBA8,r[$M.RGB]=t.RGB8,r[$M.RG]=t.RG8,r[$M.RED]=t.R8,r[$M.RGBA_INTEGER]=t.RGBA8UI,r[$M.RGB_INTEGER]=t.RGB8UI,r[$M.RG_INTEGER]=t.RG8UI,r[$M.RED_INTEGER]=t.R8UI,r[$M.ALPHA]=t.ALPHA,r[$M.LUMINANCE]=t.LUMINANCE,r[$M.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,r),e[eD.BYTE]=((i={})[$M.RGBA]=t.RGBA8_SNORM,i[$M.RGB]=t.RGB8_SNORM,i[$M.RG]=t.RG8_SNORM,i[$M.RED]=t.R8_SNORM,i[$M.RGBA_INTEGER]=t.RGBA8I,i[$M.RGB_INTEGER]=t.RGB8I,i[$M.RG_INTEGER]=t.RG8I,i[$M.RED_INTEGER]=t.R8I,i),e[eD.UNSIGNED_SHORT]=((n={})[$M.RGBA_INTEGER]=t.RGBA16UI,n[$M.RGB_INTEGER]=t.RGB16UI,n[$M.RG_INTEGER]=t.RG16UI,n[$M.RED_INTEGER]=t.R16UI,n[$M.DEPTH_COMPONENT]=t.DEPTH_COMPONENT16,n),e[eD.SHORT]=((o={})[$M.RGBA_INTEGER]=t.RGBA16I,o[$M.RGB_INTEGER]=t.RGB16I,o[$M.RG_INTEGER]=t.RG16I,o[$M.RED_INTEGER]=t.R16I,o),e[eD.UNSIGNED_INT]=((s={})[$M.RGBA_INTEGER]=t.RGBA32UI,s[$M.RGB_INTEGER]=t.RGB32UI,s[$M.RG_INTEGER]=t.RG32UI,s[$M.RED_INTEGER]=t.R32UI,s[$M.DEPTH_COMPONENT]=t.DEPTH_COMPONENT24,s),e[eD.INT]=((a={})[$M.RGBA_INTEGER]=t.RGBA32I,a[$M.RGB_INTEGER]=t.RGB32I,a[$M.RG_INTEGER]=t.RG32I,a[$M.RED_INTEGER]=t.R32I,a),e[eD.FLOAT]=((u={})[$M.RGBA]=t.RGBA32F,u[$M.RGB]=t.RGB32F,u[$M.RG]=t.RG32F,u[$M.RED]=t.R32F,u[$M.DEPTH_COMPONENT]=t.DEPTH_COMPONENT32F,u),e[eD.HALF_FLOAT]=((h={})[$M.RGBA]=t.RGBA16F,h[$M.RGB]=t.RGB16F,h[$M.RG]=t.RG16F,h[$M.RED]=t.R16F,h),e[eD.UNSIGNED_SHORT_5_6_5]=((c={})[$M.RGB]=t.RGB565,c),e[eD.UNSIGNED_SHORT_4_4_4_4]=((l={})[$M.RGBA]=t.RGBA4,l),e[eD.UNSIGNED_SHORT_5_5_5_1]=((d={})[$M.RGBA]=t.RGB5_A1,d),e[eD.UNSIGNED_INT_2_10_10_10_REV]=((f={})[$M.RGBA]=t.RGB10_A2,f[$M.RGBA_INTEGER]=t.RGB10_A2UI,f),e[eD.UNSIGNED_INT_10F_11F_11F_REV]=((p={})[$M.RGB]=t.R11F_G11F_B10F,p),e[eD.UNSIGNED_INT_5_9_9_9_REV]=((m={})[$M.RGB]=t.RGB9_E5,m),e[eD.UNSIGNED_INT_24_8]=((v={})[$M.DEPTH_STENCIL]=t.DEPTH24_STENCIL8,v),e[eD.FLOAT_32_UNSIGNED_INT_24_8_REV]=((_={})[$M.DEPTH_STENCIL]=t.DEPTH32F_STENCIL8,_),x=e):((y={})[eD.UNSIGNED_BYTE]=((g={})[$M.RGBA]=t.RGBA,g[$M.RGB]=t.RGB,g[$M.ALPHA]=t.ALPHA,g[$M.LUMINANCE]=t.LUMINANCE,g[$M.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,g),y[eD.UNSIGNED_SHORT_5_6_5]=((b={})[$M.RGB]=t.RGB,b),y[eD.UNSIGNED_SHORT_4_4_4_4]=((T={})[$M.RGBA]=t.RGBA,T),y[eD.UNSIGNED_SHORT_5_5_5_1]=((E={})[$M.RGBA]=t.RGBA,E),x=y),x}(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r<e;r++)this.boundTextures[r]=null;this.emptyTextures={};var i=new nG(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new nG(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(r=0;r<6;r++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(r=0;r<this.boundTextures.length;r++)this.bind(null,r)},t.prototype.bind=function(t,e){void 0===e&&(e=0);var r=this.gl;if((t=null==t?void 0:t.castToBaseTexture())&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),this.updateTexture(t)),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[e]=null},t.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},t.prototype.unbind=function(t){var e=this.gl,r=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var i=0;i<r.length;i++)r[i]===this.unknownTexture&&this.bind(null,i)}for(i=0;i<r.length;i++)r[i]===t&&(this.currentLocation!==i&&(e.activeTexture(e.TEXTURE0+i),this.currentLocation=i),e.bindTexture(t.target,this.emptyTextures[t.target].texture),r[i]=null)},t.prototype.ensureSamplerType=function(t){var e=this,r=e.boundTextures,i=e.hasIntegerTextures,n=e.CONTEXT_UID;if(i)for(var o=t-1;o>=0;--o){var s=r[o];if(s)s._glTextures[n].samplerType!==rD.FLOAT&&this.renderer.texture.unbind(s)}},t.prototype.initTexture=function(t){var e=new nG(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},t.prototype.initTextureType=function(t,e){var r,i;e.internalFormat=null!==(i=null===(r=this.internalFormats[t.type])||void 0===r?void 0:r[t.format])&&void 0!==i?i:t.format,2===this.webGLVersion&&t.type===eD.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},t.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var r=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(r,t,e))e.samplerType!==rD.FLOAT&&(this.hasIntegerTextures=!0);else{var i=t.realWidth,n=t.realHeight,o=r.gl;(e.width!==i||e.height!==n||e.dirtyId<0)&&(e.width=i,e.height=n,o.texImage2D(t.target,0,e.internalFormat,i,n,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},t.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var i=this.managedTextures.indexOf(t);-1!==i&&VD(this.managedTextures,i,1)}},t.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==oD.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=nD.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},t.prototype.setStyle=function(t,e){var r=this.gl;if(e.mipmap&&t.mipmap!==oD.ON_MANUAL&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===iD.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===iD.LINEAR){var n=Math.min(t.anisotropicLevel,r.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===iD.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===iD.LINEAR?r.LINEAR:r.NEAREST)},t.prototype.destroy=function(){this.renderer=null},t}(),sG=new pL,aG=function(t){function e(e,r){void 0===e&&(e=KM.UNKNOWN);var i=t.call(this)||this;return r=Object.assign({},aM.RENDER_OPTIONS,r),i.options=r,i.type=e,i.screen=new uL(0,0,r.width,r.height),i.view=r.view||document.createElement("canvas"),i.resolution=r.resolution||aM.RESOLUTION,i.useContextAlpha=r.useContextAlpha,i.autoDensity=!!r.autoDensity,i.preserveDrawingBuffer=r.preserveDrawingBuffer,i.clearBeforeRender=r.clearBeforeRender,i._backgroundColor=0,i._backgroundColorRgba=[0,0,0,1],i._backgroundColorString="#000000",i.backgroundColor=r.backgroundColor||i._backgroundColor,i.backgroundAlpha=r.backgroundAlpha,void 0!==r.transparent&&(KD("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),i.useContextAlpha=r.transparent,i.backgroundAlpha=r.transparent?0:1),i._lastObjectRendered=null,i.plugins={},i}return fU(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var r=this.view.width/this.resolution,i=this.view.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=i+"px"),this.emit("resize",r,i)},e.prototype.generateTexture=function(t,e,r,i){void 0===e&&(e={}),"number"==typeof e&&(KD("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),e={scaleMode:e,resolution:r,region:i});var n=e.region,o=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&(r[i[n]]=t[i[n]])}return r}(e,["region"]);0===(i=n||t.getLocalBounds(null,!0)).width&&(i.width=1),0===i.height&&(i.height=1);var s=LU.create(pU({width:i.width,height:i.height},o));return sG.tx=-i.x,sG.ty=-i.y,this.render(t,{renderTexture:s,clear:!1,transform:sG,skipUpdateTransform:!!t.parent}),s},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var r=this;r.plugins=null,r.type=KM.UNKNOWN,r.view=null,r.screen=null,r._tempDisplayObjectParent=null,r.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=MD(t),ND(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(hM),uG=function(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},hG=function(){function t(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return t.prototype.destroy=function(){this.renderer=null},t.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},t.prototype.bind=function(t){var e=this.gl,r=this.CONTEXT_UID,i=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)},t.prototype.bindBufferBase=function(t,e){var r=this.gl,i=this.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var n=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,n.buffer)}},t.prototype.bindBufferRange=function(t,e,r){var i=this.gl,n=this.CONTEXT_UID;r=r||0;var o=t._glBuffers[n]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,o.buffer,256*r,256)},t.prototype.update=function(t){var e=this.gl,r=this.CONTEXT_UID,i=t._glBuffers[r];if(t._updateID!==i.updateID)if(i.updateID=t._updateID,e.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),r&&(e||i.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),r=0;r<e.length;r++)this.dispose(this.managedBuffers[e[r]],t)},t.prototype.createGLBuffer=function(t){var e=this.CONTEXT_UID,r=this.gl;return t._glBuffers[e]=new uG(r.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]},t}(),cG=function(t){function e(r){var i=t.call(this,KM.WEBGL,r)||this;return r=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new hU("destroy"),contextChange:new hU("contextChange"),reset:new hU("reset"),update:new hU("update"),postrender:new hU("postrender"),prerender:new hU("prerender"),resize:new hU("resize")},i.runners.contextChange.add(i),i.globalUniforms=new ZU({projectionMatrix:new pL},!0),i.addSystem(GF,"mask").addSystem(rF,"context").addSystem(rG,"state").addSystem(eG,"shader").addSystem(oG,"texture").addSystem(hG,"buffer").addSystem(aF,"geometry").addSystem(oF,"framebuffer").addSystem(XF,"scissor").addSystem(HF,"stencil").addSystem(jF,"projection").addSystem(iG,"textureGC").addSystem(QU,"filter").addSystem(WF,"renderTexture").addSystem(tF,"batch"),i.initPlugins(e.__plugins),i.multisample=void 0,r.context?i.context.initFromContext(r.context):i.context.initFromOptions({alpha:!!i.useContextAlpha,antialias:r.antialias,premultipliedAlpha:i.useContextAlpha&&"notMultiplied"!==i.useContextAlpha,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,wD(2===i.context.webGLVersion?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return fU(e,t),e.create=function(t){if(void 0===CD&&(CD=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:aM.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),CD)return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t,e=this.gl;if(1===this.context.webGLVersion){var r=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,r)}else{r=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,r)}t>=lD.HIGH?this.multisample=lD.HIGH:t>=lD.MEDIUM?this.multisample=lD.MEDIUM:t>=lD.LOW?this.multisample=lD.LOW:this.multisample=lD.NONE},e.prototype.addSystem=function(t,e){var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e){var r,i,n,o;if(e&&(e instanceof LU?(KD("6.0.0","Renderer#render arguments changed, use options instead."),r=e,i=arguments[2],n=arguments[3],o=arguments[4]):(r=e.renderTexture,i=e.clear,n=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(r||(this._lastObjectRendered=t),!o){var s=t.enableTempParent();t.updateTransform(),t.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(e,r,i,n){void 0===r&&(r={});var o=t.prototype.generateTexture.call(this,e,r,i,n);return this.framebuffer.blit(),o},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();t.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return KD("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(aG);function lG(t){return cG.create(t)}var dG="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n",fG=function(){this.texArray=null,this.blend=0,this.type=QM.TRIANGLES,this.start=0,this.size=0,this.data=null},pG=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},t}(),mG=function(){function t(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(t.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),t.prototype.view=function(t){return this[t+"View"]},t.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},t.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},t}(),vG=function(t){function e(e){var r=t.call(this,e)||this;return r.shaderGenerator=null,r.geometryClass=null,r.vertexSize=null,r.state=MF.for2d(),r.size=4*aM.SPRITE_BATCH_SIZE,r._vertexCount=0,r._indexCount=0,r._bufferedElements=[],r._bufferedTextures=[],r._bufferSize=0,r._shader=null,r._packedGeometries=[],r._packedGeometryPoolSize=2,r._flushId=0,r._aBuffers={},r._iBuffers={},r.MAX_TEXTURES=1,r.renderer.on("prerender",r.onPrerender,r),e.runners.contextChange.add(r),r._dcIndex=0,r._aIndex=0,r._iIndex=0,r._attributeBuffer=null,r._indexBuffer=null,r._tempBoundTextures=[],r}return fU(e,t),e.prototype.contextChange=function(){var t=this.renderer.gl;aM.PREFER_ENV===ZM.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),aM.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var r=e.createShader(e.FRAGMENT_SHADER);;){var i=IF.replace(/%forloop%/gi,CF(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,r=e._textureArrayPool,i=this.size/4,n=Math.floor(i/this.MAX_TEXTURES)+1;t.length<i;)t.push(new fG);for(;r.length<n;)r.push(new pG);for(var o=0;o<this.MAX_TEXTURES;o++)this._tempBoundTextures[o]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,r=this.MAX_TEXTURES,i=e._textureArrayPool,n=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++yU._globalBatch,u=0,h=i[0],c=0;n.copyBoundTextures(o,r);for(var l=0;l<this._bufferSize;++l){var d=t[l];t[l]=null,d._batchEnabled!==a&&(h.count>=r&&(n.boundArray(h,o,a,r),this.buildDrawCalls(h,c,l),c=l,h=i[++u],++a),d._batchEnabled=a,d.touched=s,h.elements[h.count++]=d)}h.count>0&&(n.boundArray(h,o,a,r),this.buildDrawCalls(h,c,this._bufferSize),++u,++a);for(l=0;l<o.length;l++)o[l]=null;yU._globalBatch=a},e.prototype.buildDrawCalls=function(t,r,i){var n=this,o=n._bufferedElements,s=n._attributeBuffer,a=n._indexBuffer,u=n.vertexSize,h=e._drawCallPool,c=this._dcIndex,l=this._aIndex,d=this._iIndex,f=h[c];f.start=this._iIndex,f.texArray=t;for(var p=r;p<i;++p){var m=o[p],v=m._texture.baseTexture,_=UD[v.alphaMode?1:0][m.blendMode];o[p]=null,r<p&&f.blend!==_&&(f.size=d-f.start,r=p,(f=h[++c]).texArray=t,f.start=d),this.packInterleavedGeometry(m,s,a,l,d),l+=m.vertexData.length/2*u,d+=m.indices.length,f.blend=_}r<i&&(f.size=d-f.start,++c),this._dcIndex=c,this._aIndex=l,this._iIndex=d},e.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this,e=t._packedGeometries,r=t._attributeBuffer,i=t._indexBuffer;aM.CAN_UPLOAD_SAME_BUFFER?(e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,r=this.renderer,i=r.gl,n=r.state,o=e._drawCallPool,s=null,a=0;a<t;a++){var u=o[a],h=u.texArray,c=u.type,l=u.size,d=u.start,f=u.blend;s!==h&&(s=h,this.bindAndClearTexArray(h)),this.state.blendMode=f,n.set(this.state),i.drawElements(c,l,i.UNSIGNED_SHORT,2*d)}},e.prototype.flush=function(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),aM.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=XD(Math.ceil(t/8)),r=jD(e),i=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);var n=this._aBuffers[i];return n||(this._aBuffers[i]=n=new mG(i*this.vertexSize*4)),n},e.prototype.getIndexBuffer=function(t){var e=XD(Math.ceil(t/12)),r=jD(e),i=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);var n=this._iBuffers[r];return n||(this._iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.packInterleavedGeometry=function(t,e,r,i,n){for(var o=e.uint32View,s=e.float32View,a=i/this.vertexSize,u=t.uvs,h=t.indices,c=t.vertexData,l=t._texture.baseTexture._batchLocation,d=Math.min(t.worldAlpha,1),f=d<1&&t._texture.baseTexture.alphaMode?GD(t._tintRGB,d):t._tintRGB+(255*d<<24),p=0;p<c.length;p+=2)s[i++]=c[p],s[i++]=c[p+1],s[i++]=u[p],s[i++]=u[p+1],o[i++]=f,s[i++]=l;for(p=0;p<h.length;p++)r[n++]=a+h[p]},e._drawCallPool=[],e._textureArrayPool=[],e}($U),_G=function(){function t(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return t.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=ZU.from({uSamplers:e},!0);var i=this.fragTemplate;i=(i=i.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new PF(this.vertexSrc,i)}var n={tint:new Float32Array([1,1,1,1]),translationMatrix:new pL,default:this.defaultGroupCache[t]};return new NF(this.programCache[t],n)},t.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+="if(vTextureId < "+r+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"},t}(),yG=function(t){function e(e){void 0===e&&(e=!1);var r=t.call(this)||this;return r._buffer=new BU(null,e,!1),r._indexBuffer=new BU(null,e,!0),r.addAttribute("aVertexPosition",r._buffer,2,!1,eD.FLOAT).addAttribute("aTextureCoord",r._buffer,2,!1,eD.FLOAT).addAttribute("aColor",r._buffer,4,!0,eD.UNSIGNED_BYTE).addAttribute("aTextureId",r._buffer,1,!0,eD.FLOAT).addIndex(r._indexBuffer),r}return fU(e,t),e}(VU),gG="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vTextureId = aTextureId;\n    vColor = aColor * tint;\n}\n",bG="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n    vec4 color;\n    %forloop%\n    gl_FragColor = color * vColor;\n}\n",TG=function(){function t(){}return t.create=function(t){var e=Object.assign({vertex:gG,fragment:bG,geometryClass:yG,vertexSize:6},t),r=e.vertex,i=e.fragment,n=e.vertexSize,o=e.geometryClass;return function(t){function e(e){var s=t.call(this,e)||this;return s.shaderGenerator=new _G(r,i),s.geometryClass=o,s.vertexSize=n,s}return fU(e,t),e}(vG)},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return gG},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentTemplate",{get:function(){return bG},enumerable:!1,configurable:!0}),t}(),EG=TG.create(),xG=function(){function t(e){var r=this;this.stage=new KL,e=Object.assign({forceCanvas:!1},e),this.renderer=lG(e),t._plugins.forEach((function(t){t.init.call(r,e)}))}return t.registerPlugin=function(e){t._plugins.push(e)},t.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(t.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),t.prototype.destroy=function(e,r){var i=this,n=t._plugins.slice(0);n.reverse(),n.forEach((function(t){t.destroy.call(i)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null},t._plugins=[],t}(),RG=function(){function t(){}return t.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame((function(){return e.resize()})))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){var t,r;if(e.cancelResize(),e._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{var i=e._resizeTo;t=i.clientWidth,r=i.clientHeight}e.renderer.resize(t,r)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},t.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},t}();xG.registerPlugin(RG);var SG=/iPhone/i,AG=/iPod/i,IG=/iPad/i,CG=/\biOS-universal(?:.+)Mac\b/i,OG=/\bAndroid(?:.+)Mobile\b/i,wG=/Android/i,PG=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,NG=/Silk/i,MG=/Windows Phone/i,DG=/\bWindows(?:.+)ARM\b/i,LG=/BlackBerry/i,UG=/BB10/i,FG=/Opera Mini/i,GG=/\b(CriOS|Chrome)(?:.+)Mobile/i,BG=/Mobile(?:.+)Firefox\b/i,kG=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};var XG,HG,jG,VG,YG,WG,zG,ZG,KG,qG,JG,QG,$G,tB,eB,rB,iB,nB,oB,sB=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,i=r.split("[FBAN");void 0!==i[1]&&(r=i[0]),void 0!==(i=r.split("Twitter"))[1]&&(r=i[0]);var n=function(t){return function(e){return e.test(t)}}(r),o={apple:{phone:n(SG)&&!n(MG),ipod:n(AG),tablet:!n(SG)&&(n(IG)||kG(e))&&!n(MG),universal:n(CG),device:(n(SG)||n(AG)||n(IG)||n(CG)||kG(e))&&!n(MG)},amazon:{phone:n(PG),tablet:!n(PG)&&n(NG),device:n(PG)||n(NG)},android:{phone:!n(MG)&&n(PG)||!n(MG)&&n(OG),tablet:!n(MG)&&!n(PG)&&!n(OG)&&(n(NG)||n(wG)),device:!n(MG)&&(n(PG)||n(NG)||n(OG)||n(wG))||n(/\bokhttp\b/i)},windows:{phone:n(MG),tablet:n(DG),device:n(MG)||n(DG)},other:{blackberry:n(LG),blackberry10:n(UG),opera:n(FG),firefox:n(BG),chrome:n(GG),device:n(LG)||n(UG)||n(FG)||n(BG)||n(GG)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(globalThis.navigator);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(XG||(XG={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(HG||(HG={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(jG||(jG={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(VG||(VG={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(YG||(YG={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(WG||(WG={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(zG||(zG={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(ZG||(ZG={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(KG||(KG={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(qG||(qG={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(JG||(JG={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(QG||(QG={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}($G||($G={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(tB||(tB={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(eB||(eB={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(rB||(rB={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(iB||(iB={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(nB||(nB={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(oB||(oB={}));var aB={MIPMAP_TEXTURES:QG.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:nB.NONE,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(sB.tablet||sB.phone){var r;if(sB.apple.device)if(r=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(r[1],10)<11&&(e=!1);if(sB.android.device)if(r=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(r[1],10)<7&&(e=!1)}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:eB.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:JG.CLAMP,SCALE_MODE:qG.LINEAR,PRECISION_VERTEX:rB.HIGH,PRECISION_FRAGMENT:sB.apple.device?rB.HIGH:rB.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!sB.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1,SORTABLE_CHILDREN:!1},uB=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?uL.EMPTY:((t=t||new uL(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,e){var r=t.a,i=t.b,n=t.c,o=t.d,s=t.tx,a=t.ty,u=r*e.x+n*e.y+s,h=i*e.x+o*e.y+a;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)},t.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=o<e?o:e,r=s<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[2])<e?o:e,r=(s=t[3])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[4])<e?o:e,r=(s=t[5])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[6])<e?o:e,r=(s=t[7])<r?s:r,i=o>i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},t.prototype.addFrame=function(t,e,r,i,n){this.addFrameMatrix(t.worldTransform,e,r,i,n)},t.prototype.addFrameMatrix=function(t,e,r,i,n){var o=t.a,s=t.b,a=t.c,u=t.d,h=t.tx,c=t.ty,l=this.minX,d=this.minY,f=this.maxX,p=this.maxY,m=o*e+a*r+h,v=s*e+u*r+c;l=m<l?m:l,d=v<d?v:d,f=m>f?m:f,p=v>p?v:p,l=(m=o*i+a*r+h)<l?m:l,d=(v=s*i+u*r+c)<d?v:d,f=m>f?m:f,p=v>p?v:p,l=(m=o*e+a*n+h)<l?m:l,d=(v=s*e+u*n+c)<d?v:d,f=m>f?m:f,p=v>p?v:p,l=(m=o*i+a*n+h)<l?m:l,d=(v=s*i+u*n+c)<d?v:d,f=m>f?m:f,p=v>p?v:p,this.minX=l,this.minY=d,this.maxX=f,this.maxY=p},t.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;a<r;a+=2){var u=t[a],h=t[a+1];i=u<i?u:i,n=h<n?h:n,o=u>o?u:o,s=h>s?h:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},t.prototype.addVertices=function(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)},t.prototype.addVerticesMatrix=function(t,e,r,i,n,o){void 0===n&&(n=0),void 0===o&&(o=n);for(var s=t.a,a=t.b,u=t.c,h=t.d,c=t.tx,l=t.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,v=r;v<i;v+=2){var _=e[v],y=e[v+1],g=s*_+u*y+c,b=h*y+a*_+l;d=Math.min(d,g-n),p=Math.max(p,g+n),f=Math.min(f,b-o),m=Math.max(m,b+o)}this.minX=d,this.minY=f,this.maxX=p,this.maxY=m},t.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<r?t.minY:r,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},t.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=n&&i<=o){var s=this.minX,a=this.minY,u=this.maxX,h=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>u?n:u,this.maxY=o>h?o:h}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=n&&i<=o){var s=this.minX,a=this.minY,u=this.maxX,h=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>u?n:u,this.maxY=o>h?o:h}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,r,i,n,o){t-=n,e-=o,r+=n,i+=o,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>r?this.maxX:r,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>i?this.maxY:i},t}(),hB=function(t,e){return hB=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},hB(t,e)};function cB(t,e){function r(){this.constructor=t}hB(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var lB,dB,fB,pB,mB,vB,_B,yB,gB,bB,TB,EB,xB,RB,SB,AB,IB,CB,OB,wB=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new xL,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new uB,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return cB(e,t),e.mixin=function(t){for(var r=Object.keys(t),i=0;i<r.length;++i){var n=r[i];Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t,n))}},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new uL),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new uL),t=this._localBoundsRect),this._localBounds||(this._localBounds=new uB);var e=this.transform,r=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var i=this._bounds,n=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=r,this.transform=e,this._bounds=i,this._bounds.updateID+=this._boundsID-n,o},e.prototype.toGlobal=function(t,e,r){return void 0===r&&(r=!1),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,r,i){return e&&(t=e.toGlobal(t,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,r,i,n,o,s,a,u){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===u&&(u=0),this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=n,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=u,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new PB),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*nL},set:function(t){this.transform.rotation=t*oL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){if(this._mask!==t){var e;if(this._mask)(e=this._mask.maskObject||this._mask)._maskRefCount--,0===e._maskRefCount&&(e.renderable=!0,e.isMask=!1);if(this._mask=t,this._mask)0===(e=this._mask.maskObject||this._mask)._maskRefCount&&(e.renderable=!1,e.isMask=!0),e._maskRefCount++}},enumerable:!1,configurable:!0}),e}(hM),PB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return cB(e,t),e}(wB);function NB(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}wB.prototype.displayObjectUpdateTransform=wB.prototype.updateTransform,function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(lB||(lB={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(dB||(dB={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(fB||(fB={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(pB||(pB={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(mB||(mB={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(vB||(vB={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(_B||(_B={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(yB||(yB={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(gB||(gB={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(bB||(bB={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(TB||(TB={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(EB||(EB={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(xB||(xB={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(RB||(RB={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(SB||(SB={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(AB||(AB={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(IB||(IB={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(CB||(CB={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(OB||(OB={}));var MB=function(t){function e(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=aB.SORTABLE_CHILDREN,e.sortDirty=!1,e}return cB(e,t),e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var i=0;i<e.length;i++)this.addChild(e[i]);else{var n=e[0];n.parent&&n.parent.removeChild(n),n.parent=this,this.sortDirty=!0,n.transform._parentID=-1,this.children.push(n),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this)}return e[0]},e.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}},e.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);VD(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var i=0;i<e.length;i++)this.removeChild(e[i]);else{var n=e[0],o=this.children.indexOf(n);if(-1===o)return null;n.parent=null,n.transform._parentID=-1,VD(this.children,o,1),this._boundsID++,this.onChildrenChange(o),n.emit("removed",this),this.emit("childRemoved",n,this,o)}return e[0]},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,VD(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var r,i=t,n=e-i;if(n>0&&n<=e){r=this.children.splice(i,n);for(var o=0;o<r.length;++o)r[o].parent=null,r[o].transform&&(r[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(o=0;o<r.length;++o)r[o].emit("removed",this),this.emit("childRemoved",r[o],this,o);return r}if(0===n&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,r=this.children.length;e<r;++e){var i=this.children[e];i._lastSortedIndex=e,t||0===i.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(NB),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var r=this.children[t];r.visible&&r.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var r=e._mask.maskObject||e._mask;r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(e,r){void 0===r&&(r=!1);var i=t.prototype.getLocalBounds.call(this,e);if(!r)for(var n=0,o=this.children.length;n<o;++n){var s=this.children[n];s.visible&&s.updateTransform()}return i},e.prototype._calculateBounds=function(){},e.prototype._renderWithCulling=function(t){var r=t.renderTexture.sourceFrame;if(r.width>0&&r.height>0){var i,n;if(this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==e.prototype._render&&(i=this.getBounds(!0)),i&&r.intersects(i,n))this._render(t);else if(this.cullArea)return;for(var o=0,s=this.children.length;o<s;++o){var a=this.children[o],u=a.cullable;a.cullable=u||!this.cullArea,a.render(t),a.cullable=u}}},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){var e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var i=0;i<e.length;i++)e[i].enabled&&this._enabledFilters.push(e[i])}var n=e&&this._enabledFilters&&this._enabledFilters.length||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==IB.NONE));if(n&&t.batch.flush(),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);i=0;for(var o=this.children.length;i<o;++i)this.children[i].render(t)}n&&t.batch.flush(),r&&t.mask.pop(this),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var r="boolean"==typeof e?e:e&&e.children,i=this.removeChildren(0,this.children.length);if(r)for(var n=0;n<i.length;++n)i[n].destroy(e)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},enumerable:!1,configurable:!0}),e}(wB);MB.prototype.containerUpdateTransform=MB.prototype.updateTransform;var DB=new uL,LB=function(){function t(t){this.renderer=t}return t.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},t.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},t.prototype.canvas=function(e){var r,i,n,o=this.renderer,s=!1,a=!1;e&&(e instanceof LU?n=e:(n=this.renderer.generateTexture(e),a=!0)),n?(r=n.baseTexture.resolution,i=n.frame,s=!1,o.renderTexture.bind(n)):(r=this.renderer.resolution,s=!0,(i=DB).width=this.renderer.width,i.height=this.renderer.height,o.renderTexture.bind(null));var u=Math.floor(i.width*r+1e-4),h=Math.floor(i.height*r+1e-4),c=new tL(u,h,1),l=new Uint8Array(4*u*h),d=o.gl;d.readPixels(i.x*r,i.y*r,u,h,d.RGBA,d.UNSIGNED_BYTE,l);var f=c.context.getImageData(0,0,u,h);if(t.arrayPostDivide(l,f.data),c.context.putImageData(f,0,0),s){var p=new tL(c.width,c.height,1);p.context.scale(1,-1),p.context.drawImage(c.canvas,0,-h),c.destroy(),c=p}return a&&n.destroy(!0),c.canvas},t.prototype.pixels=function(e,r){var i,n,o,s=this.renderer,a=!1;e&&(e instanceof LU?o=e:e instanceof wB&&(o=this.renderer.generateTexture(e),a=!0)),o?r?(i=r.resolution,n=o.frame,s.renderTexture.bind(o)):(i=o.baseTexture.resolution,n=o.frame,s.renderTexture.bind(o)):r?(i=r.resolution,(n=DB).width=r.width,n.height=r.height,s.renderTexture.bind(null)):(i=s.resolution,(n=DB).width=s.width,n.height=s.height,s.renderTexture.bind(null));var u=n.width*i,h=n.height*i,c=new Uint8Array(4*u*h),l=s.gl;return l.readPixels(n.x*i,n.y*i,u,h,l.RGBA,l.UNSIGNED_BYTE,c),a&&o.destroy(!0),t.arrayPostDivide(c,c),c},t.prototype.destroy=function(){this.renderer=null},t.arrayPostDivide=function(t,e){for(var r=0;r<t.length;r+=4){var i=e[r+3]=t[r+3];0!==i?(e[r]=Math.round(Math.min(255*t[r]/i,255)),e[r+1]=Math.round(Math.min(255*t[r+1]/i,255)),e[r+2]=Math.round(Math.min(255*t[r+2]/i,255))):(e[r]=t[r],e[r+1]=t[r+1],e[r+2]=t[r+2])}},t}(),UB=function(){function t(t,e,r){void 0===e&&(e=!1),this._fn=t,this._once=e,this._thisArg=r,this._next=this._prev=this._owner=null}return t.prototype.detach=function(){return null!==this._owner&&(this._owner.detach(this),!0)},t}();function FB(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var GB,BB=function(){function t(){this._head=this._tail=void 0}return t.prototype.handlers=function(t){void 0===t&&(t=!1);var e=this._head;if(t)return!!e;for(var r=[];e;)r.push(e),e=e._next;return r},t.prototype.has=function(t){if(!(t instanceof UB))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return t._owner===this},t.prototype.dispatch=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];var i=this._head;if(!i)return!1;for(;i;)i._once&&this.detach(i),i._fn.apply(i._thisArg,e),i=i._next;return!0},t.prototype.add=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return FB(this,new UB(t,!1,e))},t.prototype.once=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return FB(this,new UB(t,!0,e))},t.prototype.detach=function(t){if(!(t instanceof UB))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return t._owner!==this||(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null),this},t.prototype.detachAll=function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this},t}();function kB(t,e){e=e||{};for(var r={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=r.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[r.key[o]]=i[o]||"";return n[r.q.name]={},n[r.key[12]].replace(r.q.parser,(function(t,e,i){e&&(n[r.q.name][e]=i)})),n}var XB=null;function HB(){}function jB(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function VB(t){return t.toString().replace("object ","")}var YB=function(){function t(e,r,i){if(this._dequeue=HB,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,"string"!=typeof e||"string"!=typeof r)throw new Error("Both name and url are required for constructing a resource.");i=i||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===r.indexOf("data:")),this.name=e,this.url=r,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===i.crossOrigin?"anonymous":i.crossOrigin,this.timeout=i.timeout||0,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=HB,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new BB,this.onProgress=new BB,this.onComplete=new BB,this.onAfterMiddleware=new BB}return t.setExtensionLoadType=function(e,r){jB(t._loadTypeMap,e,r)},t.setExtensionXhrType=function(e,r){jB(t._xhrTypeMap,e,r)},Object.defineProperty(t.prototype,"isDataUrl",{get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isComplete",{get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),t.prototype.complete=function(){this._clearEvents(),this._finish()},t.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},t.prototype.load=function(e){var r=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout((function(){return e(r)}),1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:void 0===GB&&(GB=!(!globalThis.XDomainRequest||"withCredentials"in new XMLHttpRequest)),GB&&this.crossOrigin?this._loadXdr():this._loadXhr()}},t.prototype._hasFlag=function(t){return 0!=(this._flags&t)},t.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},t.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},t.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},t.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==globalThis.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},t.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==globalThis.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(t,this.url[r],Array.isArray(e)?e[r]:e));else{e=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(e)?e[0]:e))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},t.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;"use-credentials"===this.crossOrigin&&(e.withCredentials=!0),e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},t.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new globalThis.XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout((function(){return t.send()}),1)},t.prototype._createSource=function(t,e,r){r||(r=t+"/"+this._getExtension(e));var i=document.createElement("source");return i.src=e,i.type=r,i},t.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},t.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},t.prototype._onTimeout=function(){this.abort("Load timed out.")},t.prototype._xhrOnError=function(){var t=this.xhr;this.abort(VB(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},t.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(VB(t)+" Request timed out.")},t.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(VB(t)+" Request was aborted by the user.")},t.prototype._xhrOnLoad=function(){var e=this.xhr,r="",i=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(r=e.responseText),0===i&&(r.length>0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,XB||(XB=document.createElement("a")),XB.href=t;var r=kB(XB.href,{strictMode:!0}),i=!r.port&&""===e.port||r.port===e.port,n=r.protocol?r.protocol+":":"";return r.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(t){void 0===t&&(t=this.url);var e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},t}();function WB(){}function zB(t){return function(){for(var e=arguments,r=[],i=0;i<arguments.length;i++)r[i]=e[i];if(null===t)throw new Error("Callback was already called.");var n=t;t=null,n.apply(this,r)}}!function(t){var e,r,i,n;(e=t.STATUS_FLAGS||(t.STATUS_FLAGS={}))[e.NONE=0]="NONE",e[e.DATA_URL=1]="DATA_URL",e[e.COMPLETE=2]="COMPLETE",e[e.LOADING=4]="LOADING",(r=t.TYPE||(t.TYPE={}))[r.UNKNOWN=0]="UNKNOWN",r[r.JSON=1]="JSON",r[r.XML=2]="XML",r[r.IMAGE=3]="IMAGE",r[r.AUDIO=4]="AUDIO",r[r.VIDEO=5]="VIDEO",r[r.TEXT=6]="TEXT",(i=t.LOAD_TYPE||(t.LOAD_TYPE={}))[i.XHR=1]="XHR",i[i.IMAGE=2]="IMAGE",i[i.AUDIO=3]="AUDIO",i[i.VIDEO=4]="VIDEO",(n=t.XHR_RESPONSE_TYPE||(t.XHR_RESPONSE_TYPE={})).DEFAULT="text",n.BUFFER="arraybuffer",n.BLOB="blob",n.DOCUMENT="document",n.JSON="json",n.TEXT="text",t._loadTypeMap={gif:t.LOAD_TYPE.IMAGE,png:t.LOAD_TYPE.IMAGE,bmp:t.LOAD_TYPE.IMAGE,jpg:t.LOAD_TYPE.IMAGE,jpeg:t.LOAD_TYPE.IMAGE,tif:t.LOAD_TYPE.IMAGE,tiff:t.LOAD_TYPE.IMAGE,webp:t.LOAD_TYPE.IMAGE,tga:t.LOAD_TYPE.IMAGE,svg:t.LOAD_TYPE.IMAGE,"svg+xml":t.LOAD_TYPE.IMAGE,mp3:t.LOAD_TYPE.AUDIO,ogg:t.LOAD_TYPE.AUDIO,wav:t.LOAD_TYPE.AUDIO,mp4:t.LOAD_TYPE.VIDEO,webm:t.LOAD_TYPE.VIDEO},t._xhrTypeMap={xhtml:t.XHR_RESPONSE_TYPE.DOCUMENT,html:t.XHR_RESPONSE_TYPE.DOCUMENT,htm:t.XHR_RESPONSE_TYPE.DOCUMENT,xml:t.XHR_RESPONSE_TYPE.DOCUMENT,tmx:t.XHR_RESPONSE_TYPE.DOCUMENT,svg:t.XHR_RESPONSE_TYPE.DOCUMENT,tsx:t.XHR_RESPONSE_TYPE.DOCUMENT,gif:t.XHR_RESPONSE_TYPE.BLOB,png:t.XHR_RESPONSE_TYPE.BLOB,bmp:t.XHR_RESPONSE_TYPE.BLOB,jpg:t.XHR_RESPONSE_TYPE.BLOB,jpeg:t.XHR_RESPONSE_TYPE.BLOB,tif:t.XHR_RESPONSE_TYPE.BLOB,tiff:t.XHR_RESPONSE_TYPE.BLOB,webp:t.XHR_RESPONSE_TYPE.BLOB,tga:t.XHR_RESPONSE_TYPE.BLOB,json:t.XHR_RESPONSE_TYPE.JSON,text:t.XHR_RESPONSE_TYPE.TEXT,txt:t.XHR_RESPONSE_TYPE.TEXT,ttf:t.XHR_RESPONSE_TYPE.BUFFER,otf:t.XHR_RESPONSE_TYPE.BUFFER},t.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}(YB||(YB={}));var ZB=function(t,e){this.data=t,this.callback=e},KB=function(){function t(t,e){var r=this;if(void 0===e&&(e=1),this.workers=0,this.saturated=WB,this.unsaturated=WB,this.empty=WB,this.drain=WB,this.error=WB,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(t,e,i){if(i&&"function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,null==t&&r.idle())setTimeout((function(){return r.drain()}),1);else{var n=new ZB(t,"function"==typeof i?i:WB);e?r._tasks.unshift(n):r._tasks.push(n),setTimeout(r.process,1)}},this.process=function(){for(;!r.paused&&r.workers<r.concurrency&&r._tasks.length;){var t=r._tasks.shift();0===r._tasks.length&&r.empty(),r.workers+=1,r.workers===r.concurrency&&r.saturated(),r._worker(t.data,zB(r._next(t)))}},this._worker=t,0===e)throw new Error("Concurrency must not be zero");this.concurrency=e,this.buffer=e/4}return t.prototype._next=function(t){var e=this;return function(){for(var r=arguments,i=[],n=0;n<arguments.length;n++)i[n]=r[n];e.workers-=1,t.callback.apply(t,i),null!=i[0]&&e.error(i[0],t.data),e.workers<=e.concurrency-e.buffer&&e.unsaturated(),e.idle()&&e.drain(),e.process()}},t.prototype.push=function(t,e){this._insert(t,!1,e)},t.prototype.kill=function(){this.workers=0,this.drain=WB,this.started=!1,this._tasks=[]},t.prototype.unshift=function(t,e){this._insert(t,!0,e)},t.prototype.length=function(){return this._tasks.length},t.prototype.running=function(){return this.workers},t.prototype.idle=function(){return this._tasks.length+this.workers===0},t.prototype.pause=function(){!0!==this.paused&&(this.paused=!0)},t.prototype.resume=function(){if(!1!==this.paused){this.paused=!1;for(var t=1;t<=this.concurrency;t++)this.process()}},t.eachSeries=function(t,e,r,i){var n=0,o=t.length;!function s(a){a||n===o?r&&r(a):i?setTimeout((function(){e(t[n++],s)}),1):e(t[n++],s)}()},t.queue=function(e,r){return new t(e,r)},t}(),qB=/(#[\w-]+)?$/,JB=function(){function t(e,r){var i=this;void 0===e&&(e=""),void 0===r&&(r=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return i._loadResource(t,e)},this.resources={},this.baseUrl=e,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return i._loadResource(t,e)},this._queue=KB.queue(this._boundLoadResource,r),this._queue.pause(),this.resources={},this.onProgress=new BB,this.onError=new BB,this.onLoad=new BB,this.onStart=new BB,this.onComplete=new BB;for(var n=0;n<t._plugins.length;++n){var o=t._plugins[n],s=o.pre,a=o.use;s&&this.pre(s),a&&this.use(a)}this._protected=!1}return t.prototype._add=function(t,e,r,i){if(this.loading&&(!r||!r.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new YB(t,e,r),"function"==typeof i&&this.resources[t].onAfterMiddleware.once(i),this.loading){for(var n=r.parentResource,o=[],s=0;s<n.children.length;++s)n.children[s].isComplete||o.push(n.children[s]);var a=n.progressChunk*(o.length+1)/(o.length+2);n.children.push(this.resources[t]),n.progressChunk=a;for(s=0;s<o.length;++s)o[s].progressChunk=a;this.resources[t].progressChunk=a}return this._queue.push(this.resources[t]),this},t.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},t.prototype.use=function(t){return this._afterMiddleware.push(t),this},t.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort("loader reset")}return this.resources={},this},t.prototype.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,r=0;r<this._queue._tasks.length;++r)this._queue._tasks[r].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},Object.defineProperty(t.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t},enumerable:!1,configurable:!0}),t.prototype._prepareUrl=function(t){var e,r=kB(t,{strictMode:!0});if(e=r.protocol||!r.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var i=qB.exec(e)[0];-1!==(e=e.slice(0,e.length-i.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=i}return e},t.prototype._loadResource=function(t,e){var r=this;t._dequeue=e,KB.eachSeries(this._beforeMiddleware,(function(e,i){e.call(r,t,(function(){i(t.isComplete?{}:null)}))}),(function(){t.isComplete?r._onLoad(t):(t._onLoadBinding=t.onComplete.once(r._onLoad,r),t.load())}),!0)},t.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},t.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},t.prototype._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),KB.eachSeries(this._afterMiddleware,(function(r,i){r.call(e,t,i)}),(function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()}),!0)},t.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(t,"shared",{get:function(){var e=t._shared;return e||((e=new t)._protected=!0,t._shared=e),e},enumerable:!1,configurable:!0}),t.registerPlugin=function(e){return t._plugins.push(e),e.add&&e.add(),t},t._plugins=[],t}();JB.prototype.add=function(t,e,r,i){if(Array.isArray(t)){for(var n=0;n<t.length;++n)this.add(t[n]);return this}if("object"==typeof t&&(r=t,i=e||r.callback||r.onComplete,e=r.url,t=r.name||r.key||r.url),"string"!=typeof e&&(i=r,r=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");return"function"==typeof r&&(i=r,r=null),this._add(t,e,r,i)};var QB,$B,tk=function(){function t(){}return t.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?JB.shared:new JB},t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t}(),ek=function(){function t(){}return t.add=function(){YB.setExtensionLoadType("svg",YB.LOAD_TYPE.XHR),YB.setExtensionXhrType("svg",YB.XHR_RESPONSE_TYPE.TEXT)},t.use=function(t,e){if(!t.data||t.type!==YB.TYPE.IMAGE&&"svg"!==t.extension)e();else{var r=t.data,i=t.url,n=t.name,o=t.metadata;DU.fromLoader(r,i,n,o).then((function(r){t.texture=r,e()})).catch(e)}},t}();JB.registerPlugin({use:function(t,e){if(t.data){if(t.xhr&&t.xhrType===YB.XHR_RESPONSE_TYPE.BLOB)if(self.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var r=globalThis.URL||globalThis.webkitURL,i=r.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=i,t.type=YB.TYPE.IMAGE,void(t.data.onload=function(){r.revokeObjectURL(i),t.data.onload=null,e()})}}else{var n=t.xhr.getResponseHeader("content-type");if(n&&0===n.indexOf("image"))return t.data=new Image,t.data.src="data:"+n+";base64,"+function(t){for(var e="",r=0;r<t.length;){for(var i=[0,0,0],n=[0,0,0,0],o=0;o<i.length;++o)r<t.length?i[o]=255&t.charCodeAt(r++):i[o]=0;switch(n[0]=i[0]>>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(o=0;o<n.length;++o)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n[o])}return e}(t.xhr.responseText),t.type=YB.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}}),JB.registerPlugin(ek),function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL"}($B||($B={}));var rk=((QB={})[$B.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,QB[$B.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,QB[$B.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,QB[$B.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,QB[$B.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,QB[$B.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,QB[$B.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,QB[$B.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,QB[$B.COMPRESSED_R11_EAC]=.5,QB[$B.COMPRESSED_SIGNED_R11_EAC]=.5,QB[$B.COMPRESSED_RG11_EAC]=1,QB[$B.COMPRESSED_SIGNED_RG11_EAC]=1,QB[$B.COMPRESSED_RGB8_ETC2]=.5,QB[$B.COMPRESSED_RGBA8_ETC2_EAC]=1,QB[$B.COMPRESSED_SRGB8_ETC2]=.5,QB[$B.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,QB[$B.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,QB[$B.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,QB[$B.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,QB[$B.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,QB[$B.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,QB[$B.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,QB[$B.COMPRESSED_RGB_ETC1_WEBGL]=.5,QB[$B.COMPRESSED_RGB_ATC_WEBGL]=.5,QB[$B.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,QB[$B.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,QB),ik=function(t,e){return ik=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},ik(t,e)};function nk(t,e){function r(){this.constructor=t}ik(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function ok(t,e){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var sk,ak,uk=function(t){function e(e,r){void 0===r&&(r={width:1,height:1,autoLoad:!0});var i,n,o=this;return"string"==typeof e?(i=e,n=new Uint8Array):(i=null,n=e),(o=t.call(this,n,r)||this).origin=i,o.buffer=n?new mG(n):null,o.origin&&!1!==r.autoLoad&&o.load(),n&&n.length&&(o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),o}return nk(e,t),e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return t=this,e=void 0,i=function(){var t;return ok(this,(function(e){switch(e.label){case 0:return[4,fetch(this.origin)];case 1:return[4,e.sent().blob()];case 2:return[4,e.sent().arrayBuffer()];case 3:return t=e.sent(),this.data=new Uint32Array(t),this.buffer=new mG(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),[2,this]}}))},new((r=Promise)||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){t.done?n(t.value):new r((function(e){e(t.value)})).then(s,a)}u((i=i.apply(t,e||[])).next())}));var t,e,r,i},e}(vU),hk=function(t){function e(r,i){var n=t.call(this,r,i)||this;return n.format=i.format,n.levels=i.levels||1,n._width=i.width,n._height=i.height,n._extension=e._formatToExtension(n.format),(i.levelBuffers||n.buffer)&&(n._levelBuffers=i.levelBuffers||e._createLevelBuffers(r instanceof Uint8Array?r:n.buffer.uint8View,n.format,n.levels,4,4,n.width,n.height)),n}return nk(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;if(!t.context.extensions[this._extension])throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var n=0,o=this.levels;n<o;n++){var s=this._levelBuffers[n],a=s.levelID,u=s.levelWidth,h=s.levelHeight,c=s.levelBuffer;i.compressedTexImage2D(i.TEXTURE_2D,a,this.format,u,h,0,c)}return!0},e.prototype.onBlobLoaded=function(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},e._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,e,r,i,n,o,s){for(var a=new Array(r),u=t.byteOffset,h=o,c=s,l=h+i-1&~(i-1),d=c+n-1&~(n-1),f=l*d*rk[e],p=0;p<r;p++)a[p]={levelID:p,levelWidth:r>1?h:l,levelHeight:r>1?c:d,levelBuffer:new Uint8Array(t.buffer,u,f)},u+=f,f=(l=(h=h>>1||1)+i-1&~(i-1))*(d=(c=c>>1||1)+n-1&~(n-1))*rk[e];return a},e}(uk),ck=function(){function t(){}return t.use=function(e,r){var i=e.data;if(e.type===YB.TYPE.JSON&&i&&i.cacheID&&i.textures){for(var n=i.textures,o=void 0,s=void 0,a=0,u=n.length;a<u;a++){var h=n[a],c=h.src,l=h.format;if(l||(s=c),t.textureFormats[l]){o=c;break}}if(!(o=o||s))return void r(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));if(o===e.url)return void r(new Error("URL of compressed texture cannot be the same as the manifest's URL"));var d={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},f=ID.resolve(e.url.replace(this.baseUrl,""),o),p=i.cacheID;this.add(p,f,d,(function(t){if(t.error)r(t.error);else{var i=t.texture,n=void 0===i?null:i,o=t.textures,s=void 0===o?{}:o;Object.assign(e,{texture:n,textures:s}),r()}}))}else r()},Object.defineProperty(t,"textureExtensions",{get:function(){if(!t._textureExtensions){var e=document.createElement("canvas").getContext("webgl");if(!e)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var r={s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};t._textureExtensions=r}return t._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(t,"textureFormats",{get:function(){if(!t._textureFormats){var e=t.textureExtensions;for(var r in t._textureFormats={},e){var i=e[r];i&&Object.assign(t._textureFormats,Object.getPrototypeOf(i))}}return t._textureFormats},enumerable:!1,configurable:!0}),t}();function lk(t,e,r){var i={textures:{},texture:null};return e?(e.map((function(t){return new DU(new yU(t,Object.assign({mipmap:oD.OFF,alphaMode:sD.NO_PREMULTIPLIED_ALPHA},r)))})).forEach((function(e,r){var n=e.baseTexture,o=t+"-"+(r+1);yU.addToCache(n,o),DU.addToCache(e,o),0===r&&(yU.addToCache(n,t),DU.addToCache(e,t),i.texture=e),i.textures[o]=e})),i):i}YB.setExtensionXhrType("dds",YB.XHR_RESPONSE_TYPE.BUFFER);var dk,fk,pk=124,mk=3,vk=4,_k=7,yk=19,gk=2,bk=0,Tk=1,Ek=2,xk=3;!function(t){t[t.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",t[t.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",t[t.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",t[t.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",t[t.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",t[t.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",t[t.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",t[t.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",t[t.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",t[t.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",t[t.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",t[t.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",t[t.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",t[t.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",t[t.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",t[t.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",t[t.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",t[t.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",t[t.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",t[t.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",t[t.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",t[t.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",t[t.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",t[t.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",t[t.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",t[t.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",t[t.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",t[t.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",t[t.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",t[t.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",t[t.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",t[t.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",t[t.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",t[t.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",t[t.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",t[t.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",t[t.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",t[t.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",t[t.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",t[t.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",t[t.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",t[t.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",t[t.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",t[t.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",t[t.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",t[t.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",t[t.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",t[t.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",t[t.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",t[t.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",t[t.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",t[t.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",t[t.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",t[t.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",t[t.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",t[t.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",t[t.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",t[t.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",t[t.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",t[t.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",t[t.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",t[t.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",t[t.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",t[t.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",t[t.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",t[t.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",t[t.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",t[t.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",t[t.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",t[t.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",t[t.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",t[t.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",t[t.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",t[t.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",t[t.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",t[t.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",t[t.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",t[t.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",t[t.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",t[t.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",t[t.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",t[t.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",t[t.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",t[t.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",t[t.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",t[t.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",t[t.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",t[t.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",t[t.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",t[t.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",t[t.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",t[t.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",t[t.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",t[t.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",t[t.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",t[t.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",t[t.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",t[t.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",t[t.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",t[t.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",t[t.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",t[t.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",t[t.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",t[t.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",t[t.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",t[t.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",t[t.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",t[t.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",t[t.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",t[t.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",t[t.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",t[t.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"}(dk||(dk={})),function(t){t[t.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",t[t.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",t[t.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"}(fk||(fk={}));var Rk,Sk,Ak,Ik=((sk={})[827611204]=$B.COMPRESSED_RGBA_S3TC_DXT1_EXT,sk[861165636]=$B.COMPRESSED_RGBA_S3TC_DXT3_EXT,sk[894720068]=$B.COMPRESSED_RGBA_S3TC_DXT5_EXT,sk),Ck=((ak={})[dk.DXGI_FORMAT_BC1_TYPELESS]=$B.COMPRESSED_RGBA_S3TC_DXT1_EXT,ak[dk.DXGI_FORMAT_BC1_UNORM]=$B.COMPRESSED_RGBA_S3TC_DXT1_EXT,ak[dk.DXGI_FORMAT_BC2_TYPELESS]=$B.COMPRESSED_RGBA_S3TC_DXT3_EXT,ak[dk.DXGI_FORMAT_BC2_UNORM]=$B.COMPRESSED_RGBA_S3TC_DXT3_EXT,ak[dk.DXGI_FORMAT_BC3_TYPELESS]=$B.COMPRESSED_RGBA_S3TC_DXT5_EXT,ak[dk.DXGI_FORMAT_BC3_UNORM]=$B.COMPRESSED_RGBA_S3TC_DXT5_EXT,ak[dk.DXGI_FORMAT_BC1_UNORM_SRGB]=$B.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,ak[dk.DXGI_FORMAT_BC2_UNORM_SRGB]=$B.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,ak[dk.DXGI_FORMAT_BC3_UNORM_SRGB]=$B.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,ak),Ok=function(){function t(){}return t.use=function(e,r){if("dds"===e.extension&&e.data)try{Object.assign(e,lk(e.name||e.url,t.parse(e.data),e.metadata))}catch(t){return void r(t)}r()},t.parse=function(t){var e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");var r=new Uint32Array(t,0,pk/Uint32Array.BYTES_PER_ELEMENT),i=r[mk],n=r[vk],o=r[_k],s=new Uint32Array(t,yk*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),a=s[1];if(4&a){var u=s[gk];if(808540228!==u){var h=Ik[u],c=new Uint8Array(t,128);return[new hk(c,{format:h,width:n,height:i,levels:o})]}var l=new Uint32Array(e.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),d=l[bk],f=l[Tk],p=l[Ek],m=l[xk],v=Ck[d];if(void 0===v)throw new Error("DDSLoader cannot parse texture data with DXGI format "+d);if(4===p)throw new Error("DDSLoader does not support cubemap textures");if(f===fk.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSLoader does not supported 3D texture data");var _=new Array;if(1===m)_.push(new Uint8Array(t,148));else{for(var y=rk[v],g=0,b=n,T=i,E=0;E<o;E++){g+=Math.max(1,b+3&-4)*Math.max(1,T+3&-4)*y,b>>>=1,T>>>=1}var x=148;for(E=0;E<m;E++)_.push(new Uint8Array(t,x,g)),x+=g}return _.map((function(t){return new hk(t,{format:v,width:n,height:i,levels:o})}))}if(64&a)throw new Error("DDSLoader does not support uncompressed texture data.");if(512&a)throw new Error("DDSLoader does not supported YUV uncompressed texture data.");if(131072&a)throw new Error("DDSLoader does not support single-channel (lumninance) texture data!");if(2&a)throw new Error("DDSLoader does not support single-channel (alpha) texture data!");throw new Error("DDSLoader failed to load a texture file due to an unknown reason!")},t}();YB.setExtensionXhrType("ktx",YB.XHR_RESPONSE_TYPE.BUFFER);var wk=[171,75,84,88,32,49,49,187,13,10,26,10],Pk=12,Nk=16,Mk=24,Dk=28,Lk=36,Uk=40,Fk=44,Gk=48,Bk=52,kk=56,Xk=60,Hk=((Rk={})[eD.UNSIGNED_BYTE]=1,Rk[eD.UNSIGNED_SHORT]=2,Rk[eD.INT]=4,Rk[eD.UNSIGNED_INT]=4,Rk[eD.FLOAT]=4,Rk[eD.HALF_FLOAT]=8,Rk),jk=((Sk={})[$M.RGBA]=4,Sk[$M.RGB]=3,Sk[$M.RG]=2,Sk[$M.RED]=1,Sk[$M.LUMINANCE]=1,Sk[$M.LUMINANCE_ALPHA]=2,Sk[$M.ALPHA]=1,Sk),Vk=((Ak={})[eD.UNSIGNED_SHORT_4_4_4_4]=2,Ak[eD.UNSIGNED_SHORT_5_5_5_1]=2,Ak[eD.UNSIGNED_SHORT_5_6_5]=2,Ak),Yk=function(){function t(){}return t.use=function(e,r){if("ktx"===e.extension&&e.data)try{var i=e.name||e.url,n=t.parse(i,e.data),o=n.compressed,s=n.uncompressed,a=n.kvData;if(o){var u=lk(i,o,e.metadata);if(a&&u.textures)for(var h in u.textures)u.textures[h].baseTexture.ktxKeyValueData=a;Object.assign(e,u)}else if(s){var c={};s.forEach((function(t,e){var r=new DU(new yU(t.resource,{mipmap:oD.OFF,alphaMode:sD.NO_PREMULTIPLIED_ALPHA,type:t.type,format:t.format})),n=i+"-"+(e+1);a&&(r.baseTexture.ktxKeyValueData=a),yU.addToCache(r.baseTexture,n),DU.addToCache(r,n),0===e&&(c[i]=r,yU.addToCache(r.baseTexture,i),DU.addToCache(r,i)),c[n]=r})),Object.assign(e,{textures:c})}}catch(t){return void r(t)}r()},t.parse=function(e,r){var i=new DataView(r);if(!t.validate(e,i))return null;var n=67305985===i.getUint32(Pk,!0),o=i.getUint32(Nk,n),s=i.getUint32(Mk,n),a=i.getUint32(Dk,n),u=i.getUint32(Lk,n),h=i.getUint32(Uk,n)||1,c=i.getUint32(Fk,n)||1,l=i.getUint32(Gk,n)||1,d=i.getUint32(Bk,n),f=i.getUint32(kk,n),p=i.getUint32(Xk,n);if(0===h||1!==c)throw new Error("Only 2D textures are supported");if(1!==d)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==l)throw new Error("WebGL does not support array textures");var m,v=u+3&-4,_=h+3&-4,y=new Array(l),g=u*h;if(0===o&&(g=v*_),void 0===(m=0!==o?Hk[o]?Hk[o]*jk[s]:Vk[o]:rk[a]))throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var b=t.loadKeyValueData?t.parseKvData(i,p,n):null,T=g*m,E=u,x=h,R=v,S=_,A=64+p,I=0;I<f;I++){for(var C=i.getUint32(A,n),O=A+4,w=0;w<l;w++){var P=y[w];P||(P=y[w]=new Array(f)),P[I]={levelID:I,levelWidth:f>1||0!==o?E:R,levelHeight:f>1||0!==o?x:S,levelBuffer:new Uint8Array(r,O,T)},O+=T}A=(A+=C+4)%4!=0?A+4-A%4:A,T=(R=(E=E>>1||1)+4-1&-4)*(S=(x=x>>1||1)+4-1&-4)*m}return 0!==o?{uncompressed:y.map((function(e){var r=e[0].levelBuffer,i=!1;return o===eD.FLOAT?r=new Float32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4):o===eD.UNSIGNED_INT?(i=!0,r=new Uint32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4)):o===eD.INT&&(i=!0,r=new Int32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4)),{resource:new vU(r,{width:e[0].levelWidth,height:e[0].levelHeight}),type:o,format:i?t.convertFormatToInteger(s):s}})),kvData:b}:{compressed:y.map((function(t){return new hk(null,{format:a,width:u,height:h,levels:f,levelBuffers:t})})),kvData:b}},t.validate=function(t,e){for(var r=0;r<wk.length;r++)if(e.getUint8(r)!==wk[r])return console.error(t+" is not a valid *.ktx file!"),!1;return!0},t.convertFormatToInteger=function(t){switch(t){case $M.RGBA:return $M.RGBA_INTEGER;case $M.RGB:return $M.RGB_INTEGER;case $M.RG:return $M.RG_INTEGER;case $M.RED:return $M.RED_INTEGER;default:return t}},t.parseKvData=function(t,e,r){for(var i=new Map,n=0;n<e;){var o=t.getUint32(64+n,r),s=64+n+4,a=3-(o+3)%4;if(0===o||o>e-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var u=0;u<o&&0!==t.getUint8(s+u);u++);if(-1===u){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}var h=(new TextDecoder).decode(new Uint8Array(t.buffer,s,u)),c=new DataView(t.buffer,s+u+1,o-u-1);i.set(h,c),n+=4+o+a}return i},t.loadKeyValueData=!1,t}(),Wk=function(t,e){return Wk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Wk(t,e)};function zk(t,e){function r(){this.constructor=t}Wk(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var Zk,Kk,qk=function(t){function e(e,r,i,n){void 0===e&&(e=1500),void 0===i&&(i=16384),void 0===n&&(n=!1);var o=t.call(this)||this;return i>16384&&(i=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=e,o._batchSize=i,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=JM.NORMAL,o.autoResize=n,o.roundPixels=!0,o.baseTexture=null,o.setProperties(r),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}return zk(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,ND(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e}(KL),Jk=function(){function t(t,e,r){this.geometry=new VU,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<t.length;++i){var n=t[i];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||eD.FLOAT,offset:n.offset},e[i]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return t.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new BU(function(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i<r;i+=6,n+=4)e[i+0]=n+0,e[i+1]=n+1,e[i+2]=n+2,e[i+3]=n+0,e[i+4]=n+2,e[i+5]=n+3;return e}(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var r=0;r<this.dynamicProperties.length;++r){(s=this.dynamicProperties[r]).offset=e,e+=s.size,this.dynamicStride+=s.size}var i=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(i),this.dynamicDataUint32=new Uint32Array(i),this.dynamicBuffer=new BU(this.dynamicData,!1,!1);var n=0;this.staticStride=0;for(r=0;r<this.staticProperties.length;++r){(s=this.staticProperties[r]).offset=n,n+=s.size,this.staticStride+=s.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new BU(this.staticData,!0,!1);for(r=0;r<this.dynamicProperties.length;++r){var s=this.dynamicProperties[r];t.addAttribute(s.attributeName,this.dynamicBuffer,0,s.type===eD.UNSIGNED_BYTE,s.type,4*this.dynamicStride,4*s.offset)}for(r=0;r<this.staticProperties.length;++r){s=this.staticProperties[r];t.addAttribute(s.attributeName,this.staticBuffer,0,s.type===eD.UNSIGNED_BYTE,s.type,4*this.staticStride,4*s.offset)}},t.prototype.uploadDynamic=function(t,e,r){for(var i=0;i<this.dynamicProperties.length;i++){var n=this.dynamicProperties[i];n.uploadFunction(t,e,r,n.type===eD.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++},t.prototype.uploadStatic=function(t,e,r){for(var i=0;i<this.staticProperties.length;i++){var n=this.staticProperties[i];n.uploadFunction(t,e,r,n.type===eD.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++},t.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},t}(),Qk=function(t){function e(e){var r=t.call(this,e)||this;return r.shader=null,r.properties=null,r.tempMatrix=new pL,r.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:r.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:r.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:r.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:r.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:eD.UNSIGNED_BYTE,uploadFunction:r.uploadTint,offset:0}],r.shader=NF.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n    float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n    float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n    vec2 v = vec2(x, y);\n    v = v + aPositionCoord;\n\n    gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n    vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n    gl_FragColor = color;\n}",{}),r.state=MF.for2d(),r}return zk(e,t),e.prototype.render=function(t){var e=t.children,r=t._maxSize,i=t._batchSize,n=this.renderer,o=e.length;if(0!==o){o>r&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.state.blendMode=FD(t.blendMode,a.alphaMode),n.state.set(this.state);var u,h,c,l,d=n.gl,f=t.worldTransform.copyTo(this.tempMatrix);f.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=f.toArray(!0),this.shader.uniforms.uColor=(u=t.tintRgb,h=t.worldAlpha,c=this.shader.uniforms.uColor,l=a.alphaMode,c=c||new Float32Array(4),l||void 0===l?(c[0]=u[0]*h,c[1]=u[1]*h,c[2]=u[2]*h):(c[0]=u[0],c[1]=u[1],c[2]=u[2]),c[3]=h,c),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var p=!1,m=0,v=0;m<o;m+=i,v+=1){var _=o-m;_>i&&(_=i),v>=s.length&&s.push(this._generateOneMoreBuffer(t));var y=s[v];y.uploadDynamic(e,m,_);var g=t._bufferUpdateIDs[v]||0;(p=p||y._updateID<g)&&(y._updateID=t._updateID,y.uploadStatic(e,m,_)),n.geometry.bind(y.geometry),d.drawElements(d.TRIANGLES,6*_,d.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var e=[],r=t._maxSize,i=t._batchSize,n=t._properties,o=0;o<r;o+=i)e.push(new Jk(this.properties,n,i));return e},e.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,r=t._properties;return new Jk(this.properties,r,e)},e.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s=0,a=0,u=0,h=0,c=0;c<r;++c){var l=t[e+c],d=l._texture,f=l.scale.x,p=l.scale.y,m=d.trim,v=d.orig;m?(s=(a=m.x-l.anchor.x*v.width)+m.width,u=(h=m.y-l.anchor.y*v.height)+m.height):(s=v.width*(1-l.anchor.x),a=v.width*-l.anchor.x,u=v.height*(1-l.anchor.y),h=v.height*-l.anchor.y),i[o]=a*f,i[o+1]=h*p,i[o+n]=s*f,i[o+n+1]=h*p,i[o+2*n]=s*f,i[o+2*n+1]=u*p,i[o+3*n]=a*f,i[o+3*n+1]=u*p,o+=4*n}},e.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},e.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},e.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},e.prototype.uploadTint=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s],u=a._texture.baseTexture.alphaMode>0,h=a.alpha,c=h<1&&u?GD(a._tintRGB,h):a._tintRGB+(255*h<<24);i[o]=c,i[o+n]=c,i[o+2*n]=c,i[o+3*n]=c,o+=4*n}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}($U);!function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(Zk||(Zk={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(Kk||(Kk={}));var $k={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}},tX=function(){function t(){this.color=16777215,this.alpha=1,this.texture=DU.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=DU.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),eX=function(t,e){return eX=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},eX(t,e)};function rX(t,e){function r(){this.constructor=t}eX(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function iX(t,e){var r,i;void 0===e&&(e=!1);var n=t.length;if(!(n<6)){for(var o=0,s=0,a=t[n-2],u=t[n-1];s<n;s+=2){var h=t[s],c=t[s+1];o+=(h-a)*(c+u),a=h,u=c}if(!e&&o>0||e&&o<=0){var l=n/2;for(s=l+l%2;s<n;s+=2){var d=n-s-2,f=n-s-1,p=s,m=s+1;r=[t[p],t[d]],t[d]=r[0],t[p]=r[1],i=[t[m],t[f]],t[f]=i[0],t[m]=i[1]}}}}var nX={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,i=t.holes,n=e.points,o=e.indices;if(r.length>=6){iX(r,!1);for(var s=[],a=0;a<i.length;a++){var u=i[a];iX(u.points,!0),s.push(r.length/2),r=r.concat(u.points)}var h=FM(r,s,2);if(!h)return;var c=n.length/2;for(a=0;a<h.length;a+=3)o.push(h[a]+c),o.push(h[a+1]+c),o.push(h[a+2]+c);for(a=0;a<r.length;a++)n.push(r[a])}}},oX={build:function(t){var e,r,i,n,o,s,a=t.points;if(t.type===rL.CIRC){var u=t.shape;e=u.x,r=u.y,o=s=u.radius,i=n=0}else if(t.type===rL.ELIP){var h=t.shape;e=h.x,r=h.y,o=h.width,s=h.height,i=n=0}else{var c=t.shape,l=c.width/2,d=c.height/2;e=c.x+l,r=c.y+d,i=l-(o=s=Math.max(0,Math.min(c.radius,Math.min(l,d)))),n=d-s}if(o>=0&&s>=0&&i>=0&&n>=0){var f=Math.ceil(2.3*Math.sqrt(o+s)),p=8*f+(i?4:0)+(n?4:0);if(a.length=p,0!==p){if(0===f)return a.length=8,a[0]=a[6]=e+i,a[1]=a[3]=r+n,a[2]=a[4]=e-i,void(a[5]=a[7]=r-n);var m=0,v=4*f+(i?2:0)+2,_=v,y=p,g=e+(S=i+o),b=e-S,T=r+(A=n);if(a[m++]=g,a[m++]=T,a[--v]=T,a[--v]=b,n){var E=r-A;a[_++]=b,a[_++]=E,a[--y]=E,a[--y]=g}for(var x=1;x<f;x++){var R=Math.PI/2*(x/f);g=e+(S=i+Math.cos(R)*o),b=e-S,T=r+(A=n+Math.sin(R)*s),E=r-A;a[m++]=g,a[m++]=T,a[--v]=T,a[--v]=b,a[_++]=b,a[_++]=E,a[--y]=E,a[--y]=g}var S,A;g=e+(S=i),b=e-S,T=r+(A=n+s),E=r-A;a[m++]=g,a[m++]=T,a[--y]=E,a[--y]=g,i&&(a[m++]=b,a[m++]=T,a[--y]=E,a[--y]=b)}}else a.length=0},triangulate:function(t,e){var r,i,n=t.points,o=e.points,s=e.indices,a=o.length/2,u=a;if(t.type!==rL.RREC){var h=t.shape;r=h.x,i=h.y}else{var c=t.shape;r=c.x+c.width/2,i=c.y+c.height/2}var l=t.matrix;o.push(t.matrix?l.a*r+l.c*i+l.tx:r,t.matrix?l.b*r+l.d*i+l.ty:i),a++,o.push(n[0],n[1]);for(var d=2;d<n.length;d+=2)o.push(n[d],n[d+1]),s.push(a++,u,a);s.push(u+1,u,a)}};function sX(t,e,r){return t+(e-t)*r}function aX(t,e,r,i,n,o,s){void 0===s&&(s=[]);for(var a=s,u=0,h=0,c=0,l=0,d=0,f=0,p=0,m=0;p<=20;++p)u=sX(t,r,m=p/20),h=sX(e,i,m),c=sX(r,n,m),l=sX(i,o,m),d=sX(u,c,m),f=sX(h,l,m),0===p&&a[a.length-2]===d&&a[a.length-1]===f||a.push(d,f);return a}var uX={build:function(t){if(IX.nextRoundedRectBehavior)oX.build(t);else{var e=t.shape,r=t.points,i=e.x,n=e.y,o=e.width,s=e.height,a=Math.max(0,Math.min(e.radius,Math.min(o,s)/2));r.length=0,a?(aX(i,n+a,i,n,i+a,n,r),aX(i+o-a,n,i+o,n,i+o,n+a,r),aX(i+o,n+s-a,i+o,n+s,i+o-a,n+s,r),aX(i+a,n+s,i,n+s,i,n+s-a,r)):r.push(i,n,i+o,n,i+o,n+s,i,n+s)}},triangulate:function(t,e){if(IX.nextRoundedRectBehavior)oX.triangulate(t,e);else{for(var r=t.points,i=e.points,n=e.indices,o=i.length/2,s=FM(r,null,2),a=0,u=s.length;a<u;a+=3)n.push(s[a]+o),n.push(s[a+1]+o),n.push(s[a+2]+o);for(a=0,u=r.length;a<u;a++)i.push(r[a],r[++a])}}};function hX(t,e,r,i,n,o,s,a){var u,h;s?(u=i,h=-r):(u=-i,h=r);var c=t-r*n+u,l=e-i*n+h,d=t+r*o+u,f=e+i*o+h;return a.push(c,l),a.push(d,f),2}function cX(t,e,r,i,n,o,s,a){var u=r-t,h=i-e,c=Math.atan2(u,h),l=Math.atan2(n-t,o-e);a&&c<l?c+=2*Math.PI:!a&&c>l&&(l+=2*Math.PI);var d=c,f=l-c,p=Math.abs(f),m=Math.sqrt(u*u+h*h),v=1+(15*p*Math.sqrt(m)/Math.PI>>0),_=f/v;if(d+=_,a){s.push(t,e),s.push(r,i);for(var y=1,g=d;y<v;y++,g+=_)s.push(t,e),s.push(t+Math.sin(g)*m,e+Math.cos(g)*m);s.push(t,e),s.push(n,o)}else{s.push(r,i),s.push(t,e);for(y=1,g=d;y<v;y++,g+=_)s.push(t+Math.sin(g)*m,e+Math.cos(g)*m),s.push(t,e);s.push(n,o),s.push(t,e)}return 2*v}function lX(t,e){t.lineStyle.native?function(t,e){var r=0,i=t.shape,n=t.points||i.points,o=i.type!==rL.POLY||i.closeStroke;if(0!==n.length){var s=e.points,a=e.indices,u=n.length/2,h=s.length/2,c=h;for(s.push(n[0],n[1]),r=1;r<u;r++)s.push(n[2*r],n[2*r+1]),a.push(c,c+1),c++;o&&a.push(c,h)}}(t,e):function(t,e){var r=t.shape,i=t.points||r.points.slice(),n=e.closePointEps;if(0!==i.length){var o=t.lineStyle,s=new sL(i[0],i[1]),a=new sL(i[i.length-2],i[i.length-1]),u=r.type!==rL.POLY||r.closeStroke,h=Math.abs(s.x-a.x)<n&&Math.abs(s.y-a.y)<n;if(u){i=i.slice(),h&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));var c=.5*(s.x+a.x),l=.5*(a.y+s.y);i.unshift(c,l),i.push(c,l)}var d=e.points,f=i.length/2,p=i.length,m=d.length/2,v=o.width/2,_=v*v,y=o.miterLimit*o.miterLimit,g=i[0],b=i[1],T=i[2],E=i[3],x=0,R=0,S=-(b-E),A=g-T,I=0,C=0,O=Math.sqrt(S*S+A*A);S/=O,A/=O,S*=v,A*=v;var w=o.alignment,P=2*(1-w),N=2*w;u||(o.cap===Kk.ROUND?p+=cX(g-S*(P-N)*.5,b-A*(P-N)*.5,g-S*P,b-A*P,g+S*N,b+A*N,d,!0)+2:o.cap===Kk.SQUARE&&(p+=hX(g,b,S,A,P,N,!0,d))),d.push(g-S*P,b-A*P),d.push(g+S*N,b+A*N);for(var M=1;M<f-1;++M){g=i[2*(M-1)],b=i[2*(M-1)+1],T=i[2*M],E=i[2*M+1],x=i[2*(M+1)],R=i[2*(M+1)+1],S=-(b-E),A=g-T,S/=O=Math.sqrt(S*S+A*A),A/=O,S*=v,A*=v,I=-(E-R),C=T-x,I/=O=Math.sqrt(I*I+C*C),C/=O,I*=v,C*=v;var D=T-g,L=b-E,U=T-x,F=R-E,G=L*U-F*D,B=G<0;if(Math.abs(G)<.1)d.push(T-S*P,E-A*P),d.push(T+S*N,E+A*N);else{var k=(-S+g)*(-A+E)-(-S+T)*(-A+b),X=(-I+x)*(-C+E)-(-I+T)*(-C+R),H=(D*X-U*k)/G,j=(F*k-L*X)/G,V=(H-T)*(H-T)+(j-E)*(j-E),Y=T+(H-T)*P,W=E+(j-E)*P,z=T-(H-T)*N,Z=E-(j-E)*N,K=B?P:N;V<=Math.min(D*D+L*L,U*U+F*F)+K*K*_?o.join===Zk.BEVEL||V/_>y?(B?(d.push(Y,W),d.push(T+S*N,E+A*N),d.push(Y,W),d.push(T+I*N,E+C*N)):(d.push(T-S*P,E-A*P),d.push(z,Z),d.push(T-I*P,E-C*P),d.push(z,Z)),p+=2):o.join===Zk.ROUND?B?(d.push(Y,W),d.push(T+S*N,E+A*N),p+=cX(T,E,T+S*N,E+A*N,T+I*N,E+C*N,d,!0)+4,d.push(Y,W),d.push(T+I*N,E+C*N)):(d.push(T-S*P,E-A*P),d.push(z,Z),p+=cX(T,E,T-S*P,E-A*P,T-I*P,E-C*P,d,!1)+4,d.push(T-I*P,E-C*P),d.push(z,Z)):(d.push(Y,W),d.push(z,Z)):(d.push(T-S*P,E-A*P),d.push(T+S*N,E+A*N),o.join===Zk.ROUND?p+=B?cX(T,E,T+S*N,E+A*N,T+I*N,E+C*N,d,!0)+2:cX(T,E,T-S*P,E-A*P,T-I*P,E-C*P,d,!1)+2:o.join===Zk.MITER&&V/_<=y&&(B?(d.push(z,Z),d.push(z,Z)):(d.push(Y,W),d.push(Y,W)),p+=2),d.push(T-I*P,E-C*P),d.push(T+I*N,E+C*N),p+=2)}}g=i[2*(f-2)],b=i[2*(f-2)+1],T=i[2*(f-1)],S=-(b-(E=i[2*(f-1)+1])),A=g-T,S/=O=Math.sqrt(S*S+A*A),A/=O,S*=v,A*=v,d.push(T-S*P,E-A*P),d.push(T+S*N,E+A*N),u||(o.cap===Kk.ROUND?p+=cX(T-S*(P-N)*.5,E-A*(P-N)*.5,T-S*P,E-A*P,T+S*N,E+A*N,d,!1)+2:o.cap===Kk.SQUARE&&(p+=hX(T,E,S,A,P,N,!1,d)));var q=e.indices,J=$k.epsilon*$k.epsilon;for(M=m;M<p+m-2;++M)g=d[2*M],b=d[2*M+1],T=d[2*(M+1)],E=d[2*(M+1)+1],x=d[2*(M+2)],R=d[2*(M+2)+1],Math.abs(g*(E-R)+T*(R-b)+x*(b-E))<J||q.push(M,M+1,M+2)}}(t,e)}var dX,fX=function(){function t(){}return t.curveTo=function(t,e,r,i,n,o){var s=o[o.length-2],a=o[o.length-1]-e,u=s-t,h=i-e,c=r-t,l=Math.abs(a*c-u*h);if(l<1e-8||0===n)return o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e),null;var d=a*a+u*u,f=h*h+c*c,p=a*h+u*c,m=n*Math.sqrt(d)/l,v=n*Math.sqrt(f)/l,_=m*p/d,y=v*p/f,g=m*c+v*u,b=m*h+v*a,T=u*(v+_),E=a*(v+_),x=c*(m+y),R=h*(m+y);return{cx:g+t,cy:b+e,radius:n,startAngle:Math.atan2(E-b,T-g),endAngle:Math.atan2(R-b,x-g),anticlockwise:u*h>c*a}},t.arc=function(t,e,r,i,n,o,s,a,u){for(var h=s-o,c=$k._segmentsCount(Math.abs(h)*n,40*Math.ceil(Math.abs(h)/iL)),l=h/(2*c),d=2*l,f=Math.cos(l),p=Math.sin(l),m=c-1,v=m%1/m,_=0;_<=m;++_){var y=l+o+d*(_+v*_),g=Math.cos(y),b=-Math.sin(y);u.push((f*g+p*b)*n+r,(f*-b+p*g)*n+i)}},t}(),pX=function(){function t(){}return t.curveLength=function(t,e,r,i,n,o,s,a){for(var u=0,h=0,c=0,l=0,d=0,f=0,p=0,m=0,v=0,_=0,y=0,g=t,b=e,T=1;T<=10;++T)_=g-(m=(p=(f=(d=1-(h=T/10))*d)*d)*t+3*f*h*r+3*d*(c=h*h)*n+(l=c*h)*s),y=b-(v=p*e+3*f*h*i+3*d*c*o+l*a),g=m,b=v,u+=Math.sqrt(_*_+y*y);return u},t.curveTo=function(e,r,i,n,o,s,a){var u=a[a.length-2],h=a[a.length-1];a.length-=2;var c=$k._segmentsCount(t.curveLength(u,h,e,r,i,n,o,s)),l=0,d=0,f=0,p=0,m=0;a.push(u,h);for(var v=1,_=0;v<=c;++v)f=(d=(l=1-(_=v/c))*l)*l,m=(p=_*_)*_,a.push(f*u+3*d*_*e+3*l*p*i+m*o,f*h+3*d*_*r+3*l*p*n+m*s)},t}(),mX=function(){function t(){}return t.curveLength=function(t,e,r,i,n,o){var s=t-2*r+n,a=e-2*i+o,u=2*r-2*t,h=2*i-2*e,c=4*(s*s+a*a),l=4*(s*u+a*h),d=u*u+h*h,f=2*Math.sqrt(c+l+d),p=Math.sqrt(c),m=2*c*p,v=2*Math.sqrt(d),_=l/p;return(m*f+p*l*(f-v)+(4*d*c-l*l)*Math.log((2*p+_+f)/(_+v)))/(4*m)},t.curveTo=function(e,r,i,n,o){for(var s=o[o.length-2],a=o[o.length-1],u=$k._segmentsCount(t.curveLength(s,a,e,r,i,n)),h=0,c=0,l=1;l<=u;++l){var d=l/u;h=s+(e-s)*d,c=a+(r-a)*d,o.push(h+(e+(i-e)*d-h)*d,c+(r+(n-r)*d-c)*d)}},t}(),vX=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),_X=((dX={})[rL.POLY]=nX,dX[rL.CIRC]=oX,dX[rL.ELIP]=oX,dX[rL.RECT]={build:function(t){var e=t.shape,r=e.x,i=e.y,n=e.width,o=e.height,s=t.points;s.length=0,s.push(r,i,r+n,i,r+n,i+o,r,i+o)},triangulate:function(t,e){var r=t.points,i=e.points,n=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},dX[rL.RREC]=uX,dX),yX=[],gX=[],bX=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),TX=new sL,EX=new RL,xX=function(t){function e(){var e=t.call(this)||this;return e.closePointEps=1e-4,e.boundsPadding=0,e.uvsFloat32=null,e.indicesUint16=null,e.batchable=!1,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.drawCalls=[],e.batchDirty=-1,e.batches=[],e.dirty=0,e.cacheDirty=-1,e.clearDirty=0,e.shapeIndex=0,e._bounds=new RL,e.boundsDirty=-1,e}return rX(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),gX.push(this.drawCalls[t]);this.drawCalls.length=0;for(t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),yX.push(e)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null);var n=new bX(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this},e.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var r=new bX(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var e=this.graphicsData,r=0;r<e.length;++r){var i=e[r];if(i.fillStyle.visible&&(i.shape&&(i.matrix?i.matrix.applyInverse(t,TX):TX.copyFrom(t),i.shape.contains(TX.x,TX.y)))){var n=!1;if(i.holes)for(var o=0;o<i.holes.length;o++){if(i.holes[o].shape.contains(TX.x,TX.y)){n=!0;break}}if(!n)return!0}}return!1},e.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,r=this.graphicsData,i=null,n=null;this.batches.length>0&&(n=(i=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o<r.length;o++){this.shapeIndex++;var s=r[o],a=s.fillStyle,u=s.lineStyle;_X[s.type].build(s),s.matrix&&this.transformPoints(s.points,s.matrix),(a.visible||u.visible)&&this.processHoles(s.holes);for(var h=0;h<2;h++){var c=0===h?a:u;if(c.visible){var l=c.texture.baseTexture,d=this.indices.length,f=this.points.length/2;l.wrapMode=nD.REPEAT,0===h?this.processFill(s):this.processLine(s);var p=this.points.length/2-f;0!==p&&(i&&!this._compareStyles(n,c)&&(i.end(d,f),i=null),i||((i=yX.pop()||new vX).begin(c,d,f),this.batches.push(i),n=c),this.addUvs(this.points,e,c.texture,f,p,c.matrix))}}}var m=this.indices.length,v=this.points.length/2;if(i&&i.end(m,v),0!==this.batches.length){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var _=v>65535&&t;this.indicesUint16=_?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var r=this.graphicsData[t],i=r.fillStyle,n=r.lineStyle;if(i&&!i.texture.baseTexture.valid)return!1;if(n&&!n.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,r=t.length;e<r;e++)for(var i=t[e],n=0;n<i.size;n++){var o=i.start+n;this.indicesUint16[o]=this.indicesUint16[o]-i.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,r=0;r<t.length;r++)if(t[r].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++yU._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),gX.push(this.drawCalls[e]);this.drawCalls.length=0;var r=this.colors,i=this.textureIds,n=gX.pop();n||((n=new fG).texArray=new pG),n.texArray.count=0,n.start=0,n.size=0,n.type=QM.TRIANGLES;var o=0,s=null,a=0,u=!1,h=QM.TRIANGLES,c=0;this.drawCalls.push(n);for(e=0;e<this.batches.length;e++){var l=this.batches[e],d=l.style,f=d.texture.baseTexture;u!==!!d.native&&(h=(u=!!d.native)?QM.LINES:QM.TRIANGLES,s=null,o=8,t++),s!==f&&(s=f,f._batchEnabled!==t&&(8===o&&(t++,o=0,n.size>0&&((n=gX.pop())||((n=new fG).texArray=new pG),this.drawCalls.push(n)),n.start=c,n.size=0,n.texArray.count=0,n.type=h),f.touched=1,f._batchEnabled=t,f._batchLocation=o,f.wrapMode=nD.REPEAT,n.texArray.elements[n.texArray.count++]=f,o++)),n.size+=l.size,c+=l.size,a=f._batchLocation,this.addColors(r,d.color,d.alpha,l.attribSize,l.attribStart),this.addTextureIds(i,a,l.attribSize,l.attribStart)}yU._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,n=new ArrayBuffer(3*t.length*4),o=new Float32Array(n),s=new Uint32Array(n),a=0,u=0;u<t.length/2;u++)o[a++]=t[2*u],o[a++]=t[2*u+1],o[a++]=e[2*u],o[a++]=e[2*u+1],s[a++]=r[u],o[a++]=i[u];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?nX.triangulate(t,this):_X[t.type].triangulate(t,this)},e.prototype.processLine=function(t){lX(t,this);for(var e=0;e<t.holes.length;e++)lX(t.holes[e],this)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var r=t[e];_X[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds,e=EX,r=pL.IDENTITY;this._bounds.clear(),e.clear();for(var i=0;i<this.graphicsData.length;i++){var n=this.graphicsData[i],o=n.shape,s=n.type,a=n.lineStyle,u=n.matrix||pL.IDENTITY,h=0;if(a&&a.visible&&(h=a.width,s!==rL.POLY||n.fillStyle.visible?h*=Math.max(0,a.alignment):h*=Math.max(a.alignment,1-a.alignment)),r!==u&&(e.isEmpty()||(t.addBoundsMatrix(e,r),e.clear()),r=u),s===rL.RECT||s===rL.RREC){var c=o;e.addFramePad(c.x,c.y,c.x+c.width,c.y+c.height,h,h)}else if(s===rL.CIRC){var l=o;e.addFramePad(l.x,l.y,l.x,l.y,l.radius+h,l.radius+h)}else if(s===rL.ELIP){var d=o;e.addFramePad(d.x,d.y,d.x,d.y,d.width+h,d.height+h)}else{var f=o;t.addVerticesMatrix(r,f.points,0,f.points.length,h,h)}}e.isEmpty()||t.addBoundsMatrix(e,r),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,e){for(var r=0;r<t.length/2;r++){var i=t[2*r],n=t[2*r+1];t[2*r]=e.a*i+e.c*n+e.tx,t[2*r+1]=e.b*i+e.d*n+e.ty}},e.prototype.addColors=function(t,e,r,i,n){void 0===n&&(n=0);var o=GD((e>>16)+(65280&e)+((255&e)<<16),r);t.length=Math.max(t.length,n+i);for(var s=0;s<i;s++)t[n+s]=o},e.prototype.addTextureIds=function(t,e,r,i){void 0===i&&(i=0),t.length=Math.max(t.length,i+r);for(var n=0;n<r;n++)t[i+n]=e},e.prototype.addUvs=function(t,e,r,i,n,o){void 0===o&&(o=null);for(var s=0,a=e.length,u=r.frame;s<n;){var h=t[2*(i+s)],c=t[2*(i+s)+1];if(o){var l=o.a*h+o.c*c+o.tx;c=o.b*h+o.d*c+o.ty,h=l}s++,e.push(h/u.width,c/u.height)}var d=r.baseTexture;(u.width<d.width||u.height<d.height)&&this.adjustUvs(e,r,a,n)},e.prototype.adjustUvs=function(t,e,r,i){for(var n=e.baseTexture,o=1e-6,s=r+2*i,a=e.frame,u=a.width/n.width,h=a.height/n.height,c=a.x/a.width,l=a.y/a.height,d=Math.floor(t[r]+o),f=Math.floor(t[r+1]+o),p=r+2;p<s;p+=2)d=Math.min(d,Math.floor(t[p]+o)),f=Math.min(f,Math.floor(t[p+1]+o));c-=d,l-=f;for(p=r;p<s;p+=2)t[p]=(t[p]+c)*u,t[p+1]=(t[p+1]+l)*h},e.BATCHABLE_SIZE=100,e}(yG),RX=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=Kk.BUTT,e.join=Zk.MITER,e.miterLimit=10,e}return rX(e,t),e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(tX),SX=new Float32Array(3),AX={},IX=function(t){function e(e){void 0===e&&(e=null);var r=t.call(this)||this;return r.shader=null,r.pluginName="batch",r.currentPath=null,r.batches=[],r.batchTint=-1,r.batchDirty=-1,r.vertexData=null,r._fillStyle=new tX,r._lineStyle=new RX,r._matrix=null,r._holeMode=!1,r.state=MF.for2d(),r._geometry=e||new xX,r._geometry.refCount++,r._transformID=-1,r.tint=16777215,r.blendMode=JM.NORMAL,r}return rX(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,e,r,i,n){return void 0===t&&(t=null),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=.5),void 0===n&&(n=!1),"number"==typeof t&&(t={width:t,color:e,alpha:r,alignment:i,native:n}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:DU.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:Kk.BUTT,join:Zk.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var e=t.width>0&&t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:e},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new lL,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new lL,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),mX.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),pX.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=fX.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,u=s.cy,h=s.radius,c=s.startAngle,l=s.endAngle,d=s.anticlockwise;this.arc(a,u,h,c,l,d)}return this},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=iL:o&&i<=n&&(i+=iL),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,u=this._geometry.closePointEps,h=this.currentPath?this.currentPath.points:null;if(h){var c=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);c<u&&l<u||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return fX.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill({texture:DU.WHITE,color:t,alpha:e})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:DU.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var e=t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new uL(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new dL(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new hL(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new cL(t,e,r,i))},e.prototype.drawPolygon=function(){for(var t,e=arguments,r=[],i=0;i<arguments.length;i++)r[i]=e[i];var n=!0,o=r[0];o.points?(n=o.closeStroke,t=o.points):t=Array.isArray(r[0])?r[0]:r;var s=new lL(t);return s.closeStroke=n,this.drawShape(s),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==rL.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var e=this._geometry,r=t.context.supports.uint32Indices;e.updateBatches(r),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,e=this.blendMode,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(var i=0;i<r;i++){var n=t.batches[i],o=n.style.color,s=new Float32Array(this.vertexData.buffer,4*n.attribStart*2,2*n.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*n.attribStart*2,2*n.attribSize),u={vertexData:s,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*n.start,n.size),uvs:a,_batchRGB:ND(o),_tintRGB:o,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=u}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,r=this.batches.length;e<r;e++){var i=this.batches[e];i.worldAlpha=this.worldAlpha*i.alpha,t.plugins[this.pluginName].render(i)}}},e.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),r=this._geometry,i=this.tint,n=this.worldAlpha,o=e.uniforms,s=r.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(i>>16&255)/255*n,o.tint[1]=(i>>8&255)/255*n,o.tint[2]=(255&i)/255*n,o.tint[3]=n,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var a=0,u=s.length;a<u;a++)this._renderDrawCallDirect(t,r.drawCalls[a])},e.prototype._renderDrawCallDirect=function(t,e){for(var r=e.texArray,i=e.type,n=e.size,o=e.start,s=r.count,a=0;a<s;a++)t.texture.bind(r.elements[a],a);t.geometry.draw(i,n,o)},e.prototype._resolveDirectShader=function(t){var e=this.shader,r=this.pluginName;if(!e){if(!AX[r]){for(var i=t.plugins[r].MAX_TEXTURES,n=new Int32Array(i),o=0;o<i;o++)n[o]=o;var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new pL,default:ZU.from({uSamplers:n},!0)},a=t.plugins[r]._shader.program;AX[r]=new NF(a,s)}e=AX[r]}return e},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,r=e.minX,i=e.minY,n=e.maxX,o=e.maxY;this._bounds.addFrame(this.transform,r,i,n,o)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=ND(this.tint,SX),e=0;e<this.batches.length;e++){var r=this.batches[e],i=r._batchRGB,n=(t[0]*i[0]*255<<16)+(t[1]*i[1]*255<<8)+(0|t[2]*i[2]*255);r._tintRGB=(n>>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,u=this._geometry.points,h=this.vertexData,c=0,l=0;l<u.length;l+=2){var d=u[l],f=u[l+1];h[c++]=r*d+n*f+s,h[c++]=o*f+i*d+a}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(e){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},e.nextRoundedRectBehavior=!1,e._TEMP_POINT=new sL,e}(KL),CX=function(t,e){return CX=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},CX(t,e)};var OX,wX=new sL,PX=new Uint16Array([0,1,2,0,2,3]),NX=function(t){function e(e){var r=t.call(this)||this;return r._anchor=new fL(r._onAnchorUpdate,r,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),r._texture=null,r._width=0,r._height=0,r._tint=null,r._tintRGB=null,r.tint=16777215,r.blendMode=JM.NORMAL,r._cachedTint=16777215,r.uvs=null,r.texture=e||DU.EMPTY,r.vertexData=new Float32Array(8),r.vertexTrimmedData=null,r._transformID=-1,r._textureID=-1,r._transformTrimmedID=-1,r._textureTrimmedID=-1,r.indices=PX,r.pluginName="batch",r.isSprite=!0,r._roundPixels=aM.ROUND_PIXELS,r}return function(t,e){function r(){this.constructor=t}CX(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=YD(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=YD(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,u=this.vertexData,h=t.trim,c=t.orig,l=this._anchor,d=0,f=0,p=0,m=0;if(h?(d=(f=h.x-l._x*c.width)+h.width,p=(m=h.y-l._y*c.height)+h.height):(d=(f=-l._x*c.width)+c.width,p=(m=-l._y*c.height)+c.height),u[0]=r*f+n*m+s,u[1]=o*m+i*f+a,u[2]=r*d+n*m+s,u[3]=o*m+i*d+a,u[4]=r*d+n*p+s,u[5]=o*p+i*d+a,u[6]=r*f+n*p+s,u[7]=o*p+i*f+a,this._roundPixels)for(var v=aM.RESOLUTION,_=0;_<u.length;++_)u[_]=Math.round((u[_]*v|0)/v)}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,r=t.orig,i=this._anchor,n=this.transform.worldTransform,o=n.a,s=n.b,a=n.c,u=n.d,h=n.tx,c=n.ty,l=-i._x*r.width,d=l+r.width,f=-i._y*r.height,p=f+r.height;e[0]=o*l+a*f+h,e[1]=u*f+s*l+c,e[2]=o*d+a*f+h,e[3]=u*f+s*d+c,e[4]=o*d+a*p+h,e[5]=u*p+s*d+c,e[6]=o*l+a*p+h,e[7]=u*p+s*l+c},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._localBounds||(this._localBounds=new RL),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new uL),e=this._localBoundsRect),this._localBounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,wX);var e=this._texture.orig.width,r=this._texture.orig.height,i=-e*this.anchor.x,n=0;return wX.x>=i&&wX.x<i+e&&(n=-r*this.anchor.y,wX.y>=n&&wX.y<n+r)},e.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var r="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!r)}this._texture=null},e.from=function(t,r){return new e(t instanceof DU?t:DU.from(t,r))},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var e=YD(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var e=YD(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||DU.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(KL),MX=function(t,e){return MX=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},MX(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(OX||(OX={}));var DX={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:OX.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},LX=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],UX=function(){function t(t){this.styleID=0,this.reset(),BX(this,t,t)}return t.prototype.clone=function(){var e={};return BX(e,this,DX),new t(e)},t.prototype.reset=function(){BX(this,DX,DX)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=GX(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=GX(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=GX(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),t.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var r=e.length-1;r>=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&LX.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function FX(t){return"number"==typeof t?MD(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function GX(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=FX(t[e]);return t}return FX(t)}function BX(t,e,r){for(var i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}var kX=function(){function t(t,e,r,i,n,o,s,a,u){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=u}return t.measureText=function(e,r,i,n){void 0===n&&(n=t._canvas),i=null==i?r.wordWrap:i;var o=r.toFontString(),s=t.measureFont(o);0===s.fontSize&&(s.fontSize=r.fontSize,s.ascent=r.fontSize);var a=n.getContext("2d");a.font=o;for(var u=(i?t.wordWrap(e,r,n):e).split(/(?:\r\n|\r|\n)/),h=new Array(u.length),c=0,l=0;l<u.length;l++){var d=a.measureText(u[l]).width+(u[l].length-1)*r.letterSpacing;h[l]=d,c=Math.max(c,d)}var f=c+r.strokeThickness;r.dropShadow&&(f+=r.dropShadowDistance);var p=r.lineHeight||s.fontSize+r.strokeThickness,m=Math.max(p,s.fontSize+r.strokeThickness)+(u.length-1)*(p+r.leading);return r.dropShadow&&(m+=r.dropShadowDistance),new t(e,r,f,m,u,h,p+r.leading,c,s)},t.wordWrap=function(e,r,i){void 0===i&&(i=t._canvas);for(var n=i.getContext("2d"),o=0,s="",a="",u=Object.create(null),h=r.letterSpacing,c=r.whiteSpace,l=t.collapseSpaces(c),d=t.collapseNewlines(c),f=!l,p=r.wordWrapWidth+h,m=t.tokenize(e),v=0;v<m.length;v++){var _=m[v];if(t.isNewline(_)){if(!d){a+=t.addLine(s),f=!l,s="",o=0;continue}_=" "}if(l){var y=t.isBreakingSpace(_),g=t.isBreakingSpace(s[s.length-1]);if(y&&g)continue}var b=t.getFromCache(_,h,u,n);if(b>p)if(""!==s&&(a+=t.addLine(s),s="",o=0),t.canBreakWords(_,r.breakWords))for(var T=t.wordWrapSplit(_),E=0;E<T.length;E++){for(var x=T[E],R=1;T[E+R];){var S=T[E+R],A=x[x.length-1];if(t.canBreakChars(A,S,_,E,r.breakWords))break;x+=S,R++}E+=x.length-1;var I=t.getFromCache(x,h,u,n);I+o>p&&(a+=t.addLine(s),f=!1,s="",o=0),s+=x,o+=I}else{s.length>0&&(a+=t.addLine(s),s="",o=0);var C=v===m.length-1;a+=t.addLine(_,!C),f=!1,s="",o=0}else b+o>p&&(f=!1,a+=t.addLine(s),s="",o=0),(s.length>0||!t.isBreakingSpace(_)||f)&&(s+=_,o+=b)}return a+=t.addLine(s,!1)},t.addLine=function(e,r){return void 0===r&&(r=!0),e=t.trimRight(e),e=r?e+"\n":e},t.getFromCache=function(t,e,r,i){var n=r[t];if("number"!=typeof n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var r=e.length-1;r>=0;r--){var i=e[r];if(!t.isBreakingSpace(i))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,r){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var r=[],i="";if("string"!=typeof e)return r;for(var n=0;n<e.length;n++){var o=e[n],s=e[n+1];t.isBreakingSpace(o,s)||t.isNewline(o)?(""!==i&&(r.push(i),i=""),r.push(o)):i+=o}return""!==i&&r.push(i),r},t.canBreakWords=function(t,e){return e},t.canBreakChars=function(t,e,r,i,n){return!0},t.wordWrapSplit=function(t){return t.split("")},t.measureFont=function(e){if(t._fonts[e])return t._fonts[e];var r={ascent:0,descent:0,fontSize:0},i=t._canvas,n=t._context;n.font=e;var o=t.METRICS_STRING+t.BASELINE_SYMBOL,s=Math.ceil(n.measureText(o).width),a=Math.ceil(n.measureText(t.BASELINE_SYMBOL).width),u=Math.ceil(t.HEIGHT_MULTIPLIER*a);a=a*t.BASELINE_MULTIPLIER|0,i.width=s,i.height=u,n.fillStyle="#f00",n.fillRect(0,0,s,u),n.font=e,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(o,0,a);var h=n.getImageData(0,0,s,u).data,c=h.length,l=4*s,d=0,f=0,p=!1;for(d=0;d<a;++d){for(var m=0;m<l;m+=4)if(255!==h[f+m]){p=!0;break}if(p)break;f+=l}for(r.ascent=a-d,f=c-l,p=!1,d=u;d>a;--d){for(m=0;m<l;m+=4)if(255!==h[f+m]){p=!0;break}if(p)break;f-=l}return r.descent=d-a,r.fontSize=r.ascent+r.descent,t._fonts[e]=r,r},t.clearMetrics=function(e){void 0===e&&(e=""),e?delete t._fonts[e]:t._fonts={}},Object.defineProperty(t,"_canvas",{get:function(){if(!t.__canvas){var e=void 0;try{var r=new OffscreenCanvas(0,0),i=r.getContext("2d");if(i&&i.measureText)return t.__canvas=r,r;e=document.createElement("canvas")}catch(t){e=document.createElement("canvas")}e.width=e.height=10,t.__canvas=e}return t.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(t,"_context",{get:function(){return t.__context||(t.__context=t._canvas.getContext("2d")),t.__context},enumerable:!1,configurable:!0}),t}();kX._fonts={},kX.METRICS_STRING="|ÉqÅ",kX.BASELINE_SYMBOL="M",kX.BASELINE_MULTIPLIER=1.4,kX.HEIGHT_MULTIPLIER=2,kX._newlines=[10,13],kX._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var XX={texture:!0,children:!1,baseTexture:!0},HX=function(t){function e(e,r,i){var n=this,o=!1;i||(i=document.createElement("canvas"),o=!0),i.width=3,i.height=3;var s=DU.from(i);return s.orig=new uL,s.trim=new uL,(n=t.call(this,s)||this)._ownCanvas=o,n.canvas=i,n.context=n.canvas.getContext("2d"),n._resolution=aM.RESOLUTION,n._autoResolution=!0,n._text=null,n._style=null,n._styleListener=null,n._font="",n.text=e,n.style=r,n.localStyleID=-1,n}return function(t,e){function r(){this.constructor=t}MX(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.updateText=function(t){var r=this._style;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),this.dirty||!t){this._font=this._style.toFontString();var i,n,o=this.context,s=kX.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=s.width,u=s.height,h=s.lines,c=s.lineHeight,l=s.lineWidths,d=s.maxLineWidth,f=s.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,a)+2*r.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,u)+2*r.padding)*this._resolution),o.scale(this._resolution,this._resolution),o.clearRect(0,0,this.canvas.width,this.canvas.height),o.font=this._font,o.lineWidth=r.strokeThickness,o.textBaseline=r.textBaseline,o.lineJoin=r.lineJoin,o.miterLimit=r.miterLimit;for(var p=r.dropShadow?2:1,m=0;m<p;++m){var v=r.dropShadow&&0===m,_=v?Math.ceil(Math.max(1,u)+2*r.padding):0,y=_*this._resolution;if(v){o.fillStyle="black",o.strokeStyle="black";var g=r.dropShadowColor,b=ND("number"==typeof g?g:DD(g)),T=r.dropShadowBlur*this._resolution,E=r.dropShadowDistance*this._resolution;o.shadowColor="rgba("+255*b[0]+","+255*b[1]+","+255*b[2]+","+r.dropShadowAlpha+")",o.shadowBlur=T,o.shadowOffsetX=Math.cos(r.dropShadowAngle)*E,o.shadowOffsetY=Math.sin(r.dropShadowAngle)*E+y}else o.fillStyle=this._generateFillStyle(r,h,s),o.strokeStyle=r.stroke,o.shadowColor="black",o.shadowBlur=0,o.shadowOffsetX=0,o.shadowOffsetY=0;var x=(c-f.fontSize)/2;(!e.nextLineHeightBehavior||c-f.fontSize<0)&&(x=0);for(var R=0;R<h.length;R++)i=r.strokeThickness/2,n=r.strokeThickness/2+R*c+f.ascent+x,"right"===r.align?i+=d-l[R]:"center"===r.align&&(i+=(d-l[R])/2),r.stroke&&r.strokeThickness&&this.drawLetterSpacing(h[R],i+r.padding,n+r.padding-_,!0),r.fill&&this.drawLetterSpacing(h[R],i+r.padding,n+r.padding-_)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,r,i,n){void 0===n&&(n=!1);var o=this._style.letterSpacing,s=e.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(0===o||s)return s&&(this.context.letterSpacing=o,this.context.textLetterSpacing=o),void(n?this.context.strokeText(t,r,i):this.context.fillText(t,r,i));for(var a=r,u=Array.from?Array.from(t):t.split(""),h=this.context.measureText(t).width,c=0,l=0;l<u.length;++l){var d=u[l];n?this.context.strokeText(d,a,i):this.context.fillText(d,a,i);for(var f="",p=l+1;p<u.length;++p)f+=u[p];a+=h-(c=this.context.measureText(f).width)+o,h=c}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=function(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,u=a.length,h={top:null,left:null,right:null,bottom:null},c=null;for(e=0;e<u;e+=4)0!==a[e+3]&&(r=e/4%n,i=~~(e/4/n),null===h.top&&(h.top=i),(null===h.left||r<h.left)&&(h.left=r),(null===h.right||h.right<r)&&(h.right=r+1),(null===h.bottom||h.bottom<i)&&(h.bottom=i));return null!==h.top&&(n=h.right-h.left,o=h.bottom-h.top+1,c=s.getImageData(h.left,h.top,n,o)),{height:o,width:n,data:c}}(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var r=this._texture,i=this._style,n=i.trim?0:i.padding,o=r.baseTexture;r.trim.width=r._frame.width=t.width/this._resolution,r.trim.height=r._frame.height=t.height/this._resolution,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-2*n,r.orig.height=r._frame.height-2*n,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),r.updateUvs(),this.dirty=!1},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},e.prototype.updateTransform=function(){this.updateText(!0),t.prototype.updateTransform.call(this)},e.prototype.getBounds=function(e,r){return this.updateText(!0),-1===this._textureID&&(e=!1),t.prototype.getBounds.call(this,e,r)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,e,r){var i,n=t.fill;if(!Array.isArray(n))return n;if(1===n.length)return n[0];var o=t.dropShadow?t.dropShadowDistance:0,s=t.padding||0,a=this.canvas.width/this._resolution-o-2*s,u=this.canvas.height/this._resolution-o-2*s,h=n.slice(),c=t.fillGradientStops.slice();if(!c.length)for(var l=h.length+1,d=1;d<l;++d)c.push(d/l);if(h.unshift(n[0]),c.unshift(0),h.push(n[n.length-1]),c.push(1),t.fillGradientType===OX.LINEAR_VERTICAL){i=this.context.createLinearGradient(a/2,s,a/2,u+s);var f=r.fontProperties.fontSize+t.strokeThickness;for(d=0;d<e.length;d++){var p=r.lineHeight*(d-1)+f,m=r.lineHeight*d,v=m;d>0&&p>m&&(v=(m+p)/2);var _=m+f,y=r.lineHeight*(d+1),g=_;d+1<e.length&&y<_&&(g=(_+y)/2);for(var b=(g-v)/u,T=0;T<h.length;T++){var E=0;E="number"==typeof c[T]?c[T]:T/h.length;var x=Math.min(1,Math.max(0,v/u+E*b));x=Number(x.toFixed(5)),i.addColorStop(x,h[T])}}}else{i=this.context.createLinearGradient(s,u/2,a+s,u/2);var R=h.length+1,S=1;for(d=0;d<h.length;d++){var A=void 0;A="number"==typeof c[d]?c[d]:S/R,i.addColorStop(A,h[d]),S++}}return i},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},XX,e),t.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var e=YD(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var e=YD(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},this._style=t instanceof UX?t:new UX(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.nextLineHeightBehavior=!1,e.experimentalLetterSpacing=!1,e}(NX);aM.UPLOADS_PER_FRAME=4;var jX=function(t,e){return jX=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},jX(t,e)};var VX=function(){function t(t){this.maxItemsPerFrame=t,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();function YX(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i<t._textures.length;i++)if(t._textures[i]instanceof DU){var n=t._textures[i].baseTexture;-1===e.indexOf(n)&&(e.push(n),r=!0)}return r}function WX(t,e){if(t.baseTexture instanceof yU){var r=t.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function zX(t,e){if(t._texture&&t._texture instanceof DU){var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function ZX(t,e){return e instanceof HX&&(e.updateText(!0),!0)}function KX(t,e){if(e instanceof UX){var r=e.toFontString();return kX.measureFont(r),!0}return!1}function qX(t,e){if(t instanceof HX){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function JX(t,e){return t instanceof UX&&(-1===e.indexOf(t)&&e.push(t),!0)}var QX=function(){function t(t){var e=this;this.limiter=new VX(aM.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(qX),this.registerFindHook(JX),this.registerFindHook(YX),this.registerFindHook(WX),this.registerFindHook(zX),this.registerUploadHook(ZX),this.registerUploadHook(KX)}return t.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,$L.system.addOnce(this.tick,this,qL.UTILITY))):e&&e()},t.prototype.tick=function(){setTimeout(this.delayedTick,0)},t.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var r=0,i=this.uploadHooks.length;r<i;r++)if(this.uploadHooks[r](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)$L.system.addOnce(this.tick,this,qL.UTILITY);else{this.ticking=!1;var n=this.completes.slice(0);this.completes.length=0;for(r=0,i=n.length;r<i;r++)n[r]()}},t.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},t.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},t.prototype.add=function(t){for(var e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof KL)for(e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this},t.prototype.destroy=function(){this.ticking&&$L.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function $X(t,e){return e instanceof yU&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function tH(t,e){if(!(e instanceof IX))return!1;var r=e.geometry;e.finishPoly(),r.updateBatches();for(var i=r.batches,n=0;n<i.length;n++){var o=i[n].style.texture;o&&$X(t,o.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function eH(t,e){return t instanceof IX&&(e.push(t),!0)}var rH=function(t){function e(e){var r=t.call(this,e)||this;return r.uploadHookHelper=r.renderer,r.registerFindHook(eH),r.registerUploadHook($X),r.registerUploadHook(tH),r}return function(t,e){function r(){this.constructor=t}jX(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(QX),iH=function(){function t(t,e,r){void 0===r&&(r=null),this._texture=t instanceof DU?t:null,this.baseTexture=t instanceof yU?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var i=this.baseTexture.resource;this.resolution=this._updateResolution(r||(i?i.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return t.prototype._updateResolution=function(t){void 0===t&&(t=null);var e=this.data.meta.scale,r=eL(t,null);return null===r&&(r=void 0!==e?parseFloat(e):1),1!==r&&this.baseTexture.setResolution(r),r},t.prototype.parse=function(e){this._batchIndex=0,this._callback=e,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},t.prototype._processFrames=function(e){for(var r=e,i=t.BATCH_SIZE;r-e<i&&r<this._frameKeys.length;){var n=this._frameKeys[r],o=this._frames[n],s=o.frame;if(s){var a=null,u=null,h=!1!==o.trimmed&&o.sourceSize?o.sourceSize:o.frame,c=new uL(0,0,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution);a=o.rotated?new uL(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):new uL(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),!1!==o.trimmed&&o.spriteSourceSize&&(u=new uL(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[n]=new DU(this.baseTexture,a,c,u,o.rotated?2:0,o.anchor),DU.addToCache(this.textures[n],n)}r++}},t.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var r=0;r<t[e].length;r++){var i=t[e][r];this.animations[e].push(this.textures[i])}}},t.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},t.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((function(){e._batchIndex*t.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())}),0)},t.prototype.destroy=function(t){var e;for(var r in void 0===t&&(t=!1),this.textures)this.textures[r].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(null===(e=this._texture)||void 0===e||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null},t.BATCH_SIZE=1e3,t}(),nH=function(){function t(){}return t.use=function(e,r){var i,n,o=this,s=e.name+"_image";if(e.data&&e.type===YB.TYPE.JSON&&e.data.frames&&!o.resources[s]){var a=null===(n=null===(i=e.data)||void 0===i?void 0:i.meta)||void 0===n?void 0:n.related_multi_packs;if(Array.isArray(a))for(var u=function(t){if("string"!=typeof t)return"continue";var r=t.replace(".json",""),i=ID.resolve(e.url.replace(o.baseUrl,""),t);if(o.resources[r]||Object.values(o.resources).some((function(t){return ID.format(ID.parse(t.url))===i})))return"continue";var n={crossOrigin:e.crossOrigin,loadType:YB.LOAD_TYPE.XHR,xhrType:YB.XHR_RESPONSE_TYPE.JSON,parentResource:e,metadata:e.metadata};o.add(r,i,n)},h=0,c=a;h<c.length;h++){u(c[h])}var l={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},d=t.getResourcePath(e,o.baseUrl);o.add(s,d,l,(function(t){if(t.error)r(t.error);else{var i=new iH(t.texture,e.data,e.url);i.parse((function(){e.spritesheet=i,e.textures=i.textures,r()}))}}))}else r()},t.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:ID.resolve(t.url.replace(e,""),t.data.meta.image)},t}(),oH=function(t,e){return oH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},oH(t,e)};function sH(t,e){function r(){this.constructor=t}oH(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var aH=new sL,uH=function(t){function e(e,r,i){void 0===r&&(r=100),void 0===i&&(i=100);var n=t.call(this,e)||this;return n.tileTransform=new xL,n._width=r,n._height=i,n.uvMatrix=n.texture.uvMatrix||new UF(e),n.pluginName="tilingSprite",n.uvRespectAnchor=!1,n}return sH(e,t),Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,i)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new uL),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,aH);var e=this._width,r=this._height,i=-e*this.anchor._x;if(aH.x>=i&&aH.x<i+e){var n=-r*this.anchor._y;if(aH.y>=n&&aH.y<n+r)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,r){return new e(t instanceof DU?t:DU.from(t,r),r.width,r.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e}(NX),hH="#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",cH=new pL,lH=function(t){function e(e){var r=t.call(this,e)||this;return e.runners.contextChange.add(r),r.quad=new WU,r.state=MF.for2d(),r}return sH(e,t),e.prototype.contextChange=function(){var t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=NF.from(hH,"#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n    vec4 texSample = texture2D(uSampler, vTextureCoord);\n    gl_FragColor = texSample * uColor;\n}\n",e),this.shader=t.context.webGLVersion>1?NF.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    vec2 unclamped = coord;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n    fragmentColor = texSample * uColor;\n}\n",e):NF.from(hH,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n    #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n    vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\n    vec2 unclamped = coord;\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n    #ifdef GL_EXT_shader_texture_lod\n        vec4 texSample = unclamped == coord\n            ? texture2D(uSampler, coord) \n            : texture2DLodEXT(uSampler, coord, 0);\n    #else\n        vec4 texSample = texture2D(uSampler, coord);\n    #endif\n\n    gl_FragColor = texSample * uColor;\n}\n",e)},e.prototype.render=function(t){var e=this.renderer,r=this.quad,i=r.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y);var n=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;(i=r.uvs)[0]=i[6]=-n,i[1]=i[3]=-o,i[2]=i[4]=1-n,i[5]=i[7]=1-o,r.invalidate();var s=t._texture,a=s.baseTexture,u=t.tileTransform.localTransform,h=t.uvMatrix,c=a.isPowerOfTwo&&s.frame.width===a.width&&s.frame.height===a.height;c&&(a._glTextures[e.CONTEXT_UID]?c=a.wrapMode!==nD.CLAMP:a.wrapMode===nD.CLAMP&&(a.wrapMode=nD.REPEAT));var l=c?this.simpleShader:this.shader,d=s.width,f=s.height,p=t._width,m=t._height;cH.set(u.a*d/p,u.b*d/m,u.c*f/p,u.d*f/m,u.tx/p,u.ty/m),cH.invert(),c?cH.prepend(h.mapCoord):(l.uniforms.uMapCoord=h.mapCoord.toArray(!0),l.uniforms.uClampFrame=h.uClampFrame,l.uniforms.uClampOffset=h.uClampOffset),l.uniforms.uTransform=cH.toArray(!0),l.uniforms.uColor=BD(t.tint,t.worldAlpha,l.uniforms.uColor,a.alphaMode),l.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),l.uniforms.uSampler=s,e.shader.bind(l),e.geometry.bind(r),this.state.blendMode=FD(t.blendMode,a.alphaMode),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}($U),dH=function(t,e){return dH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},dH(t,e)};function fH(t,e){function r(){this.constructor=t}dH(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var pH=function(){function t(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),mH=new sL,vH=new lL,_H=function(t){function e(e,r,i,n){void 0===n&&(n=QM.TRIANGLES);var o=t.call(this)||this;return o.geometry=e,o.shader=r,o.state=i||MF.for2d(),o.drawMode=n,o.start=0,o.size=0,o.uvs=null,o.indices=null,o.vertexData=new Float32Array(1),o.vertexDirty=-1,o._transformID=-1,o._roundPixels=aM.ROUND_PIXELS,o.batchUvs=null,o}return fH(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===QM.TRIANGLES&&r.length<2*e.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var e=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=r._tintRGB,this._texture=r.texture;var i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var i=this.transform.worldTransform,n=i.a,o=i.b,s=i.c,a=i.d,u=i.tx,h=i.ty,c=this.vertexData,l=0;l<c.length/2;l++){var d=e[2*l],f=e[2*l+1];c[2*l]=n*d+s*f+u,c[2*l+1]=o*d+a*f+h}if(this._roundPixels){var p=aM.RESOLUTION;for(l=0;l<c.length;++l)c[l]=Math.round((c[l]*p|0)/p)}this.vertexDirty=r}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new pH(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,mH);for(var e=this.geometry.getBuffer("aVertexPosition").data,r=vH.points,i=this.geometry.getIndex().data,n=i.length,o=4===this.drawMode?3:1,s=0;s+2<n;s+=o){var a=2*i[s],u=2*i[s+1],h=2*i[s+2];if(r[0]=e[a],r[1]=e[a+1],r[2]=e[u],r[3]=e[u+1],r[4]=e[h],r[5]=e[h+1],vH.contains(mH.x,mH.y))return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},e.BATCHABLE_SIZE=100,e}(KL),yH=function(t){function e(e,r){var i=this,n={uSampler:e,alpha:1,uTextureMatrix:pL.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(r=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},r)).uniforms&&Object.assign(n,r.uniforms),(i=t.call(this,r.program||PF.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),n)||this)._colorDirty=!1,i.uvMatrix=new UF(e),i.batchable=void 0===r.program,i.pluginName=r.pluginName,i.tint=r.tint,i.alpha=r.alpha,i}return fH(e,t),Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;BD(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(NF),gH=function(t){function e(e,r,i){var n=t.call(this)||this,o=new BU(e),s=new BU(r,!0),a=new BU(i,!0,!0);return n.addAttribute("aVertexPosition",o,2,!1,eD.FLOAT).addAttribute("aTextureCoord",s,2,!1,eD.FLOAT).addIndex(a),n._updateId=-1,n}return fH(e,t),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(VU),bH=function(t,e){return bH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},bH(t,e)};var TH=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},EH=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],o=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var a in o){var u=o[a].split("="),h=u[0],c=u[1].replace(/"/gm,""),l=parseFloat(c),d=isNaN(l)?c:l;s[h]=d}r[n].push(s)}var f=new TH;return r.info.forEach((function(t){return f.info.push({face:t.face,size:parseInt(t.size,10)})})),r.common.forEach((function(t){return f.common.push({lineHeight:parseInt(t.lineHeight,10)})})),r.page.forEach((function(t){return f.page.push({id:parseInt(t.id,10),file:t.file})})),r.char.forEach((function(t){return f.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),r.kerning.forEach((function(t){return f.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),r.distanceField.forEach((function(t){return f.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType})})),f},t}(),xH=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new TH,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),a=t.getElementsByTagName("distanceField"),u=0;u<r.length;u++)e.info.push({face:r[u].getAttribute("face"),size:parseInt(r[u].getAttribute("size"),10)});for(u=0;u<i.length;u++)e.common.push({lineHeight:parseInt(i[u].getAttribute("lineHeight"),10)});for(u=0;u<n.length;u++)e.page.push({id:parseInt(n[u].getAttribute("id"),10)||0,file:n[u].getAttribute("file")});for(u=0;u<o.length;u++){var h=o[u];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(u=0;u<s.length;u++)e.kerning.push({first:parseInt(s[u].getAttribute("first"),10),second:parseInt(s[u].getAttribute("second"),10),amount:parseInt(s[u].getAttribute("amount"),10)});for(u=0;u<a.length;u++)e.distanceField.push({fieldType:a[u].getAttribute("fieldType"),distanceRange:parseInt(a[u].getAttribute("distanceRange"),10)});return e},t}(),RH=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return xH.test(e)}return!1},t.parse=function(t){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return xH.parse(e)},t}(),SH=[EH,xH,RH];function AH(t){for(var e=0;e<SH.length;e++)if(SH[e].test(t))return SH[e];return null}function IH(t,e,r,i,n,o,s){var a=r.text,u=r.fontProperties;e.translate(i,n),e.scale(o,o);var h=s.strokeThickness/2,c=-s.strokeThickness/2;if(e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=function(t,e,r,i,n,o){var s,a=r.fill;if(!Array.isArray(a))return a;if(1===a.length)return a[0];var u=r.dropShadow?r.dropShadowDistance:0,h=r.padding||0,c=t.width/i-u-2*h,l=t.height/i-u-2*h,d=a.slice(),f=r.fillGradientStops.slice();if(!f.length)for(var p=d.length+1,m=1;m<p;++m)f.push(m/p);if(d.unshift(a[0]),f.unshift(0),d.push(a[a.length-1]),f.push(1),r.fillGradientType===OX.LINEAR_VERTICAL){s=e.createLinearGradient(c/2,h,c/2,l+h);var v=0,_=(o.fontProperties.fontSize+r.strokeThickness)/l;for(m=0;m<n.length;m++)for(var y=o.lineHeight*m,g=0;g<d.length;g++){var b=y/l+("number"==typeof f[g]?f[g]:g/d.length)*_,T=Math.max(v,b);T=Math.min(T,1),s.addColorStop(T,d[g]),v=T}}else{s=e.createLinearGradient(h,l/2,c+h,l/2);var E=d.length+1,x=1;for(m=0;m<d.length;m++){var R=void 0;R="number"==typeof f[m]?f[m]:x/E,s.addColorStop(R,d[m]),x++}}return s}(t,e,s,o,[a],r),e.strokeStyle=s.stroke,s.dropShadow){var l=s.dropShadowColor,d=ND("number"==typeof l?l:DD(l)),f=s.dropShadowBlur*o,p=s.dropShadowDistance*o;e.shadowColor="rgba("+255*d[0]+","+255*d[1]+","+255*d[2]+","+s.dropShadowAlpha+")",e.shadowBlur=f,e.shadowOffsetX=Math.cos(s.dropShadowAngle)*p,e.shadowOffsetY=Math.sin(s.dropShadowAngle)*p}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;s.stroke&&s.strokeThickness&&e.strokeText(a,h,c+r.lineHeight-u.descent),s.fill&&e.fillText(a,h,c+r.lineHeight-u.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function CH(t){return Array.from?Array.from(t):t.split("")}function OH(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}var wH=function(){function t(t,e,r){var i,n,o=t.info[0],s=t.common[0],a=t.page[0],u=t.distanceField[0],h=eL(a.file),c={};this._ownsTextures=r,this.font=o.face,this.size=o.size,this.lineHeight=s.lineHeight/h,this.chars={},this.pageTextures=c;for(var l=0;l<t.page.length;l++){var d=t.page[l],f=d.id,p=d.file;c[f]=e instanceof Array?e[l]:e[p],(null==u?void 0:u.fieldType)&&"none"!==u.fieldType&&(c[f].baseTexture.alphaMode=sD.NO_PREMULTIPLIED_ALPHA)}for(l=0;l<t.char.length;l++){var m=t.char[l],v=(f=m.id,m.page),_=t.char[l],y=_.x,g=_.y,b=_.width,T=_.height,E=_.xoffset,x=_.yoffset,R=_.xadvance;g/=h,b/=h,T/=h,E/=h,x/=h,R/=h;var S=new uL((y/=h)+c[v].frame.x/h,g+c[v].frame.y/h,b,T);this.chars[f]={xOffset:E,yOffset:x,xAdvance:R,kerning:{},texture:new DU(c[v].baseTexture,S),page:v}}for(l=0;l<t.kerning.length;l++){var A=t.kerning[l],I=A.first,C=A.second,O=A.amount;I/=h,C/=h,O/=h,this.chars[C]&&(this.chars[C].kerning[I]=O)}this.distanceFieldRange=null==u?void 0:u.distanceRange,this.distanceFieldType=null!==(n=null===(i=null==u?void 0:u.fieldType)||void 0===i?void 0:i.toLowerCase())&&void 0!==n?n:"none"}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,r,i){var n;if(e instanceof TH)n=e;else{var o=AH(e);if(!o)throw new Error("Unrecognized data format for font.");n=o.parse(e)}r instanceof DU&&(r=[r]);var s=new t(n,r,i);return t.available[s.font]=s,s},t.uninstall=function(e){var r=t.available[e];if(!r)throw new Error("No font found named '"+e+"'");r.destroy(),delete t.available[e]},t.from=function(e,r,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},t.defaultOptions,i),o=n.chars,s=n.padding,a=n.resolution,u=n.textureWidth,h=n.textureHeight,c=function(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var o=n[0].charCodeAt(0),s=n[1].charCodeAt(0);if(s<o)throw new Error("[BitmapFont]: Invalid character range.");for(var a=o,u=s;a<=u;a++)e.push(String.fromCharCode(a))}else e.push.apply(e,CH(n))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(o),l=r instanceof UX?r:new UX(r),d=u,f=new TH;f.info[0]={face:l.fontFamily,size:l.fontSize},f.common[0]={lineHeight:l.fontSize};for(var p,m,v,_=0,y=0,g=0,b=[],T=0;T<c.length;T++){p||((p=document.createElement("canvas")).width=u,p.height=h,m=p.getContext("2d"),v=new yU(p,{resolution:a}),b.push(new DU(v)),f.page.push({id:b.length-1,file:""}));var E=kX.measureText(c[T],l,!1,p),x=E.width,R=Math.ceil(E.height),S=Math.ceil(("italic"===l.fontStyle?2:1)*x);if(y>=h-R*a){if(0===y)throw new Error("[BitmapFont] textureHeight "+h+"px is too small for "+l.fontSize+"px fonts");--T,p=null,m=null,v=null,y=0,_=0,g=0}else if(g=Math.max(R+E.fontProperties.descent,g),S*a+_>=d)--T,y+=g*a,y=Math.ceil(y),_=0,g=0;else{IH(p,m,E,_,y,a,l);var A=OH(E.text);f.char.push({id:A,page:b.length-1,x:_/a,y:y/a,width:S,height:R,xoffset:0,yoffset:0,xadvance:Math.ceil(x-(l.dropShadow?l.dropShadowDistance:0)-(l.stroke?l.strokeThickness:0))}),_+=(S+2*s)*a,_=Math.ceil(_)}}T=0;for(var I=c.length;T<I;T++)for(var C=c[T],O=0;O<I;O++){var w=c[O],P=m.measureText(C).width,N=m.measureText(w).width,M=m.measureText(C+w).width-(P+N);M&&f.kerning.push({first:OH(C),second:OH(w),amount:M})}var D=new t(f,b,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=D,D},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),PH=[],NH=[],MH=[];!function(t){function e(r,i){void 0===i&&(i={});var n=t.call(this)||this;n._tint=16777215;var o=Object.assign({},e.styleDefaults,i),s=o.align,a=o.tint,u=o.maxWidth,h=o.letterSpacing,c=o.fontName,l=o.fontSize;if(!wH.available[c])throw new Error('Missing BitmapFont "'+c+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=s,n._tint=a,n._fontName=c,n._fontSize=l||wH.available[c].size,n.text=r,n._maxWidth=u,n._maxLineHeight=0,n._letterSpacing=h,n._anchor=new fL((function(){n.dirty=!0}),n,0,0),n._roundPixels=aM.ROUND_PIXELS,n.dirty=!0,n._resolution=aM.RESOLUTION,n._autoResolution=!0,n._textureCache={},n}(function(t,e){function r(){this.constructor=t}bH(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),e.prototype.updateText=function(){for(var t,e=wH.available[this._fontName],r=this._fontSize/e.size,i=new sL,n=[],o=[],s=[],a=CH(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),u=this._maxWidth*e.size/this._fontSize,h="none"===e.distanceFieldType?PH:NH,c=null,l=0,d=0,f=0,p=-1,m=0,v=0,_=0,y=0,g=0;g<a.length;g++){var b=OH(k=a[g]);if(/(?:\s)/.test(k)&&(p=g,m=l,y++),"\r"!==k&&"\n"!==k){var T=e.chars[b];if(T){c&&T.kerning[c]&&(i.x+=T.kerning[c]);var E=MH.pop()||{texture:DU.EMPTY,line:0,charCode:0,prevSpaces:0,position:new sL};E.texture=T.texture,E.line=f,E.charCode=b,E.position.x=i.x+T.xOffset+this._letterSpacing/2,E.position.y=i.y+T.yOffset,E.prevSpaces=y,n.push(E),l=E.position.x+Math.max(T.xAdvance,T.texture.orig.width),i.x+=T.xAdvance+this._letterSpacing,_=Math.max(_,T.yOffset+T.texture.height),c=b,-1!==p&&u>0&&i.x>u&&(VD(n,1+p-++v,1+g-p),g=p,p=-1,o.push(m),s.push(n.length>0?n[n.length-1].prevSpaces:0),d=Math.max(d,m),f++,i.x=0,i.y+=e.lineHeight,c=null,y=0)}}else o.push(l),s.push(-1),d=Math.max(d,l),++f,++v,i.x=0,i.y+=e.lineHeight,c=null,y=0}var x=a[a.length-1];"\r"!==x&&"\n"!==x&&(/(?:\s)/.test(x)&&(l=m),o.push(l),d=Math.max(d,l),s.push(-1));var R=[];for(g=0;g<=f;g++){var S=0;"right"===this._align?S=d-o[g]:"center"===this._align?S=(d-o[g])/2:"justify"===this._align&&(S=s[g]<0?0:(d-o[g])/s[g]),R.push(S)}var A=n.length,I={},C=[],O=this._activePagesMeshData;for(g=0;g<O.length;g++)h.push(O[g]);for(g=0;g<A;g++){var w=(H=n[g].texture).baseTexture.uid;if(!I[w]){if(!(K=h.pop())){var P=new gH,N=void 0,M=void 0;"none"===e.distanceFieldType?(N=new yH(DU.EMPTY),M=JM.NORMAL):(N=new yH(DU.EMPTY,{program:PF.from("// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n","// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n  // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n  vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n  // MSDF\r\n  float median = texColor.r + texColor.g + texColor.b -\r\n                  min(texColor.r, min(texColor.g, texColor.b)) -\r\n                  max(texColor.r, max(texColor.g, texColor.b));\r\n  // SDF\r\n  median = min(median, texColor.a);\r\n\r\n  float screenPxDistance = uFWidth * (median - 0.5);\r\n  float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n\r\n  // NPM Textures, NPM outputs\r\n  gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n"),uniforms:{uFWidth:0}}),M=JM.NORMAL_NPM);var D=new _H(P,N);D.blendMode=M,K={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:D,vertices:null,uvs:null,indices:null}}K.index=0,K.indexCount=0,K.vertexCount=0,K.uvsCount=0,K.total=0;var L=this._textureCache;L[w]=L[w]||new DU(H.baseTexture),K.mesh.texture=L[w],K.mesh.tint=this._tint,C.push(K),I[w]=K}I[w].total++}for(g=0;g<O.length;g++)-1===C.indexOf(O[g])&&this.removeChild(O[g].mesh);for(g=0;g<C.length;g++)C[g].mesh.parent!==this&&this.addChild(C[g].mesh);for(var g in this._activePagesMeshData=C,I){var U=(K=I[g]).total;if(!((null===(t=K.indices)||void 0===t?void 0:t.length)>6*U)||K.vertices.length<2*_H.BATCHABLE_SIZE)K.vertices=new Float32Array(8*U),K.uvs=new Float32Array(8*U),K.indices=new Uint16Array(6*U);else for(var F=K.total,G=K.vertices,B=4*F*2;B<G.length;B++)G[B]=0;K.mesh.size=6*U}for(g=0;g<A;g++){var k,X=(k=n[g]).position.x+R[k.line]*("justify"===this._align?k.prevSpaces:1);this._roundPixels&&(X=Math.round(X));var H,j=X*r,V=k.position.y*r,Y=I[(H=k.texture).baseTexture.uid],W=H.frame,z=H._uvs,Z=Y.index++;Y.indices[6*Z+0]=0+4*Z,Y.indices[6*Z+1]=1+4*Z,Y.indices[6*Z+2]=2+4*Z,Y.indices[6*Z+3]=0+4*Z,Y.indices[6*Z+4]=2+4*Z,Y.indices[6*Z+5]=3+4*Z,Y.vertices[8*Z+0]=j,Y.vertices[8*Z+1]=V,Y.vertices[8*Z+2]=j+W.width*r,Y.vertices[8*Z+3]=V,Y.vertices[8*Z+4]=j+W.width*r,Y.vertices[8*Z+5]=V+W.height*r,Y.vertices[8*Z+6]=j,Y.vertices[8*Z+7]=V+W.height*r,Y.uvs[8*Z+0]=z.x0,Y.uvs[8*Z+1]=z.y0,Y.uvs[8*Z+2]=z.x1,Y.uvs[8*Z+3]=z.y1,Y.uvs[8*Z+4]=z.x2,Y.uvs[8*Z+5]=z.y2,Y.uvs[8*Z+6]=z.x3,Y.uvs[8*Z+7]=z.y3}for(var g in this._textWidth=d*r,this._textHeight=(i.y+e.lineHeight)*r,I){var K=I[g];if(0!==this.anchor.x||0!==this.anchor.y)for(var q=0,J=this._textWidth*this.anchor.x,Q=this._textHeight*this.anchor.y,$=0;$<K.total;$++)K.vertices[q++]-=J,K.vertices[q++]-=Q,K.vertices[q++]-=J,K.vertices[q++]-=Q,K.vertices[q++]-=J,K.vertices[q++]-=Q,K.vertices[q++]-=J,K.vertices[q++]-=Q;this._maxLineHeight=_*r;var tt=K.mesh.geometry.getBuffer("aVertexPosition"),et=K.mesh.geometry.getBuffer("aTextureCoord"),rt=K.mesh.geometry.getIndex();tt.data=K.vertices,et.data=K.uvs,rt.data=K.indices,tt.update(),et.update(),rt.update()}for(g=0;g<n.length;g++)MH.push(n[g])},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);var r=wH.available[this._fontName],i=r.distanceFieldRange,n=r.distanceFieldType,o=r.size;if("none"!==n)for(var s=this.worldTransform,a=s.a,u=s.b,h=s.c,c=s.d,l=Math.sqrt(a*a+u*u),d=Math.sqrt(h*h+c*c),f=(Math.abs(l)+Math.abs(d))/2,p=this._fontSize/o,m=0,v=this._activePagesMeshData;m<v.length;m++){v[m].mesh.shader.uniforms.uFWidth=f*i*p*this._resolution}t.prototype._render.call(this,e)},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!wH.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(e){var r=this._textureCache;for(var i in r){r[i].destroy(),delete r[i]}this._textureCache=null,t.prototype.destroy.call(this,e)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0}}(KL);var DH=function(){function t(){}return t.add=function(){YB.setExtensionXhrType("fnt",YB.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,r){var i=AH(e.data);if(i)for(var n=t.getBaseUrl(this,e),o=i.parse(e.data),s={},a=function(t){s[t.metadata.pageFile]=t.texture,Object.keys(s).length===o.page.length&&(e.bitmapFont=wH.install(o,s,!0),r())},u=0;u<o.page.length;++u){var h=o.page[u].file,c=n+h,l=!1;for(var d in this.resources){var f=this.resources[d];if(f.url===c){f.metadata.pageFile=h,f.texture?a(f):f.onAfterMiddleware.add(a),l=!0;break}}if(!l){var p={crossOrigin:e.crossOrigin,loadType:YB.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:h},e.metadata.imageMetadata),parentResource:e};this.add(c,p,a)}}else r()},t.getBaseUrl=function(e,r){var i=r.isDataUrl?"":t.dirname(r.url);return r.isDataUrl&&("."===i&&(i=""),e.baseUrl&&i&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(i+="/")),(i=i.replace(e.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/"),i},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}(),LH=function(t,e){return LH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},LH(t,e)};!function(t){function e(e){void 0===e&&(e=1);var r=t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n   gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1})||this;return r.alpha=e,r}(function(t,e){function r(){this.constructor=t}LH(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0})}(DF);var UH=function(t,e){return UH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},UH(t,e)};function FH(t,e){function r(){this.constructor=t}UH(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var GH,BH,kH,XH,HH,jH,VH,YH,WH,zH,ZH,KH,qH,JH,QH,$H,tj,ej,rj,ij={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},nj=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","    gl_FragColor = vec4(0.0);","    %blur%","}"].join("\n");!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(GH||(GH={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(BH||(BH={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(kH||(kH={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(XH||(XH={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(HH||(HH={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(jH||(jH={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(VH||(VH={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(YH||(YH={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(WH||(WH={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(zH||(zH={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(ZH||(ZH={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(KH||(KH={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(qH||(qH={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(JH||(JH={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(QH||(QH={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}($H||($H={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(tj||(tj={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(ej||(ej={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(rj||(rj={}));var oj=function(t){function e(e,r,i,n,o){void 0===r&&(r=8),void 0===i&&(i=4),void 0===n&&(n=aM.FILTER_RESOLUTION),void 0===o&&(o=5);var s=this,a=function(t,e){var r,i=Math.ceil(t/2),n="\n    attribute vec2 aVertexPosition;\n\n    uniform mat3 projectionMatrix;\n\n    uniform float strength;\n\n    varying vec2 vBlurTexCoords[%size%];\n\n    uniform vec4 inputSize;\n    uniform vec4 outputFrame;\n\n    vec4 filterVertexPosition( void )\n    {\n        vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n        return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n    }\n\n    vec2 filterTextureCoord( void )\n    {\n        return aVertexPosition * (outputFrame.zw * inputSize.zw);\n    }\n\n    void main(void)\n    {\n        gl_Position = filterVertexPosition();\n\n        vec2 textureCoord = filterTextureCoord();\n        %blur%\n    }",o="";r=e?"vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s<t;s++){var a=r.replace("%index%",s.toString());o+=a=a.replace("%sampleIndex%",s-(i-1)+".0"),o+="\n"}return(n=n.replace("%blur%",o)).replace("%size%",t.toString())}(o,e),u=function(t){for(var e,r=ij[t],i=r.length,n=nj,o="",s=0;s<t;s++){var a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",s.toString());e=s,s>=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e].toString()),o+="\n"}return(n=n.replace("%blur%",o)).replace("%size%",t.toString())}(o);return(s=t.call(this,a,u)||this).horizontal=e,s.resolution=n,s._quality=0,s.quality=i,s.blur=r,s}return FH(e,t),e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,JH.CLEAR);for(var u=1;u<this.passes-1;u++){t.bindAndClear(s,JH.BLIT),this.uniforms.uSampler=a;var h=a;a=s,s=h,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,a,r,i),t.returnFilterTexture(n)}},Object.defineProperty(e.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+2*Math.abs(t),this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),e}(DF);!function(t){function e(e,r,i,n){void 0===e&&(e=8),void 0===r&&(r=4),void 0===i&&(i=aM.FILTER_RESOLUTION),void 0===n&&(n=5);var o=t.call(this)||this;return o.blurXFilter=new oj(!0,e,r,i,n),o.blurYFilter=new oj(!1,e,r,i,n),o.resolution=i,o.quality=r,o.blur=e,o.repeatEdgePixels=!1,o}FH(e,t),e.prototype.apply=function(t,e,r,i){var n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){var s=t.getFilterTexture();this.blurXFilter.apply(t,e,s,JH.CLEAR),this.blurYFilter.apply(t,s,r,i),t.returnFilterTexture(s)}else o?this.blurYFilter.apply(t,e,r,i):this.blurXFilter.apply(t,e,r,i)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))},Object.defineProperty(e.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0})}(DF);var sj=function(t,e){return sj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},sj(t,e)};var aj=function(t){function e(){var e=this,r={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(e=t.call(this,dG,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    if (uAlpha == 0.0) {\n        gl_FragColor = c;\n        return;\n    }\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (c.a > 0.0) {\n      c.rgb /= c.a;\n    }\n\n    vec4 result;\n\n    result.r = (m[0] * c.r);\n        result.r += (m[1] * c.g);\n        result.r += (m[2] * c.b);\n        result.r += (m[3] * c.a);\n        result.r += m[4];\n\n    result.g = (m[5] * c.r);\n        result.g += (m[6] * c.g);\n        result.g += (m[7] * c.b);\n        result.g += (m[8] * c.a);\n        result.g += m[9];\n\n    result.b = (m[10] * c.r);\n       result.b += (m[11] * c.g);\n       result.b += (m[12] * c.b);\n       result.b += (m[13] * c.a);\n       result.b += m[14];\n\n    result.a = (m[15] * c.r);\n       result.a += (m[16] * c.g);\n       result.a += (m[17] * c.b);\n       result.a += (m[18] * c.a);\n       result.a += m[19];\n\n    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n    // Premultiply alpha again.\n    rgb *= result.a;\n\n    gl_FragColor = vec4(rgb, result.a);\n}\n",r)||this).alpha=1,e}return function(t,e){function r(){this.constructor=t}sj(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.tint=function(t,e){var r=[(t>>16&255)/255,0,0,0,0,0,(t>>8&255)/255,0,0,0,0,0,(255&t)/255,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,u=((i=i||3375104)>>16&255)/255,h=(i>>8&255)/255,c=(255&i)/255,l=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,u,h,c,e=e||.15,0,o-u,s-h,a-c,0,0];this._loadMatrix(l,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(DF);aj.prototype.grayscale=aj.prototype.greyscale;var uj=function(t,e){return uj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},uj(t,e)};!function(t){function e(e,r){var i=this,n=new pL;return e.renderable=!1,(i=t.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0)  ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n  vec4 map =  texture2D(mapSampler, vFilterCoord);\n\n  map -= 0.5;\n  map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n  gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:e._texture,filterMatrix:n,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,i.maskMatrix=n,null==r&&(r=20),i.scale=new sL(r,r),i}(function(t,e){function r(){this.constructor=t}uj(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0})}(DF);var hj=function(t,e){return hj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},hj(t,e)};!function(t){function e(){return t.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n               out vec2 v_rgbNW, out vec2 v_rgbNE,\n               out vec2 v_rgbSW, out vec2 v_rgbSE,\n               out vec2 v_rgbM) {\n    v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n    v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n    v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n    v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n    v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n   gl_Position = filterVertexPosition();\n\n   vFragCoord = aVertexPosition * outputFrame.zw;\n\n   texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN   (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL   (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX     8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n          vec2 v_rgbNW, vec2 v_rgbNE,\n          vec2 v_rgbSW, vec2 v_rgbSE,\n          vec2 v_rgbM) {\n    vec4 color;\n    vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n    vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n    vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n    vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n    vec4 texColor = texture2D(tex, v_rgbM);\n    vec3 rgbM  = texColor.xyz;\n    vec3 luma = vec3(0.299, 0.587, 0.114);\n    float lumaNW = dot(rgbNW, luma);\n    float lumaNE = dot(rgbNE, luma);\n    float lumaSW = dot(rgbSW, luma);\n    float lumaSE = dot(rgbSE, luma);\n    float lumaM  = dot(rgbM,  luma);\n    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n    mediump vec2 dir;\n    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n                          (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n              max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n                  dir * rcpDirMin)) * inverseVP;\n\n    vec3 rgbA = 0.5 * (\n                       texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n                       texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n    vec3 rgbB = rgbA * 0.5 + 0.25 * (\n                                     texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n                                     texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n    float lumaB = dot(rgbB, luma);\n    if ((lumaB < lumaMin) || (lumaB > lumaMax))\n        color = vec4(rgbA, texColor.a);\n    else\n        color = vec4(rgbB, texColor.a);\n    return color;\n}\n\nvoid main() {\n\n      vec4 color;\n\n      color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n      gl_FragColor = color;\n}\n')||this}(function(t,e){function r(){this.constructor=t}hj(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t)}(DF);var cj=function(t,e){return cj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},cj(t,e)};var lj,dj,fj,pj,mj,vj,_j,yj,gj,bj,Tj,Ej,xj,Rj,Sj,Aj,Ij,Cj,Oj;!function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random());var i=t.call(this,dG,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n    vec4 color = texture2D(uSampler, vTextureCoord);\n    float randomValue = rand(gl_FragCoord.xy * uSeed);\n    float diff = (randomValue - 0.5) * uNoise;\n\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\n    if (color.a > 0.0) {\n        color.rgb /= color.a;\n    }\n\n    color.r += diff;\n    color.g += diff;\n    color.b += diff;\n\n    // Premultiply alpha again.\n    color.rgb *= color.a;\n\n    gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return i.noise=e,i.seed=r,i}(function(t,e){function r(){this.constructor=t}cj(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0})}(DF),function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(lj||(lj={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(dj||(dj={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(fj||(fj={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(pj||(pj={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(mj||(mj={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(vj||(vj={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(_j||(_j={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(yj||(yj={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(gj||(gj={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(bj||(bj={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Tj||(Tj={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(Ej||(Ej={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(xj||(xj={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(Rj||(Rj={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(Sj||(Sj={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(Aj||(Aj={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(Ij||(Ij={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(Cj||(Cj={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(Oj||(Oj={}));var wj=new pL;WL.prototype._cacheAsBitmap=!1,WL.prototype._cacheData=null,WL.prototype._cacheAsBitmapResolution=null,WL.prototype._cacheAsBitmapMultisample=Cj.NONE;var Pj=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(WL.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Pj),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),WL.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},WL.prototype._initCachedDisplayObject=function(t){var e;if(!this._cacheData||!this._cacheData.sprite){var r=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var n=this.filters[0].padding;i.pad(n)}i.ceil(aM.RESOLUTION);var o=t.renderTexture.current,s=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),u=t.projection.transform,h=LU.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!==(e=this.cacheAsBitmapMultisample)&&void 0!==e?e:t.multisample}),c="cacheAsBitmap_"+zD();this._cacheData.textureCacheId=c,yU.addToCache(h.baseTexture,c),DU.addToCache(h,c);var l=this.transform.localTransform.copyTo(wj).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:h,clear:!0,transform:l,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=u,t.renderTexture.bind(o,s,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var d=new NX(h);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-i.x/i.width,d.anchor.y=-i.y/i.height,d.alpha=r,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},WL.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},WL.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),r=this.alpha;this.alpha=1;var i=t.context,n=t._projTransform;e.ceil(aM.RESOLUTION);var o=LU.create({width:e.width,height:e.height}),s="cacheAsBitmap_"+zD();this._cacheData.textureCacheId=s,yU.addToCache(o.baseTexture,s),DU.addToCache(o,s);var a=wj;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:o,clear:!0,transform:a,skipUpdateTransform:!1}),t.context=i,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var u=new NX(o);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-e.x/e.width,u.anchor.y=-e.y/e.height,u.alpha=r,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},WL.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},WL.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},WL.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,yU.removeFromCache(this._cacheData.textureCacheId),DU.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},WL.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},WL.prototype.name=null,KL.prototype.getChildByName=function(t,e){for(var r=0,i=this.children.length;r<i;r++)if(this.children[r].name===t)return this.children[r];if(e)for(r=0,i=this.children.length;r<i;r++){if(this.children[r].getChildByName){var n=this.children[r].getChildByName(t,!0);if(n)return n}}return null},WL.prototype.getGlobalPosition=function(t,e){return void 0===t&&(t=new sL),void 0===e&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};var Nj=function(t,e){return Nj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Nj(t,e)};function Mj(t,e){function r(){this.constructor=t}Nj(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var Dj=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10);var o=t.call(this)||this;return o.segWidth=i,o.segHeight=n,o.width=e,o.height=r,o.build(),o}return Mj(e,t),e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,u=0;u<t;u++){var h=u%this.segWidth,c=u/this.segWidth|0;e.push(h*s,c*a),r.push(h/n,c/o)}var l=n*o;for(u=0;u<l;u++){var d=u%n,f=u/n|0,p=f*this.segWidth+d,m=f*this.segWidth+d+1,v=(f+1)*this.segWidth+d,_=(f+1)*this.segWidth+d+1;i.push(p,m,v,m,_,v)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(r),this.indexBuffer.data=new Uint16Array(i),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(gH),Lj=function(t){function e(e,r,i){void 0===e&&(e=200),void 0===i&&(i=0);var n=t.call(this,new Float32Array(4*r.length),new Float32Array(4*r.length),new Uint16Array(6*(r.length-1)))||this;return n.points=r,n._width=e,n.textureScale=i,n.build(),n}return Mj(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),e.prototype.build=function(){var t=this.points;if(t){var e=this.getBuffer("aVertexPosition"),r=this.getBuffer("aTextureCoord"),i=this.getIndex();if(!(t.length<1)){e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),r.data=new Float32Array(4*t.length),i.data=new Uint16Array(6*(t.length-1)));var n=r.data,o=i.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;for(var s=0,a=t[0],u=this._width*this.textureScale,h=t.length,c=0;c<h;c++){var l=4*c;if(this.textureScale>0){var d=a.x-t[c].x,f=a.y-t[c].y,p=Math.sqrt(d*d+f*f);a=t[c],s+=p/u}else s=c/(h-1);n[l]=s,n[l+1]=0,n[l+2]=s,n[l+3]=1}var m=0;for(c=0;c<h-1;c++){l=2*c;o[m++]=l,o[m++]=l+1,o[m++]=l+2,o[m++]=l+2,o[m++]=l+1,o[m++]=l+3}r.update(),i.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var e,r=t[0],i=0,n=0,o=this.buffers[0].data,s=t.length,a=0;a<s;a++){var u=t[a],h=4*a;n=-((e=a<t.length-1?t[a+1]:u).x-r.x),i=e.y-r.y;var c=Math.sqrt(i*i+n*n),l=this.textureScale>0?this.textureScale*this._width/2:this._width/2;i/=c,n/=c,i*=l,n*=l,o[h]=u.x+i,o[h+1]=u.y+n,o[h+2]=u.x-i,o[h+3]=u.y-n,r=u}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(gH),Uj=function(t){function e(e,r,i){void 0===i&&(i=0);var n=this,o=new Lj(e.height,r,i),s=new yH(e);return i>0&&(e.baseTexture.wrapMode=nD.REPEAT),(n=t.call(this,o,s)||this).autoUpdate=!0,n}return Mj(e,t),e.prototype._render=function(e){var r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),t.prototype._render.call(this,e)},e}(_H),Fj=function(t){function e(e,r,i){var n=this,o=new Dj(e.width,e.height,r,i),s=new yH(DU.WHITE);return(n=t.call(this,o,s)||this).texture=e,n.autoResize=!0,n}return Mj(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,e=this.shader.texture,r=e.width,i=e.height;!this.autoResize||t.width===r&&t.height===i||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(_H),Gj=function(t){function e(e,r,i,n,o){void 0===e&&(e=DU.EMPTY);var s=this,a=new gH(r,i,n);a.getBuffer("aVertexPosition").static=!1;var u=new yH(e);return(s=t.call(this,a,u,null,o)||this).autoUpdate=!0,s}return Mj(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(_H),Bj=function(t){function e(e,r,i,n,o){void 0===r&&(r=10),void 0===i&&(i=10),void 0===n&&(n=10),void 0===o&&(o=10);var s=t.call(this,DU.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=r,s._rightWidth=n,s._topHeight=i,s._bottomHeight=o,s.texture=e,s}return Mj(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,r=this._topHeight+this._bottomHeight,i=this._height>r?1:this._height/r;return Math.min(e,i)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(Fj),kj=function(t,e){return kj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},kj(t,e)};!function(t){function e(e,r){void 0===r&&(r=!0);var i=t.call(this,e[0]instanceof DU?e[0]:e[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=r,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=e,i}(function(t,e){function r(){this.constructor=t}kj(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(e,t),e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&($L.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&($L.shared.add(this.update,this,qL.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<r||this.animationSpeed<0&&this.currentFrame>r)&&this.onLoop(),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;i<t.length;++i)r.push(DU.from(t[i]));return new e(r)},e.fromImages=function(t){for(var r=[],i=0;i<t.length;++i)r.push(DU.from(t[i]));return new e(r)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof DU)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?($L.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&($L.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0})}(NX),cG.registerPlugin("accessibility",JL),cG.registerPlugin("extract",LB),cG.registerPlugin("interaction",uU),cG.registerPlugin("particle",Qk),cG.registerPlugin("prepare",rH),cG.registerPlugin("batch",EG),cG.registerPlugin("tilingSprite",lH),JB.registerPlugin(DH),JB.registerPlugin(ck),JB.registerPlugin(Ok),JB.registerPlugin(Yk),JB.registerPlugin(nH),xG.registerPlugin(tU),xG.registerPlugin(tk);var Xj=function(t,e){return Xj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Xj(t,e)};var Hj=function(){function t(t){this._foundShapes=[],this.renderer=t}return t.prototype.pushMask=function(t){var e=this.renderer,r=t.maskObject||t;e.context.save();var i=this._foundShapes;if(this.recursiveFindShapes(r,i),i.length>0){var n=e.context;n.beginPath();for(var o=0;o<i.length;o++){var s=i[o],a=s.transform.worldTransform;this.renderer.setContextTransform(a),this.renderGraphicsShape(s)}i.length=0,n.clip()}},t.prototype.recursiveFindShapes=function(t,e){t.geometry&&t.geometry.graphicsData&&e.push(t);var r=t.children;if(r)for(var i=0;i<r.length;i++)this.recursiveFindShapes(r[i],e)},t.prototype.renderGraphicsShape=function(t){t.finishPoly();var e=this.renderer.context,r=t.geometry.graphicsData,i=r.length;if(0!==i)for(var n=0;n<i;n++){var o=r[n],s=o.shape;if(s.type===rL.POLY){var a=s.points,u=o.holes,h=void 0,c=void 0,l=void 0,d=void 0;e.moveTo(a[0],a[1]);for(var f=1;f<a.length/2;f++)e.lineTo(a[2*f],a[2*f+1]);if(u.length>0){h=0,l=a[0],d=a[1];for(f=2;f+2<a.length;f+=2)h+=(a[f]-l)*(a[f+3]-d)-(a[f+2]-l)*(a[f+1]-d);for(var p=0;p<u.length;p++)if(a=u[p].shape.points){c=0,l=a[0],d=a[1];for(f=2;f+2<a.length;f+=2)c+=(a[f]-l)*(a[f+3]-d)-(a[f+2]-l)*(a[f+1]-d);if(c*h<0){e.moveTo(a[0],a[1]);for(f=2;f<a.length;f+=2)e.lineTo(a[f],a[f+1])}else{e.moveTo(a[a.length-2],a[a.length-1]);for(f=a.length-4;f>=0;f-=2)e.lineTo(a[f],a[f+1])}u[p].shape.closeStroke&&e.closePath()}}a[0]===a[a.length-2]&&a[1]===a[a.length-1]&&e.closePath()}else if(s.type===rL.RECT)e.rect(s.x,s.y,s.width,s.height),e.closePath();else if(s.type===rL.CIRC)e.arc(s.x,s.y,s.radius,0,2*Math.PI),e.closePath();else if(s.type===rL.ELIP){var m=2*s.width,v=2*s.height,_=s.x-m/2,y=s.y-v/2,g=.5522848,b=m/2*g,T=v/2*g,E=_+m,x=y+v,R=_+m/2,S=y+v/2;e.moveTo(_,S),e.bezierCurveTo(_,S-T,R-b,y,R,y),e.bezierCurveTo(R+b,y,E,S-T,E,S),e.bezierCurveTo(E,S+T,R+b,x,R,x),e.bezierCurveTo(R-b,x,_,S+T,_,S),e.closePath()}else if(s.type===rL.RREC){var A=s.x,I=s.y,C=s.width,O=s.height,w=s.radius,P=Math.min(C,O)/2;w=w>P?P:w,e.moveTo(A,I+w),e.lineTo(A,I+O-w),e.quadraticCurveTo(A,I+O,A+w,I+O),e.lineTo(A+C-w,I+O),e.quadraticCurveTo(A+C,I+O,A+C,I+O-w),e.lineTo(A+C,I+w),e.quadraticCurveTo(A+C,I,A+C-w,I),e.lineTo(A+w,I),e.quadraticCurveTo(A,I,A,I+w),e.closePath()}}},t.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},t.prototype.destroy=function(){},t}();function jj(t){var e=document.createElement("canvas");e.width=6,e.height=1;var r=e.getContext("2d");return r.fillStyle=t,r.fillRect(0,0,6,1),e}function Vj(){if("undefined"==typeof document)return!1;var t=jj("#ff00ff"),e=jj("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var i=r.getContext("2d");i.globalCompositeOperation="multiply",i.drawImage(t,0,0),i.drawImage(e,2,0);var n=i.getImageData(2,0,1,1);if(!n)return!1;var o=n.data;return 255===o[0]&&0===o[1]&&0===o[2]}var Yj=new pL,Wj=function(t){function e(r){var i,n=t.call(this,KM.CANVAS,r)||this;if(n.refresh=!0,n.maskManager=new Hj(n),n.smoothProperty="imageSmoothingEnabled",n.blendModes=(void 0===i&&(i=[]),Vj()?(i[JM.NORMAL]="source-over",i[JM.ADD]="lighter",i[JM.MULTIPLY]="multiply",i[JM.SCREEN]="screen",i[JM.OVERLAY]="overlay",i[JM.DARKEN]="darken",i[JM.LIGHTEN]="lighten",i[JM.COLOR_DODGE]="color-dodge",i[JM.COLOR_BURN]="color-burn",i[JM.HARD_LIGHT]="hard-light",i[JM.SOFT_LIGHT]="soft-light",i[JM.DIFFERENCE]="difference",i[JM.EXCLUSION]="exclusion",i[JM.HUE]="hue",i[JM.SATURATION]="saturate",i[JM.COLOR]="color",i[JM.LUMINOSITY]="luminosity"):(i[JM.NORMAL]="source-over",i[JM.ADD]="lighter",i[JM.MULTIPLY]="source-over",i[JM.SCREEN]="source-over",i[JM.OVERLAY]="source-over",i[JM.DARKEN]="source-over",i[JM.LIGHTEN]="source-over",i[JM.COLOR_DODGE]="source-over",i[JM.COLOR_BURN]="source-over",i[JM.HARD_LIGHT]="source-over",i[JM.SOFT_LIGHT]="source-over",i[JM.DIFFERENCE]="source-over",i[JM.EXCLUSION]="source-over",i[JM.HUE]="source-over",i[JM.SATURATION]="source-over",i[JM.COLOR]="source-over",i[JM.LUMINOSITY]="source-over"),i[JM.NORMAL_NPM]=i[JM.NORMAL],i[JM.ADD_NPM]=i[JM.ADD],i[JM.SCREEN_NPM]=i[JM.SCREEN],i[JM.SRC_IN]="source-in",i[JM.SRC_OUT]="source-out",i[JM.SRC_ATOP]="source-atop",i[JM.DST_OVER]="destination-over",i[JM.DST_IN]="destination-in",i[JM.DST_OUT]="destination-out",i[JM.DST_ATOP]="destination-atop",i[JM.XOR]="xor",i[JM.SUBTRACT]="source-over",i),n.renderingToScreen=!1,n._activeBlendMode=null,n._projTransform=null,n._outerBlend=!1,n.rootContext=n.view.getContext("2d",{alpha:n.useContextAlpha}),n.context=n.rootContext,!n.rootContext.imageSmoothingEnabled){var o=n.rootContext;o.webkitImageSmoothingEnabled?n.smoothProperty="webkitImageSmoothingEnabled":o.mozImageSmoothingEnabled?n.smoothProperty="mozImageSmoothingEnabled":o.oImageSmoothingEnabled?n.smoothProperty="oImageSmoothingEnabled":o.msImageSmoothingEnabled&&(n.smoothProperty="msImageSmoothingEnabled")}return n.initPlugins(e.__plugins),wD("Canvas"),n.resize(n.options.width,n.options.height),n}return function(t,e){function r(){this.constructor=t}Xj(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.addSystem=function(){return this},e.prototype.render=function(t,e){if(this.view){var r,i,n,o;e&&(e instanceof LU||e instanceof wU?(KD("6.0.0","CanvasRenderer#render arguments changed, use options instead."),r=e,i=arguments[2],n=arguments[3],o=arguments[4]):(r=e.renderTexture,i=e.clear,n=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.emit("prerender");var s=this.resolution;r?((r=r.castToBaseTexture())._canvasRenderTarget||(r._canvasRenderTarget=new tL(r.width,r.height,r.resolution),r.resource=new EU(r._canvasRenderTarget.canvas),r.valid=!0),this.context=r._canvasRenderTarget.context,this.resolution=r._canvasRenderTarget.resolution):this.context=this.rootContext;var a=this.context;if(this._projTransform=n||null,r||(this._lastObjectRendered=t),!o){var u=t.enableTempParent();t.updateTransform(),t.disableTempParent(u)}if(a.save(),a.setTransform(1,0,0,1,0,0),a.globalAlpha=1,this._activeBlendMode=JM.NORMAL,this._outerBlend=!1,a.globalCompositeOperation=this.blendModes[JM.NORMAL],void 0!==i?i:this.clearBeforeRender)if(this.renderingToScreen)a.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(a.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,a.fillStyle=this._backgroundColorString,a.fillRect(0,0,this.width,this.height),a.globalAlpha=1);else{r._canvasRenderTarget.clear();var h=r.clearColor;h[3]>0&&(a.globalAlpha=this.useContextAlpha?h[3]:1,a.fillStyle=MD(LD(h)),a.fillRect(0,0,r.realWidth,r.realHeight),a.globalAlpha=1)}var c=this.context;this.context=a,t.renderCanvas(this),this.context=c,a.restore(),this.resolution=s,this._projTransform=null,this.emit("postrender")}},e.prototype.setContextTransform=function(t,e,r){var i=t,n=this._projTransform,o=this.resolution;r=r||o,n&&((i=Yj).copyFrom(t),i.prepend(n)),e?this.context.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*o|0,i.ty*o|0):this.context.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*o,i.ty*o)},e.prototype.clear=function(t,e){void 0===t&&(t=this._backgroundColorString),void 0===e&&(e=this.backgroundAlpha);var r=this.context;r.clearRect(0,0,this.width,this.height),t&&(r.globalAlpha=this.useContextAlpha?e:1,r.fillStyle=t,r.fillRect(0,0,this.width,this.height),r.globalAlpha=1)},e.prototype.setBlendMode=function(t,e){var r=t===JM.SRC_IN||t===JM.SRC_OUT||t===JM.DST_IN||t===JM.DST_ATOP;!e&&r&&(t=JM.NORMAL),this._activeBlendMode!==t&&(this._activeBlendMode=t,this._outerBlend=r,this.context.globalCompositeOperation=this.blendModes[t])},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.smoothProperty&&(this.rootContext[this.smoothProperty]=aM.SCALE_MODE===iD.LINEAR)},e.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(aG),zj={canvas:null,getTintedCanvas:function(t,e){var r=t.texture,i="#"+("00000"+(0|(e=zj.roundColor(e))).toString(16)).slice(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=document.createElement("canvas");return zj.tintMethod(r,e,n),n.tintId=r._updateID,r.tintCache[i]=n,n},getTintedPattern:function(t,e){var r="#"+("00000"+(0|(e=zj.roundColor(e))).toString(16)).slice(-6);t.patternCache=t.patternCache||{};var i=t.patternCache[r];return i&&i.tintId===t._updateID||(zj.canvas||(zj.canvas=document.createElement("canvas")),zj.tintMethod(t,e,zj.canvas),(i=zj.canvas.getContext("2d").createPattern(zj.canvas,"repeat")).tintId=t._updateID,t.patternCache[r]=i),i},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).slice(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).slice(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=ND(e),a=s[0],u=s[1],h=s[2],c=i.getImageData(0,0,n.width,n.height),l=c.data,d=0;d<l.length;d+=4)l[d+0]*=a,l[d+1]*=u,l[d+2]*=h;i.putImageData(c,0,0)},roundColor:function(t){var e=zj.cacheStepsPerColorChannel,r=ND(t);return r[0]=Math.min(255,r[0]/e*e),r[1]=Math.min(255,r[1]/e*e),r[2]=Math.min(255,r[2]/e*e),LD(r)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:Vj(),tintMethod:null};zj.tintMethod=zj.canUseMultiply?zj.tintWithMultiply:zj.tintWithPerPixel;var Zj=cG.create;cG.create=function(t){if(!(t&&t.forceCanvas))try{return Zj(t)}catch(t){}return new Wj(t)},yU.prototype.getDrawableSource=function(){var t=this.resource;return t?t.bitmap||t.source:null},wU.prototype._canvasRenderTarget=null,DU.prototype.patternCache=null,DU.prototype.tintCache=null;var Kj="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function qj(t,e,r){return r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},t(r,r.exports),r.exports}var Jj=qj((function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n<o;n++)s[n]=i[n].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,n,o,s){var a=arguments,u=r?r+t:t;if(!this._events[u])return!1;var h,c,l=this._events[u],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,n),!0;case 5:return l.fn.call(l.context,e,i,n,o),!0;case 6:return l.fn.call(l.context,e,i,n,o,s),!0}for(c=1,h=new Array(d-1);c<d;c++)h[c-1]=a[c];l.fn.apply(l.context,h)}else{var f,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,i);break;case 4:l[c].fn.call(l[c].context,e,i,n);break;default:if(!h)for(f=1,h=new Array(d-1);f<d;f++)h[f-1]=a[f];l[c].fn.apply(l[c].context,h)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,i,n){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||n&&!a.once||i&&a.context!==i||s(this,o);else{for(var u=0,h=[],c=a.length;u<c;u++)(a[u].fn!==e||n&&!a[u].once||i&&a[u].context!==i)&&h.push(a[u]);h.length?this._events[o]=1===h.length?h[0]:h:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a})),Qj=qj((function(t,e){!function(r){var i=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,o="object"==typeof Kj&&Kj;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var s,a,u=2147483647,h=36,c=/^xn--/,l=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(t){throw RangeError(f[t])}function _(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function y(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+_((t=t.replace(d,".")).split("."),e).join(".")}function g(t){for(var e,r,i=[],n=0,o=t.length;n<o;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<o?56320==(64512&(r=t.charCodeAt(n++)))?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--):i.push(e);return i}function b(t){return _(t,(function(t){var e="";return t>65535&&(e+=m((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=m(t)})).join("")}function T(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function E(t,e,r){var i=0;for(t=r?p(t/700):t>>1,t+=p(t/e);t>455;i+=h)t=p(t/35);return p(i+36*t/(t+38))}function x(t){var e,r,i,n,o,s,a,c,l,d,f,m=[],_=t.length,y=0,g=128,T=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i<r;++i)t.charCodeAt(i)>=128&&v("not-basic"),m.push(t.charCodeAt(i));for(n=r>0?r+1:0;n<_;){for(o=y,s=1,a=h;n>=_&&v("invalid-input"),((c=(f=t.charCodeAt(n++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||c>p((u-y)/s))&&v("overflow"),y+=c*s,!(c<(l=a<=T?1:a>=T+26?26:a-T));a+=h)s>p(u/(d=h-l))&&v("overflow"),s*=d;T=E(y-o,e=m.length+1,0==o),p(y/e)>u-g&&v("overflow"),g+=p(y/e),y%=e,m.splice(y++,0,g)}return b(m)}function R(t){var e,r,i,n,o,s,a,c,l,d,f,_,y,b,x,R=[];for(_=(t=g(t)).length,e=128,r=0,o=72,s=0;s<_;++s)(f=t[s])<128&&R.push(m(f));for(i=n=R.length,n&&R.push("-");i<_;){for(a=u,s=0;s<_;++s)(f=t[s])>=e&&f<a&&(a=f);for(a-e>p((u-r)/(y=i+1))&&v("overflow"),r+=(a-e)*y,e=a,s=0;s<_;++s)if((f=t[s])<e&&++r>u&&v("overflow"),f==e){for(c=r,l=h;!(c<(d=l<=o?1:l>=o+26?26:l-o));l+=h)x=c-d,b=h-d,R.push(m(T(d+x%b,0))),c=p(x/b);R.push(m(T(c,0))),o=E(r,y,i==n),r=0,++i}++r,++e}return R.join("")}if(s={version:"1.3.2",ucs2:{decode:g,encode:b},decode:x,encode:R,toASCII:function(t){return y(t,(function(t){return l.test(t)?"xn--"+R(t):t}))},toUnicode:function(t){return y(t,(function(t){return c.test(t)?x(t.slice(4).toLowerCase()):t}))}},i&&n)if(t.exports==i)n.exports=s;else for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);else r.punycode=s}(Kj)})),$j=function(t){return"string"==typeof t},tV=function(t){return"object"==typeof t&&null!==t},eV=function(t){return null===t},rV=function(t){return null==t};function iV(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var nV=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var u=0;u<a;++u){var h,c,l,d,f=t[u].replace(o,"%20"),p=f.indexOf(r);p>=0?(h=f.substr(0,p),c=f.substr(p+1)):(h=f,c=""),l=decodeURIComponent(h),d=decodeURIComponent(c),iV(n,l)?Array.isArray(n[l])?n[l].push(d):n[l]=[n[l],d]:n[l]=d}return n},oV=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},sV=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(oV(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(oV(t))})).join(e):n+encodeURIComponent(oV(t[i]))})).join(e):i?encodeURIComponent(oV(i))+r+encodeURIComponent(oV(t)):""},aV=qj((function(t,e){e.decode=e.parse=nV,e.encode=e.stringify=sV})),uV=RV,hV=function(t,e){return RV(t,!1,!0).resolve(e)},cV=function(t){$j(t)&&(t=RV(t));if(!(t instanceof lV))return lV.prototype.format.call(t);return t.format()};function lV(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var dV=/^([a-z0-9.+-]+:)/i,fV=/:[0-9]*$/,pV=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,mV=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),vV=["'"].concat(mV),_V=["%","/","?",";","#"].concat(vV),yV=["/","?","#"],gV=/^[+a-z0-9A-Z_-]{0,63}$/,bV=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,TV={javascript:!0,"javascript:":!0},EV={javascript:!0,"javascript:":!0},xV={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function RV(t,e,r){if(t&&tV(t)&&t instanceof lV)return t;var i=new lV;return i.parse(t,e,r),i}lV.prototype.parse=function(t,e,r){if(!$j(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(n);if(s=s.trim(),!r&&1===t.split("#").length){var a=pV.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?aV.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=dV.exec(s);if(u){var h=(u=u[0]).toLowerCase();this.protocol=h,s=s.substr(u.length)}if(r||u||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===s.substr(0,2);!c||u&&EV[u]||(s=s.substr(2),this.slashes=!0)}if(!EV[u]&&(c||u&&!xV[u])){for(var l,d,f=-1,p=0;p<yV.length;p++){-1!==(m=s.indexOf(yV[p]))&&(-1===f||m<f)&&(f=m)}-1!==(d=-1===f?s.lastIndexOf("@"):s.lastIndexOf("@",f))&&(l=s.slice(0,d),s=s.slice(d+1),this.auth=decodeURIComponent(l)),f=-1;for(p=0;p<_V.length;p++){var m;-1!==(m=s.indexOf(_V[p]))&&(-1===f||m<f)&&(f=m)}-1===f&&(f=s.length),this.host=s.slice(0,f),s=s.slice(f),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var _=this.hostname.split(/\./),y=(p=0,_.length);p<y;p++){var g=_[p];if(g&&!g.match(gV)){for(var b="",T=0,E=g.length;T<E;T++)g.charCodeAt(T)>127?b+="x":b+=g[T];if(!b.match(gV)){var x=_.slice(0,p),R=_.slice(p+1),S=g.match(bV);S&&(x.push(S[1]),R.unshift(S[2])),R.length&&(s="/"+R.join(".")+s),this.hostname=x.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=Qj.toASCII(this.hostname));var A=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+A,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!TV[h])for(p=0,y=vV.length;p<y;p++){var C=vV[p];if(-1!==s.indexOf(C)){var O=encodeURIComponent(C);O===C&&(O=escape(C)),s=s.split(C).join(O)}}var w=s.indexOf("#");-1!==w&&(this.hash=s.substr(w),s=s.slice(0,w));var P=s.indexOf("?");if(-1!==P?(this.search=s.substr(P),this.query=s.substr(P+1),e&&(this.query=aV.parse(this.query)),s=s.slice(0,P)):e&&(this.search="",this.query={}),s&&(this.pathname=s),xV[h]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){A=this.pathname||"";var N=this.search||"";this.path=A+N}return this.href=this.format(),this},lV.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&tV(this.query)&&Object.keys(this.query).length&&(o=aV.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||xV[e])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})),e+n+r+(s=s.replace("#","%23"))+i},lV.prototype.resolve=function(t){return this.resolveObject(RV(t,!1,!0)).format()},lV.prototype.resolveObject=function(t){if($j(t)){var e=new lV;e.parse(t,!1,!0),t=e}for(var r=new lV,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var u=s[a];"protocol"!==u&&(r[u]=t[u])}return xV[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!xV[t.protocol]){for(var h=Object.keys(t),c=0;c<h.length;c++){var l=h[c];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||EV[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var f=r.pathname||"",p=r.search||"";r.path=f+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var m=r.pathname&&"/"===r.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),_=v||m||r.host&&t.pathname,y=_,g=r.pathname&&r.pathname.split("/")||[],b=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!xV[r.protocol]);if(b&&(r.hostname="",r.port=null,r.host&&(""===g[0]?g[0]=r.host:g.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),_=_&&(""===d[0]||""===g[0])),v)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,g=d;else if(d.length)g||(g=[]),g.pop(),g=g.concat(d),r.search=t.search,r.query=t.query;else if(!rV(t.search)){if(b)r.hostname=r.host=g.shift(),(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,eV(r.pathname)&&eV(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=g.slice(-1)[0],E=(r.host||t.host||g.length>1)&&("."===T||".."===T)||""===T,x=0,R=g.length;R>=0;R--)"."===(T=g[R])?g.splice(R,1):".."===T?(g.splice(R,1),x++):x&&(g.splice(R,1),x--);if(!_&&!y)for(;x--;x)g.unshift("..");!_||""===g[0]||g[0]&&"/"===g[0].charAt(0)||g.unshift(""),E&&"/"!==g.join("/").substr(-1)&&g.push("");var S,A=""===g[0]||g[0]&&"/"===g[0].charAt(0);b&&(r.hostname=r.host=A?"":g.length?g.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(_=_||r.host&&g.length)&&!A&&g.unshift(""),g.length?r.pathname=g.join("/"):(r.pathname=null,r.path=null),eV(r.pathname)&&eV(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},lV.prototype.parseHost=function(){var t=this.host,e=fV.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var SV={parse:uV,format:cV,resolve:hV};aM.RETINA_PREFIX=/@([0-9\.]+)x/,aM.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var AV,IV=!1;var CV=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[JM.NORMAL_NPM]=JM.NORMAL,t[JM.ADD_NPM]=JM.ADD,t[JM.SCREEN_NPM]=JM.SCREEN,e[JM.NORMAL]=JM.NORMAL_NPM,e[JM.ADD]=JM.ADD_NPM,e[JM.SCREEN]=JM.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function OV(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}function wV(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function PV(t){return!(t&t-1||!t)}function NV(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}var MV=0;function DV(){return++MV}var LV={};function UV(t,e,r){if(void 0===r&&(r=3),!LV[e]){var i=(new Error).stack;void 0===i?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(i=i.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(i))),LV[e]=!0}}var FV,GV={},BV=Object.create(null),kV=Object.create(null);function XV(t,e){if(void 0===e&&(e=globalThis.location),0===t.indexOf("data:"))return"";e=e||globalThis.location,FV||(FV=document.createElement("a")),FV.href=t;var r=SV.parse(FV.href),i=!r.port&&""===e.port||r.port===e.port;return r.hostname===e.hostname&&i&&r.protocol===e.protocol?"":"anonymous"}function HV(t,e){var r=aM.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1}!function(){function t(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||aM.RESOLUTION,this.resize(t,e)}t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0})}();var jV,VV=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,r,i,n,o,s,a){if(arguments.length>8)throw new Error("max arguments reached");var u=this,h=u.name,c=u.items;this._aliasCount++;for(var l=0,d=c.length;l<d;l++)c[l][h](t,e,r,i,n,o,s,a);return c===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(VV.prototype,{dispatch:{value:VV.prototype.emit},run:{value:VV.prototype.emit}}),aM.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(jV||(jV={}));var YV,WV=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),zV=function(){function t(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new WV(null,null,1/0),this.deltaMS=1/aM.TARGET_FPMS,this.elapsedMS=1/aM.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,r){return void 0===r&&(r=jV.NORMAL),this._addListener(new WV(t,e,r))},t.prototype.addOnce=function(t,e,r){return void 0===r&&(r=jV.NORMAL),this._addListener(new WV(t,e,r,!0))},t.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r<this._minElapsedMS)return;this._lastFrame=t-r%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*aM.TARGET_FPMS;for(var i=this._head,n=i.next;n;)n=n.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,aM.TARGET_FPMS);this._maxElapsedMS=1/r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared},enumerable:!1,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system},enumerable:!1,configurable:!0}),t}(),ZV=2*Math.PI;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(YV||(YV={}));var KV=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},t}(),qV=[new KV,new KV,new KV,new KV],JV=function(){function t(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=YV.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},t.prototype.intersects=function(t,e){if(!e){var r=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=r)return!1;var i=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>i}var n=this.left,o=this.right,s=this.top,a=this.bottom;if(o<=n||a<=s)return!1;var u=qV[0].set(t.left,t.top),h=qV[1].set(t.left,t.bottom),c=qV[2].set(t.right,t.top),l=qV[3].set(t.right,t.bottom);if(c.x<=u.x||h.y<=u.y)return!1;var d=Math.sign(e.a*e.d-e.b*e.c);if(0===d)return!1;if(e.apply(u,u),e.apply(h,h),e.apply(c,c),e.apply(l,l),Math.max(u.x,h.x,c.x,l.x)<=n||Math.min(u.x,h.x,c.x,l.x)>=o||Math.max(u.y,h.y,c.y,l.y)<=s||Math.min(u.y,h.y,c.y,l.y)>=a)return!1;var f=d*(h.y-u.y),p=d*(u.x-h.x),m=f*n+p*s,v=f*o+p*s,_=f*n+p*a,y=f*o+p*a;if(Math.max(m,v,_,y)<=f*u.x+p*u.y||Math.min(m,v,_,y)>=f*l.x+p*l.y)return!1;var g=d*(u.y-c.y),b=d*(c.x-u.x),T=g*n+b*s,E=g*o+b*s,x=g*n+b*a,R=g*o+b*a;return!(Math.max(T,E,x,R)<=g*u.x+b*u.y||Math.min(T,E,x,R)>=g*l.x+b*l.y)},t.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(n-i,0),this},t.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=n-i,this},t.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},t}(),QV=function(){function t(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),this._x=r,this._y=i,this.cb=t,this.scope=e}return t.prototype.clone=function(e,r){return void 0===e&&(e=this.cb),void 0===r&&(r=this.scope),new t(e,r,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},t.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),$V=function(){function t(t,e,r,i,n,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},t.prototype.apply=function(t,e){e=e||new KV;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new KV;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,n=t.y;return e.x=this.d*r*i+-this.c*r*n+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*n+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},t.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},t.prototype.setTransform=function(t,e,r,i,n,o,s,a,u){return this.a=Math.cos(s+u)*n,this.b=Math.sin(s+u)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=t.pivot,s=-Math.atan2(-i,n),a=Math.atan2(r,e),u=Math.abs(s+a);return u<1e-5||Math.abs(ZV-u)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*r+o.y*n),t},t.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},t.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),tY=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],eY=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],rY=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],iY=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],nY=[],oY=[],sY=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];nY.push(e);for(var r=0;r<16;r++)for(var i=sY(tY[t]*tY[r]+rY[t]*eY[r]),n=sY(eY[t]*tY[r]+iY[t]*eY[r]),o=sY(tY[t]*rY[r]+rY[t]*iY[r]),s=sY(eY[t]*rY[r]+iY[t]*iY[r]),a=0;a<16;a++)if(tY[a]===i&&eY[a]===n&&rY[a]===o&&iY[a]===s){e.push(a);break}}for(t=0;t<16;t++){var u=new $V;u.set(tY[t],eY[t],rY[t],iY[t],0,0),oY.push(u)}}();var aY={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return tY[t]},uY:function(t){return eY[t]},vX:function(t){return rY[t]},vY:function(t){return iY[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return nY[t][e]},sub:function(t,e){return nY[t][aY.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?aY.S:aY.N:2*Math.abs(e)<=Math.abs(t)?t>0?aY.E:aY.W:e>0?t>0?aY.SE:aY.SW:t>0?aY.NE:aY.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=oY[aY.inv(e)];n.tx=r,n.ty=i,t.append(n)}};!function(){function t(){this.worldTransform=new $V,this.localTransform=new $V,this.position=new QV(this.onChange,this,0,0),this.scale=new QV(this.onChange,this,1,1),this.pivot=new QV(this.onChange,this,0,0),this.skew=new QV(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t}(),aM.PREFER_ENV=sM.any?ZM.WEBGL:ZM.WEBGL2,aM.STRICT_TEXTURE_CACHE=!1;var uY=[];function hY(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=uY.length-1;n>=0;--n){var o=uY[n];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var cY=function(t,e){return cY=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},cY(t,e)};function lY(t,e){function r(){this.constructor=t}cY(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var dY=function(){return dY=Object.assign||function(t){for(var e,r=arguments,i=1,n=arguments.length;i<n;i++)for(var o in e=r[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},dY.apply(this,arguments)};var fY=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new VV("setRealSize"),this.onUpdate=new VV("update"),this.onError=new VV("onError")}return t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(t,e,r){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},t.test=function(t,e){return!1},t}(),pY=function(t){function e(e,r){var i=this,n=r||{},o=n.width,s=n.height;if(!o||!s)throw new Error("BufferResource width or height invalid");return(i=t.call(this,o,s)||this).data=e,i}return lY(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===sD.UNPACK);var n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?i.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,i.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(fY),mY={scaleMode:iD.NEAREST,format:$M.RGBA,alphaMode:sD.NPM},vY=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null);var i=t.call(this)||this,n=(r=r||{}).alphaMode,o=r.mipmap,s=r.anisotropicLevel,a=r.scaleMode,u=r.width,h=r.height,c=r.wrapMode,l=r.format,d=r.type,f=r.target,p=r.resolution,m=r.resourceOptions;return!e||e instanceof fY||((e=hY(e,m)).internal=!0),i.resolution=p||aM.RESOLUTION,i.width=Math.round((u||0)*i.resolution)/i.resolution,i.height=Math.round((h||0)*i.resolution)/i.resolution,i._mipmap=void 0!==o?o:aM.MIPMAP_TEXTURES,i.anisotropicLevel=void 0!==s?s:aM.ANISOTROPIC_LEVEL,i._wrapMode=c||aM.WRAP_MODE,i._scaleMode=void 0!==a?a:aM.SCALE_MODE,i.format=l||$M.RGBA,i.type=d||eD.UNSIGNED_BYTE,i.target=f||tD.TEXTURE_2D,i.alphaMode=void 0!==n?n:sD.UNPACK,i.uid=DV(),i.touched=0,i.isPowerOfTwo=!1,i._refreshPOT(),i._glTextures={},i.dirtyId=0,i.dirtyStyleId=0,i.cacheId=null,i.valid=u>0&&h>0,i.textureCacheIds=[],i.destroyed=!1,i.resource=null,i._batchEnabled=0,i._batchLocation=0,i.parentTextureArray=null,i.setResource(e),i}return lY(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=PV(this.realWidth)&&PV(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete kV[this.cacheId],delete BV[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,r,i){void 0===i&&(i=aM.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;if(n)o=t;else{if(!t._pixiId){var s=r&&r.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+DV()}o=t._pixiId}var a=kV[o];if(n&&i&&!a)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return a||((a=new e(t,r)).cacheId=o,e.addToCache(a,o)),a},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new pY(t,{width:r,height:i}),s=t instanceof Float32Array?eD.FLOAT:eD.UNSIGNED_BYTE;return new e(o,Object.assign(mY,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),kV[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),kV[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=kV[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete kV[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)delete kV[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(Jj),_Y=function(t){function e(e,r){var i=this,n=r||{},o=n.width,s=n.height;(i=t.call(this,o,s)||this).items=[],i.itemDirtyIds=[];for(var a=0;a<e;a++){var u=new vY;i.items.push(u),i.itemDirtyIds.push(-2)}return i.length=e,i._load=null,i.baseTexture=null,i}return lY(e,t),e.prototype.initFromArray=function(t,e){for(var r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof fY?this.addResourceAt(t[r],r):this.addResourceAt(hY(t[r],e),r))},e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map((function(t){return t.resource})).filter((function(t){return t})).map((function(t){return t.load()}));return this._load=Promise.all(e).then((function(){var e=t.items[0],r=e.realWidth,i=e.realHeight;return t.resize(r,i),Promise.resolve(t)})),this._load},e}(fY),yY=function(t){function e(e,r){var i,n,o=this,s=r||{},a=s.width,u=s.height;return Array.isArray(e)?(i=e,n=e.length):n=e,o=t.call(this,n,{width:a,height:u})||this,i&&o.initFromArray(i,r),o}return lY(e,t),e.prototype.addBaseTextureAt=function(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=tD.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,e,r){var i=this,n=i.length,o=i.itemDirtyIds,s=i.items,a=t.gl;r.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,n,0,e.format,r.type,null);for(var u=0;u<n;u++){var h=s[u];o[u]<h.dirtyId&&(o[u]=h.dirtyId,h.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,u,h.resource.width,h.resource.height,1,e.format,r.type,h.resource.source))}return!0},e}(_Y),gY=function(t){function e(e){var r=this,i=e,n=i.naturalWidth||i.videoWidth||i.width,o=i.naturalHeight||i.videoHeight||i.height;return(r=t.call(this,n,o)||this).source=e,r.noSubImage=!1,r}return lY(e,t),e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=XV(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;if((i=i||this.source)instanceof HTMLImageElement){if(!i.complete||0===i.naturalWidth)return!1}else if(i instanceof HTMLVideoElement&&i.readyState<=1)return!1;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===sD.UNPACK),this.noSubImage||e.target!==n.TEXTURE_2D||r.width!==o||r.height!==s?(r.width=o,r.height=s,n.texImage2D(e.target,0,r.internalFormat,e.format,r.type,i)):n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,r.type,i),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source,r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(r,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(fY),bY=function(t){function e(e){return t.call(this,e)||this}return lY(e,t),e.test=function(t){var e=globalThis.OffscreenCanvas;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(gY),TY=function(t){function e(r,i){var n=this,o=i||{},s=o.width,a=o.height,u=o.autoLoad,h=o.linkBaseTexture;if(r&&r.length!==e.SIDES)throw new Error("Invalid length. Got "+r.length+", expected 6");n=t.call(this,6,{width:s,height:a})||this;for(var c=0;c<e.SIDES;c++)n.items[c].target=tD.TEXTURE_CUBE_MAP_POSITIVE_X+c;return n.linkBaseTexture=!1!==h,r&&n.initFromArray(r,i),!1!==u&&n.load(),n}return lY(e,t),e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=tD.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,e,r){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=tD.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},e.prototype.upload=function(t,r,i){for(var n=this.itemDirtyIds,o=0;o<e.SIDES;o++){var s=this.items[o];n[o]<s.dirtyId&&(s.valid&&s.resource?(s.resource.upload(t,s,i),n[o]=s.dirtyId):n[o]<-1&&(t.gl.texImage2D(s.target,0,i.internalFormat,r.realWidth,r.realHeight,0,r.format,i.type,null),n[o]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(_Y),EY=function(t){function e(e,r){var i=this;if(r=r||{},!(e instanceof HTMLImageElement)){var n=new Image;gY.crossOrigin(n,e,r.crossorigin),n.src=e,e=n}return i=t.call(this,e)||this,!e.complete&&i._width&&i._height&&(i._width=0,i._height=0),i.url=e.src,i._process=null,i.preserveBitmap=!1,i.createBitmap=(void 0!==r.createBitmap?r.createBitmap:aM.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,i.alphaMode="number"==typeof r.alphaMode?r.alphaMode:null,i.bitmap=null,i._load=null,!1!==r.autoLoad&&i.load(),i}return lY(e,t),e.prototype.load=function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((function(t,r){var i=e.source;e.url=i.src;var n=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?n():(i.onload=n,i.onerror=function(t){r(t),e.onError.emit(t)})}))),this._load},e.prototype.process=function(){var t=this,e=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);var r=globalThis.createImageBitmap,i=!e.crossOrigin||"anonymous"===e.crossOrigin;return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then((function(t){return t.blob()})).then((function(i){return r(i,0,0,e.width,e.height,{premultiplyAlpha:t.alphaMode===sD.UNPACK?"premultiply":"none"})})).then((function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))})),this._process},e.prototype.upload=function(e,r,i){if("number"==typeof this.alphaMode&&(r.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0,o=r._glTextures;for(var s in o){var a=o[s];if(a!==i&&a.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return"string"==typeof t||t instanceof HTMLImageElement},e}(gY),xY=function(t){function e(e,r){var i=this;return r=r||{},(i=t.call(this,document.createElement("canvas"))||this)._width=0,i._height=0,i.svg=e,i.scale=r.scale||1,i._overrideWidth=r.width,i._overrideHeight=r.height,i._resolve=null,i._crossorigin=r.crossorigin,i._load=null,!1!==r.autoLoad&&i.load(),i}return lY(e,t),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise((function(r){if(t._resolve=function(){t.resize(t.source.width,t.source.height),r(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}))),this._load},e.prototype._loadSvg=function(){var t=this,e=new Image;gY.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=function(r){t._resolve&&(e.onerror=null,t.onError.emit(r))},e.onload=function(){if(t._resolve){var r=e.width,i=e.height;if(!r||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var n=r*t.scale,o=i*t.scale;(t._overrideWidth||t._overrideHeight)&&(n=t._overrideWidth||t._overrideHeight/i*r,o=t._overrideHeight||t._overrideWidth/r*i),n=Math.round(n),o=Math.round(o);var s=t.source;s.width=n,s.height=o,s._pixiId="canvas_"+DV(),s.getContext("2d").drawImage(e,0,0,r,i,0,0,n,o),t._resolve(),t._resolve=null}}},e.getSize=function(t){var r=e.SVG_SIZE.exec(t),i={};return r&&(i[r[1]]=Math.round(parseFloat(r[3])),i[r[5]]=Math.round(parseFloat(r[7]))),i},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,r){return"svg"===r||"string"==typeof t&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(t)||"string"==typeof t&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(gY),RY=function(t){function e(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var s=r[0].src||r[0];gY.crossOrigin(o,s,i.crossorigin);for(var a=0;a<r.length;++a){var u=document.createElement("source"),h=r[a],c=h.src,l=h.mime,d=(c=c||r[a]).split("?").shift().toLowerCase(),f=d.slice(d.lastIndexOf(".")+1);l=l||e.MIME_TYPES[f]||"video/"+f,u.src=c,u.type=l,o.appendChild(u)}r=o}return(n=t.call(this,r)||this).noSubImage=!0,n._autoUpdate=!0,n._isConnectedToTicker=!1,n._updateFPS=i.updateFPS||0,n._msToNextUpdate=0,n.autoPlay=!1!==i.autoPlay,n._load=null,n._resolve=null,n._onCanPlay=n._onCanPlay.bind(n),n._onError=n._onError.bind(n),!1!==i.autoLoad&&n.load(),n}return lY(e,t),e.prototype.update=function(e){if(!this.destroyed){var r=zV.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-r),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((function(r){t.valid?r(t):(t._resolve=r,e.load())})),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(zV.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(zV.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(zV.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(zV.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(zV.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,r){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(gY),SY=function(t){function e(e){return t.call(this,e)||this}return lY(e,t),e.test=function(t){return!!globalThis.createImageBitmap&&t instanceof ImageBitmap},e}(gY);uY.push(EY,SY,bY,RY,xY,pY,TY,yY);var AY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lY(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===sD.UNPACK);var n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?i.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,i.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0},e}(pY),IY=function(){function t(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new VV("disposeFramebuffer"),this.multisample=lD.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new vY(null,{scaleMode:iD.NEAREST,resolution:1,mipmap:oD.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new vY(new AY(null,{width:this.width,height:this.height}),{scaleMode:iD.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:oD.OFF,format:$M.DEPTH_COMPONENT,type:eD.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r<this.colorTextures.length;r++){var i=this.colorTextures[r],n=i.resolution;i.setSize(t/n,e/n)}if(this.depthTexture){n=this.depthTexture.resolution;this.depthTexture.setSize(t/n,e/n)}}},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},t}(),CY=function(t){function e(e){void 0===e&&(e={});var r=this;if("number"==typeof e){var i=arguments[0],n=arguments[1],o=arguments[2],s=arguments[3];e={width:i,height:n,scaleMode:o,resolution:s}}return e.width=e.width||100,e.height=e.height||100,e.multisample=void 0!==e.multisample?e.multisample:lD.NONE,(r=t.call(this,null,e)||this).mipmap=oD.OFF,r.valid=!0,r.clearColor=[0,0,0,0],r.framebuffer=new IY(r.realWidth,r.realHeight).addColorTexture(0,r),r.framebuffer.multisample=e.multisample,r.maskStack=[],r.filterStack=[{}],r}return lY(e,t),e.prototype.resize=function(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(vY),OY=function(){function t(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return t.prototype.set=function(t,e,r){var i=e.width,n=e.height;if(r){var o=t.width/2/i,s=t.height/2/n,a=t.x/i+o,u=t.y/n+s;r=aY.add(r,aY.NW),this.x0=a+o*aY.uX(r),this.y0=u+s*aY.uY(r),r=aY.add(r,2),this.x1=a+o*aY.uX(r),this.y1=u+s*aY.uY(r),r=aY.add(r,2),this.x2=a+o*aY.uX(r),this.y2=u+s*aY.uY(r),r=aY.add(r,2),this.x3=a+o*aY.uX(r),this.y3=u+s*aY.uY(r)}else this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},t.prototype.toString=function(){return"[@pixi/core:TextureUvs x0="+this.x0+" y0="+this.y0+" x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+" x3="+this.x3+" y3="+this.y3+"]"},t}(),wY=new OY;function PY(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}var NY=function(t){function e(r,i,n,o,s,a){var u=t.call(this)||this;if(u.noFrame=!1,i||(u.noFrame=!0,i=new JV(0,0,1,1)),r instanceof e&&(r=r.baseTexture),u.baseTexture=r,u._frame=i,u.trim=o,u.valid=!1,u._uvs=wY,u.uvMatrix=null,u.orig=n||i,u._rotate=Number(s||0),!0===s)u._rotate=2;else if(u._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return u.defaultAnchor=a?new KV(a.x,a.y):new KV(0,0),u._updateID=0,u.textureCacheIds=[],r.valid?u.noFrame?r.valid&&u.onBaseTextureUpdated(r):u.frame=i:r.once("loaded",u.onBaseTextureUpdated,u),u.noFrame&&r.on("update",u.onBaseTextureUpdated,u),u}return lY(e,t),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var r=this.baseTexture.resource;r&&r.url&&BV[r.url]&&e.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),r=this._frame===this.orig?t:this.orig.clone(),i=new e(this.baseTexture,!this.noFrame&&t,r,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(i._frame=t),i},e.prototype.updateUvs=function(){this._uvs===wY&&(this._uvs=new OY),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,r,i){void 0===r&&(r={}),void 0===i&&(i=aM.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;if(n)o=t;else if(t instanceof vY){if(!t.cacheId){var s=r&&r.pixiIdPrefix||"pixiid";t.cacheId=s+"-"+DV(),vY.addToCache(t,t.cacheId)}o=t.cacheId}else{if(!t._pixiId){s=r&&r.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+DV()}o=t._pixiId}var a=BV[o];if(n&&i&&!a)throw new Error('The cacheId "'+o+'" does not exist in TextureCache.');return a||t instanceof vY?!a&&t instanceof vY&&(a=new e(t),e.addToCache(a,o)):(r.resolution||(r.resolution=HV(t)),(a=new e(new vY(t,r))).baseTexture.cacheId=o,vY.addToCache(a.baseTexture,o),e.addToCache(a,o)),a},e.fromURL=function(t,r){var i=Object.assign({autoLoad:!1},null==r?void 0:r.resourceOptions),n=e.from(t,Object.assign({resourceOptions:i},r),!1),o=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):o.load().then((function(){return Promise.resolve(n)}))},e.fromBuffer=function(t,r,i,n){return new e(vY.fromBuffer(t,r,i,n))},e.fromLoader=function(t,r,i,n){var o=new vY(t,Object.assign({scaleMode:aM.SCALE_MODE,resolution:HV(r)},n)),s=o.resource;s instanceof EY&&(s.url=r);var a=new e(o);return i||(i=r),vY.addToCache(a.baseTexture,i),e.addToCache(a,i),i!==r&&(vY.addToCache(a.baseTexture,r),e.addToCache(a,r)),a.baseTexture.valid?Promise.resolve(a):new Promise((function(t){a.baseTexture.once("loaded",(function(){return t(a)}))}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),BV[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),BV[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=BV[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete BV[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)BV[t.textureCacheIds[i]]===t&&delete BV[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,r=t.y,i=t.width,n=t.height,o=e+i>this.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",u="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,h="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+a+" "+h)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new vY),PY(e._EMPTY),PY(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=document.createElement("canvas"),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),e._WHITE=new e(new vY(new bY(t))),PY(e._WHITE),PY(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(Jj),MY=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return lY(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,r){void 0===r&&(r=!0);var i=this.baseTexture.resolution,n=Math.round(t*i)/i,o=Math.round(e*i)/i;this.valid=n>0&&o>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(n,o),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var r=arguments,i=[],n=1;n<arguments.length;n++)i[n-1]=r[n];return"number"==typeof t&&(UV("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:i[0],scaleMode:i[1],resolution:i[2]}),new e(new CY(t))},e}(NY),DY=function(){function t(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(t,e,r){void 0===r&&(r=lD.NONE);var i=new CY(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new MY(i)},t.prototype.getOptimalTexture=function(t,e,r,i){var n;void 0===r&&(r=1),void 0===i&&(i=lD.NONE),t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?n=i>1?-i:-1:(n=((65535&(t=wV(t)))<<16|65535&(e=wV(e)))>>>0,i>1&&(n+=4294967296*i)),this.texturePool[n]||(this.texturePool[n]=[]);var o=this.texturePool[n].pop();return o||(o=this.createTexture(t,e,i)),o.filterPoolKey=n,o.setResolution(r),o},t.prototype.getFilterTexture=function(t,e,r){var i=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||lD.NONE);return i.filterFrame=t.filterFrame,i},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i<r.length;i++)r[i].destroy(!0)}this.texturePool={}},t.prototype.setScreenSize=function(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){for(var e in this.enableFullScreen=t.width>0&&t.height>0,this.texturePool)if(Number(e)<0){var r=this.texturePool[e];if(r)for(var i=0;i<r.length;i++)r[i].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}},t.SCREEN_KEY=-1,t}(),LY=function(){function t(t,e,r,i,n,o,s){void 0===e&&(e=0),void 0===r&&(r=!1),void 0===i&&(i=eD.FLOAT),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s}return t.prototype.destroy=function(){this.buffer=null},t.from=function(e,r,i,n,o){return new t(e,r,i,n,o)},t}(),UY=0,FY=function(){function t(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=UY++,this.disposeRunner=new VV("disposeBuffer")}return t.prototype.update=function(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(t.prototype,"index",{get:function(){return this.type===dD.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?dD.ELEMENT_ARRAY_BUFFER:dD.ARRAY_BUFFER},enumerable:!1,configurable:!0}),t.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new t(e)},t}(),GY={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var BY={5126:4,5123:2,5121:1},kY=0,XY={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},HY=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=kY++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new VV("disposeGeometry"),this.refCount=0}return t.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===r&&(r=0),void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof FY||(e instanceof Array&&(e=new Float32Array(e)),e=new FY(e));var u=t.split("|");if(u.length>1){for(var h=0;h<u.length;h++)this.addAttribute(u[h],e,r,i,n);return this}var c=this.buffers.indexOf(e);return-1===c&&(this.buffers.push(e),c=this.buffers.length-1),this.attributes[t]=new LY(c,r,i,n,o,s,a),this.instanced=this.instanced||a,this},t.prototype.getAttribute=function(t){return this.attributes[t]},t.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},t.prototype.addIndex=function(t){return t instanceof FY||(t instanceof Array&&(t=new Uint16Array(t)),t=new FY(t)),t.type=dD.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},t.prototype.getIndex=function(){return this.indexBuffer},t.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],r=[],i=new FY;for(t in this.attributes){var n=this.attributes[t],o=this.buffers[n.buffer];e.push(o.data),r.push(n.size*BY[n.type]/4),n.buffer=0}for(i.data=function(t,e){for(var r=0,i=0,n={},o=0;o<t.length;o++)i+=e[o],r+=t[o].length;var s=new ArrayBuffer(4*r),a=null,u=0;for(o=0;o<t.length;o++){var h=e[o],c=t[o],l=OV(c);n[l]||(n[l]=new GY[l](s)),a=n[l];for(var d=0;d<c.length;d++)a[(d/h|0)*i+u+d%h]=c[d];u+=h}return new Float32Array(s)}(e,r),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},t.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},t.prototype.clone=function(){for(var e=new t,r=0;r<this.buffers.length;r++)e.buffers[r]=new FY(this.buffers[r].data.slice(0));for(var r in this.attributes){var i=this.attributes[r];e.attributes[r]=new LY(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=dD.ELEMENT_ARRAY_BUFFER),e},t.merge=function(e){for(var r,i=new t,n=[],o=[],s=[],a=0;a<e.length;a++){r=e[a];for(var u=0;u<r.buffers.length;u++)o[u]=o[u]||0,o[u]+=r.buffers[u].data.length,s[u]=0}for(a=0;a<r.buffers.length;a++)n[a]=new(XY[OV(r.buffers[a].data)])(o[a]),i.buffers[a]=new FY(n[a]);for(a=0;a<e.length;a++){r=e[a];for(u=0;u<r.buffers.length;u++)n[u].set(r.buffers[u].data,s[u]),s[u]+=r.buffers[u].data.length}if(i.attributes=r.attributes,r.indexBuffer){i.indexBuffer=i.buffers[r.buffers.indexOf(r.indexBuffer)],i.indexBuffer.type=dD.ELEMENT_ARRAY_BUFFER;var h=0,c=0,l=0,d=0;for(a=0;a<r.buffers.length;a++)if(r.buffers[a]!==r.indexBuffer){d=a;break}for(var a in r.attributes){var f=r.attributes[a];(0|f.buffer)===d&&(c+=f.size*BY[f.type]/4)}for(a=0;a<e.length;a++){var p=e[a].indexBuffer.data;for(u=0;u<p.length;u++)i.indexBuffer.data[u+l]+=h;h+=e[a].buffers[d].data.length/c,l+=p.length}}return i},t}(),jY=function(t){function e(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return lY(e,t),e}(HY),VY=function(t){function e(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new FY(e.vertices),e.uvBuffer=new FY(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return lY(e,t),e.prototype.map=function(t,e){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(HY),YY=0,WY=function(){function t(t,e,r){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=YY++,this.static=!!e,this.ubo=!!r,t instanceof FY?(this.buffer=t,this.buffer.type=dD.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new FY(new Float32Array(1)),this.buffer.type=dD.UNIFORM_BUFFER,this.autoManage=!0))}return t.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},t.prototype.add=function(e,r,i){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[e]=new t(r,i)},t.from=function(e,r,i){return new t(e,r,i)},t.uboFrom=function(e,r){return new t(e,null==r||r,!0)},t}(),zY=function(){function t(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=lD.NONE,this.sourceFrame=new JV,this.destinationFrame=new JV,this.bindingSourceFrame=new JV,this.bindingDestinationFrame=new JV,this.filters=[],this.transform=null}return t.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},t}(),ZY=[new KV,new KV,new KV,new KV],KY=new $V,qY=function(){function t(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new DY,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new jY,this.quadUv=new VY,this.tempRect=new JV,this.activeState={},this.globalUniforms=new WY({outputFrame:new JV,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return t.prototype.push=function(t,e){for(var r,i,n=this.renderer,o=this.defaultFilterStack,s=this.statePool.pop()||new zY,a=this.renderer.renderTexture,u=e[0].resolution,h=e[0].multisample,c=e[0].padding,l=e[0].autoFit,d=null===(r=e[0].legacy)||void 0===r||r,f=1;f<e.length;f++){var p=e[f];u=Math.min(u,p.resolution),h=Math.min(h,p.multisample),c=this.useMaxPadding?Math.max(c,p.padding):c+p.padding,l=l&&p.autoFit,d=d||null===(i=p.legacy)||void 0===i||i}1===o.length&&(this.defaultFilterStack[0].renderTexture=a.current),o.push(s),s.resolution=u,s.multisample=h,s.legacy=d,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(c);var m=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB(KY.copyFrom(n.projection.transform).invert(),m),l?(s.sourceFrame.fit(m),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(m)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,u,h),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;var v=this.tempRect;v.x=0,v.y=0,v.width=s.sourceFrame.width,v.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=n.projection.transform,n.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,v),n.framebuffer.clear(0,0,0,0)},t.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;var i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;var n=i.inputSize,o=i.inputPixel,s=i.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],o[0]=Math.round(n[0]*e.resolution),o[1]=Math.round(n[1]*e.resolution),o[2]=1/o[0],o[3]=1/o[1],s[0]=.5*o[2],s[1]=.5*o[3],s[2]=e.sourceFrame.width*n[2]-.5*o[2],s[3]=e.sourceFrame.height*n[3]-.5*o[3],e.legacy){var a=i.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();var u=t[t.length-1];if(this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,u.renderTexture,aD.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var h=e.renderTexture,c=this.getOptimalFilterTexture(h.width,h.height,e.resolution);c.filterFrame=h.filterFrame;var l=0;for(l=0;l<r.length-1;++l){1===l&&e.multisample>1&&((c=this.getOptimalFilterTexture(h.width,h.height,e.resolution)).filterFrame=h.filterFrame),r[l].apply(this,h,c,aD.CLEAR,e);var d=h;h=c,c=d}r[l].apply(this,h,u.renderTexture,aD.BLEND,e),l>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)},t.prototype.bindAndClear=function(t,e){void 0===e&&(e=aD.CLEAR);var r=this.renderer,i=r.renderTexture,n=r.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,i.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&n.stateId||this.forceClear;(e===aD.CLEAR||e===aD.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},t.prototype.applyFilter=function(t,e,r,i){var n=this.renderer;n.state.set(t.state),this.bindAndClear(r,i),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(QM.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(QM.TRIANGLE_STRIP))},t.prototype.calculateSpriteMatrix=function(t,e){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=e._texture.orig,s=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo($V.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},t.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},t.prototype.getOptimalFilterTexture=function(t,e,r,i){return void 0===r&&(r=1),void 0===i&&(i=lD.NONE),this.texturePool.getOptimalTexture(t,e,r,i)},t.prototype.getFilterTexture=function(t,e,r){if("number"==typeof t){var i=t;t=e,e=i}t=t||this.activeState.renderTexture;var n=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||lD.NONE);return n.filterFrame=t.filterFrame,n},t.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},t.prototype.emptyPool=function(){this.texturePool.clear(!0)},t.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},t.prototype.transformAABB=function(t,e){var r=ZY[0],i=ZY[1],n=ZY[2],o=ZY[3];r.set(e.left,e.top),i.set(e.left,e.bottom),n.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(n,n),t.apply(o,o);var s=Math.min(r.x,i.x,n.x,o.x),a=Math.min(r.y,i.y,n.y,o.y),u=Math.max(r.x,i.x,n.x,o.x),h=Math.max(r.y,i.y,n.y,o.y);e.x=s,e.y=a,e.width=u-s,e.height=h-a},t.prototype.roundFrame=function(t,e,r,i,n){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(n){var o=n.a,s=n.b,a=n.c,u=n.d;if((Math.abs(s)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(n=n?KY.copyFrom(n):KY.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}},t}(),JY=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),QY=function(){function t(t){this.renderer=t,this.emptyRenderer=new JY(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var r=this.renderer.texture.boundTextures,i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},t.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,u=0;u<s;u++){var h=n[u],c=h._batchLocation;if(c>=0&&c<i&&e[c]===h)o[u]=c;else for(;a<i;){var l=e[a];if(!l||l._batchEnabled!==r||l._batchLocation!==a){o[u]=a,h._batchLocation=a,e[a]=h;break}a++}}},t.prototype.destroy=function(){this.renderer=null},t}(),$Y=0,tW=function(){function t(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(t.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),t.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=$Y++,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},t.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=$Y++,this.renderer.runners.contextChange.emit(t)},t.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},t.prototype.createContext=function(t,e){var r;if(aM.PREFER_ENV>=ZM.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},t.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},t.prototype.handleContextLost=function(t){t.preventDefault()},t.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},t.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},t.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},t.prototype.validateContext=function(t){var e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},t}(),eW=function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=lD.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},rW=new JV,iW=function(){function t(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new IY(10,10),this.msaaSamples=null}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new JV,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;aM.PREFER_ENV===ZM.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},t.prototype.bind=function(t,e,r){void 0===r&&(r=0);var i=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=r),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o<t.colorTextures.length;o++){var s=t.colorTextures[o];this.renderer.texture.unbind(s.parentTextureArray||s)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){var a=e.width>>r,u=e.height>>r,h=a/e.width;this.setViewport(e.x*h,e.y*h,a,u)}else{a=t.width>>r,u=t.height>>r;this.setViewport(0,0,a,u)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},t.prototype.setViewport=function(t,e,r,i){var n=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),n.width===r&&n.height===i&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=r,n.height=i,this.gl.viewport(t,e,r,i))},Object.defineProperty(t.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),t.prototype.clear=function(t,e,r,i,n){void 0===n&&(n=qM.COLOR|qM.DEPTH);var o=this.gl;o.clearColor(t,e,r,i),o.clear(n)},t.prototype.initFramebuffer=function(t){var e=this.gl,r=new eW(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r},t.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height)),r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var i=t.colorTextures,n=i.length;e.drawBuffers||(n=Math.min(n,1));for(var o=0;o<n;o++){var s=i[o],a=s.parentTextureArray||s;this.renderer.texture.bind(a,0)}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)},t.prototype.updateFramebuffer=function(t,e){var r=this.gl,i=t.glFramebuffers[this.CONTEXT_UID],n=t.colorTextures,o=n.length;r.drawBuffers||(o=Math.min(o,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?(i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.RGBA8,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));for(var s=[],a=0;a<o;a++){var u=n[a],h=u.parentTextureArray||u;this.renderer.texture.bind(h,0),0===a&&i.msaaBuffer||(r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+a,u.target,h._glTextures[this.CONTEXT_UID].texture,e),s.push(r.COLOR_ATTACHMENT0+a))}if((s.length>1&&r.drawBuffers(s),t.depthTexture)&&this.writeDepthTexture){var c=t.depthTexture;this.renderer.texture.bind(c,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null):(i.stencil=i.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,i.stencil))},t.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},t.prototype.detectSamples=function(t){var e=this.msaaSamples,r=lD.NONE;if(t<=1||null===e)return r;for(var i=0;i<e.length;i++)if(e[i]<=t){r=e[i];break}return 1===r&&(r=lD.NONE),r},t.prototype.blit=function(t,e,r){var i=this,n=i.current,o=i.renderer,s=i.gl,a=i.CONTEXT_UID;if(2===o.context.webGLVersion&&n){var u=n.glFramebuffers[a];if(u){if(!t){if(!u.msaaBuffer)return;var h=n.colorTextures[0];if(!h)return;u.blitFramebuffer||(u.blitFramebuffer=new IY(n.width,n.height),u.blitFramebuffer.addColorTexture(0,h)),(t=u.blitFramebuffer).colorTextures[0]!==h&&(t.colorTextures[0]=h,t.dirtyId++,t.dirtyFormat++),t.width===n.width&&t.height===n.height||(t.width=n.width,t.height=n.height,t.dirtyId++,t.dirtySize++)}e||((e=rW).width=n.width,e.height=n.height),r||(r=e);var c=e.width===r.width&&e.height===r.height;this.bind(t),s.bindFramebuffer(s.READ_FRAMEBUFFER,u.framebuffer),s.blitFramebuffer(e.left,e.top,e.right,e.bottom,r.left,r.top,r.right,r.bottom,s.COLOR_BUFFER_BIT,c?s.NEAREST:s.LINEAR)}}},t.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},t.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r<e.length;r++)this.disposeFramebuffer(e[r],t)},t.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.stencil=!0;var r=t.width,i=t.height,n=this.gl,o=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,o),e.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,e.multisample,n.DEPTH24_STENCIL8,r,i):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,r,i),e.stencil=o,n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,o)}}},t.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new JV},t.prototype.destroy=function(){this.renderer=null},t}(),nW={5126:4,5123:2,5121:1},oW=function(){function t(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return t.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){var r=this.renderer.context.extensions.vertexArrayObject;aM.PREFER_ENV===ZM.WEBGL_LEGACY&&(r=null),r?(t.createVertexArray=function(){return r.createVertexArrayOES()},t.bindVertexArray=function(t){return r.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return r.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(2!==e.webGLVersion){var i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=function(t,e){return i.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,r,n,o){return i.drawElementsInstancedANGLE(t,e,r,n,o)},t.drawArraysInstanced=function(t,e,r,n){return i.drawArraysInstancedANGLE(t,e,r,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},t.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var r=this.gl,i=t.glVertexArrayObjects[this.CONTEXT_UID],n=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},n=!0);var o=i[e.program.id]||this.initGeometryVao(t,e,n);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?r.bindVertexArray(o):this.activateVao(t,e.program)),this.updateBuffers()},t.prototype.reset=function(){this.unbind()},t.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.renderer.buffer,r=0;r<t.buffers.length;r++){var i=t.buffers[r];e.update(i)}},t.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},t.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o,i[o].location);return n.join("-")},t.prototype.initGeometryVao=function(t,e,r){void 0===r&&(r=!0);var i=this.gl,n=this.CONTEXT_UID,o=this.renderer.buffer,s=e.program;s.glPrograms[n]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,s);var a=this.getSignature(t,s),u=t.glVertexArrayObjects[this.CONTEXT_UID],h=u[a];if(h)return u[s.id]=h,h;var c=t.buffers,l=t.attributes,d={},f={};for(var p in c)d[p]=0,f[p]=0;for(var p in l)!l[p].size&&s.attributeData[p]?l[p].size=s.attributeData[p].size:l[p].size||console.warn("PIXI Geometry attribute '"+p+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[l[p].buffer]+=l[p].size*nW[l[p].type];for(var p in l){var m=l[p],v=m.size;void 0===m.stride&&(d[m.buffer]===v*nW[m.type]?m.stride=0:m.stride=d[m.buffer]),void 0===m.start&&(m.start=f[m.buffer],f[m.buffer]+=v*nW[m.type])}h=i.createVertexArray(),i.bindVertexArray(h);for(var _=0;_<c.length;_++){var y=c[_];o.bind(y),r&&y._glBuffers[n].refCount++}return this.activateVao(t,s),this._activeVao=h,u[s.id]=h,u[a]=h,h},t.prototype.disposeGeometry=function(t,e){var r;if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var i=t.glVertexArrayObjects[this.CONTEXT_UID],n=this.gl,o=t.buffers,s=null===(r=this.renderer)||void 0===r?void 0:r.buffer;if(t.disposeRunner.remove(this),i){if(s)for(var a=0;a<o.length;a++){var u=o[a]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,0!==u.refCount||e||s.dispose(o[a],e))}if(!e)for(var h in i)if("g"===h[0]){var c=i[h];this._activeVao===c&&this.unbind(),n.deleteVertexArray(c)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t)},t.prototype.activateVao=function(t,e){var r=this.gl,i=this.CONTEXT_UID,n=this.renderer.buffer,o=t.buffers,s=t.attributes;t.indexBuffer&&n.bind(t.indexBuffer);var a=null;for(var u in s){var h=s[u],c=o[h.buffer],l=c._glBuffers[i];if(e.attributeData[u]){a!==l&&(n.bind(c),a=l);var d=e.attributeData[u].location;if(r.enableVertexAttribArray(d),r.vertexAttribPointer(d,h.size,h.type||r.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(d,1)}}}},t.prototype.draw=function(t,e,r,i){var n=this.gl,o=this._activeGeometry;if(o.indexBuffer){var s=o.indexBuffer.data.BYTES_PER_ELEMENT,a=2===s?n.UNSIGNED_SHORT:n.UNSIGNED_INT;2===s||4===s&&this.canUseUInt32ElementIndex?o.instanced?n.drawElementsInstanced(t,e||o.indexBuffer.data.length,a,(r||0)*s,i||1):n.drawElements(t,e||o.indexBuffer.data.length,a,(r||0)*s):console.warn("unsupported index buffer type: uint32")}else o.instanced?n.drawArraysInstanced(t,r,e||o.getSize(),i||1):n.drawArrays(t,r,e||o.getSize());return this},t.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},t.prototype.destroy=function(){this.renderer=null},t}(),sW=function(){function t(t){void 0===t&&(t=null),this.type=cD.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=aM.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(t.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=cD.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},t.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},t}();function aW(t,e,r){var i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function uW(t,e){var r=t.getShaderSource(e).split("\n").map((function(t,e){return e+": "+t})),i=t.getShaderInfoLog(e),n=i.split("\n"),o={},s=n.map((function(t){return parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))})).filter((function(t){return!(!t||o[t])&&(o[t]=!0,!0)})),a=[""];s.forEach((function(t){r[t-1]="%c"+r[t-1]+"%c",a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));var u=r.join("\n");a[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function hW(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=!1;return e}function cW(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return hW(2*e);case"bvec3":return hW(3*e);case"bvec4":return hW(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var lW,dW={},fW=dW;function pW(){if(!lW){lW=hD.MEDIUM;var t=function(){if(fW===dW||fW&&fW.isContextLost()){var t=document.createElement("canvas"),e=void 0;aM.PREFER_ENV>=ZM.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),fW=e}return fW}();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);lW=e.precision?hD.HIGH:hD.MEDIUM}}return lW}function mW(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===hD.HIGH&&r!==hD.HIGH&&(i=hD.MEDIUM),"precision "+i+" float;\n"+t}return r!==hD.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var vW={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function _W(t){return vW[t]}var yW=null,gW={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function bW(t,e){if(!yW){var r=Object.keys(gW);yW={};for(var i=0;i<r.length;++i){var n=r[i];yW[t[n]]=gW[n]}}return yW[e]}var TW=[{test:function(t){return"float"===t.type&&1===t.size},code:function(t){return'\n            if(uv["'+t+'"] !== ud["'+t+'"].value)\n            {\n                ud["'+t+'"].value = uv["'+t+'"]\n                gl.uniform1f(ud["'+t+'"].location, uv["'+t+'"])\n            }\n            '}},{test:function(t){return("sampler2D"===t.type||"samplerCube"===t.type||"sampler2DArray"===t.type)&&1===t.size&&!t.isArray},code:function(t){return't = syncData.textureCount++;\n\n            renderer.texture.bind(uv["'+t+'"], t);\n\n            if(ud["'+t+'"].value !== t)\n            {\n                ud["'+t+'"].value = t;\n                gl.uniform1i(ud["'+t+'"].location, t);\n; // eslint-disable-line max-len\n            }'}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&void 0!==e.a},code:function(t){return'\n            gl.uniformMatrix3fv(ud["'+t+'"].location, false, uv["'+t+'"].toArray(true));\n            '},codeUbo:function(t){return"\n                var "+t+"_matrix = uv."+t+".toArray(true);\n\n                data[offset] = "+t+"_matrix[0];\n                data[offset+1] = "+t+"_matrix[1];\n                data[offset+2] = "+t+"_matrix[2];\n        \n                data[offset + 4] = "+t+"_matrix[3];\n                data[offset + 5] = "+t+"_matrix[4];\n                data[offset + 6] = "+t+"_matrix[5];\n        \n                data[offset + 8] = "+t+"_matrix[6];\n                data[offset + 9] = "+t+"_matrix[7];\n                data[offset + 10] = "+t+"_matrix[8];\n            "}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&void 0!==e.x},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    gl.uniform2f(ud["'+t+'"].location, v.x, v.y);\n                }'},codeUbo:function(t){return"\n                v = uv."+t+";\n\n                data[offset] = v.x;\n                data[offset+1] = v.y;\n            "}},{test:function(t){return"vec2"===t.type&&1===t.size},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    gl.uniform2f(ud["'+t+'"].location, v[0], v[1]);\n                }\n            '}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&void 0!==e.width},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    cv[2] = v.width;\n                    cv[3] = v.height;\n                    gl.uniform4f(ud["'+t+'"].location, v.x, v.y, v.width, v.height)\n                }'},codeUbo:function(t){return"\n                    v = uv."+t+";\n\n                    data[offset] = v.x;\n                    data[offset+1] = v.y;\n                    data[offset+2] = v.width;\n                    data[offset+3] = v.height;\n                "}},{test:function(t){return"vec4"===t.type&&1===t.size},code:function(t){return'\n                cv = ud["'+t+'"].value;\n                v = uv["'+t+'"];\n\n                if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    cv[2] = v[2];\n                    cv[3] = v[3];\n\n                    gl.uniform4f(ud["'+t+'"].location, v[0], v[1], v[2], v[3])\n                }'}}],EW={float:"\n    if (cv !== v)\n    {\n        cu.value = v;\n        gl.uniform1f(location, v);\n    }",vec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2f(location, v[0], v[1])\n    }",vec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3f(location, v[0], v[1], v[2])\n    }",vec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n    }",int:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",ivec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2i(location, v[0], v[1]);\n    }",ivec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3i(location, v[0], v[1], v[2]);\n    }",ivec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n    }",uint:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1ui(location, v);\n    }",uvec2:"\n    if (cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2ui(location, v[0], v[1]);\n    }",uvec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3ui(location, v[0], v[1], v[2]);\n    }",uvec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n    }",bool:"\n    if (cv !== v)\n    {\n        cu.value = v;\n        gl.uniform1i(location, v);\n    }",bvec2:"\n    if (cv[0] != v[0] || cv[1] != v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n\n        gl.uniform2i(location, v[0], v[1]);\n    }",bvec3:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3i(location, v[0], v[1], v[2]);\n    }",bvec4:"\n    if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n        cv[3] = v[3];\n\n        gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n    }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},xW={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var RW,SW=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function AW(t){for(var e="",r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+="if(test == "+r+".0){}");return e}var IW=0,CW={},OW=function(){function t(e,r,i){void 0===i&&(i="pixi-shader"),this.id=IW++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(i=i.replace(/\s+/g,"-"),CW[i]?(CW[i]++,i+="-"+CW[i]):CW[i]=1,this.vertexSrc="#define SHADER_NAME "+i+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+"\n"+this.fragmentSrc,this.vertexSrc=mW(this.vertexSrc,aM.PRECISION_VERTEX,hD.HIGH),this.fragmentSrc=mW(this.fragmentSrc,aM.PRECISION_FRAGMENT,pW())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),t.from=function(e,r,i){var n=e+r,o=GV[n];return o||(GV[n]=o=new t(e,r,i)),o},t}(),wW=function(){function t(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof WY?e:new WY(e):new WY({})}return t.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var r in e.uniforms){var i=e.uniforms[r];if(i.group&&this.checkUniformExists(t,i))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(e,r,i){return new t(OW.from(e,r),i)},t}(),PW=function(){function t(){this.data=0,this.blendMode=JM.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(t.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(t){!!(32&this.data)!==t&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==JM.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},t.for2d=function(){var e=new t;return e.depthTest=!1,e.blend=!0,e},t}(),NW=function(t){function e(r,i,n){var o=this,s=OW.from(r||e.defaultVertexSrc,i||e.defaultFragmentSrc);return(o=t.call(this,s,n)||this).padding=0,o.resolution=aM.FILTER_RESOLUTION,o.multisample=aM.FILTER_MULTISAMPLE,o.enabled=!0,o.autoFit=!0,o.state=new PW,o}return lY(e,t),e.prototype.apply=function(t,e,r,i,n){t.applyFilter(this,e,r,i)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition();\n    vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),e}(wW),MW=new $V,DW=function(){function t(t,e){this._texture=t,this.mapCoord=new $V,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,i=0;i<t.length;i+=2){var n=t[i],o=t[i+1];e[i]=n*r.a+o*r.c+r.tx,e[i+1]=n*r.b+o*r.d+r.ty}return e},t.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var r=e._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);var i=e.orig,n=e.trim;n&&(MW.set(i.width/n.width,0,0,i.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(MW));var o=e.baseTexture,s=this.uClampFrame,a=this.clampMargin/o.resolution,u=this.clampOffset;return s[0]=(e._frame.x+a+u)/o.width,s[1]=(e._frame.y+a+u)/o.height,s[2]=(e._frame.x+e._frame.width-a+u)/o.width,s[3]=(e._frame.y+e._frame.height-a+u)/o.height,this.uClampOffset[0]=u/o.realWidth,this.uClampOffset[1]=u/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0},t}(),LW=function(t){function e(e,r,i){var n=this,o=null;return"string"!=typeof e&&void 0===r&&void 0===i&&(o=e,e=void 0,r=void 0,i=void 0),(n=t.call(this,e||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n",r||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n    float clip = step(3.5,\n        step(maskClamp.x, vMaskCoord.x) +\n        step(maskClamp.y, vMaskCoord.y) +\n        step(vMaskCoord.x, maskClamp.z) +\n        step(vMaskCoord.y, maskClamp.w));\n\n    vec4 original = texture2D(uSampler, vTextureCoord);\n    vec4 masky = texture2D(mask, vMaskCoord);\n    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n    original *= (alphaMul * masky.r * alpha * clip);\n\n    gl_FragColor = original;\n}\n",i)||this).maskSprite=o,n.maskMatrix=new $V,n}return lY(e,t),Object.defineProperty(e.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),e.prototype.apply=function(t,e,r,i){var n=this._maskSprite,o=n._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new DW(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,e,r,i))},e}(NW),UW=function(){function t(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return t.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},t.prototype.push=function(t,e){var r=e;if(!r.isMaskData){var i=this.maskDataPool.pop()||new sW;i.pooled=!0,i.maskObject=e,r=i}var n=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(r.copyCountersOrReset(n),r.autoDetect&&this.detect(r),r._target=t,r.type!==cD.SPRITE&&this.maskStack.push(r),r.enabled)switch(r.type){case cD.SCISSOR:this.renderer.scissor.push(r);break;case cD.STENCIL:this.renderer.stencil.push(r);break;case cD.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r)}r.type===cD.SPRITE&&this.maskStack.push(r)},t.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case cD.SCISSOR:this.renderer.scissor.pop();break;case cD.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case cD.SPRITE:this.popSpriteMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){var r=this.maskStack[this.maskStack.length-1];r.type===cD.SPRITE&&r._filters&&(r._filters[0].maskSprite=r.maskObject)}}},t.prototype.detect=function(t){t.maskObject.isSprite?t.type=cD.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=cD.SCISSOR:t.type=cD.STENCIL},t.prototype.pushSpriteMask=function(t){var e,r,i=t.maskObject,n=t._target,o=t._filters;o||(o=this.alphaMaskPool[this.alphaMaskIndex])||(o=this.alphaMaskPool[this.alphaMaskIndex]=[new LW]);var s,a,u=this.renderer,h=u.renderTexture;if(h.current){var c=h.current;s=t.resolution||c.resolution,a=null!==(e=t.multisample)&&void 0!==e?e:c.multisample}else s=t.resolution||u.resolution,a=null!==(r=t.multisample)&&void 0!==r?r:u.multisample;o[0].resolution=s,o[0].multisample=a,o[0].maskSprite=i;var l=n.filterArea;n.filterArea=i.getBounds(!0),u.filter.push(n,o),n.filterArea=l,t._filters||this.alphaMaskIndex++},t.prototype.popSpriteMask=function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},t.prototype.destroy=function(){this.renderer=null},t}(),FW=function(){function t(t){this.renderer=t,this.maskStack=[],this.glConst=0}return t.prototype.getStackLength=function(){return this.maskStack.length},t.prototype.setMaskStack=function(t){var e=this.renderer.gl,r=this.getStackLength();this.maskStack=t;var i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},t.prototype._useCurrent=function(){},t.prototype.destroy=function(){this.renderer=null,this.maskStack=null},t}(),GW=new $V,BW=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.SCISSOR_TEST,r}return lY(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){if(!t._scissorRectLocal){var e=t._scissorRect,r=t.maskObject,i=this.renderer,n=i.renderTexture;r.renderable=!0;var o=r.getBounds();this.roundFrameToPixels(o,n.current?n.current.resolution:i.resolution,n.sourceFrame,n.destinationFrame,i.projection.transform),r.renderable=!1,e&&o.fit(e),t._scissorRectLocal=o}},e.isMatrixRotated=function(t){if(!t)return!1;var e=t.a,r=t.b,i=t.c,n=t.d;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)},e.prototype.testScissor=function(t){var r=t.maskObject;if(!r.isFastRect||!r.isFastRect())return!1;if(e.isMatrixRotated(r.worldTransform))return!1;if(e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var i=t._scissorRectLocal;return i.width>0&&i.height>0},e.prototype.roundFrameToPixels=function(t,r,i,n,o){e.isMatrixRotated(o)||((o=o?GW.copyFrom(o):GW.identity()).translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(o,t),t.fit(n),t.x=Math.round(t.x*r),t.y=Math.round(t.y*r),t.width=Math.round(t.width*r),t.height=Math.round(t.height*r))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(){var t=this.renderer.gl;this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},e}(FW),kW=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return lY(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?e.disable(e.STENCIL_TEST):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(FW),XW=function(){function t(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new $V,this.transform=null}return t.prototype.update=function(t,e,r,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,i),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},t.prototype.calculateProjection=function(t,e,r,i){var n=this.projectionMatrix,o=i?-1:1;n.identity(),n.a=1/e.width*2,n.d=o*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-o-e.y*n.d},t.prototype.setTransform=function(t){},t.prototype.destroy=function(){this.renderer=null},t}(),HW=new JV,jW=new JV,VW=function(){function t(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new JV,this.destinationFrame=new JV,this.viewportFrame=new JV}return t.prototype.bind=function(t,e,r){void 0===t&&(t=null);var i,n,o,s=this.renderer;this.current=t,t?(o=(i=t.baseTexture).resolution,e||(HW.width=t.frame.width,HW.height=t.frame.height,e=HW),r||(jW.x=t.frame.x,jW.y=t.frame.y,jW.width=e.width,jW.height=e.height,r=jW),n=i.framebuffer):(o=s.resolution,e||(HW.width=s.screen.width,HW.height=s.screen.height,e=HW),r||((r=HW).width=e.width,r.height=e.height));var a=this.viewportFrame;a.x=r.x*o,a.y=r.y*o,a.width=r.width*o,a.height=r.height*o,t||(a.y=s.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(n,a),this.renderer.projection.update(r,e,o,!n),t?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)},t.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor;var r=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,n=r.width!==i.width||r.height!==i.height;if(n){var o=this.viewportFrame,s=o.x,a=o.y,u=o.width,h=o.height;s=Math.round(s),a=Math.round(a),u=Math.round(u),h=Math.round(h),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(s,a,u,h)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),n&&this.renderer.scissor.pop()},t.prototype.resize=function(){this.bind(null)},t.prototype.reset=function(){this.bind(null)},t.prototype.destroy=function(){this.renderer=null},t}();function YW(t,e,r,i,n){r.buffer.update(n)}var WW={float:"\n        data[offset] = v;\n    ",vec2:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n    ",vec3:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n\n    ",vec4:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n        data[offset+3] = v[3];\n    ",mat2:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n\n        data[offset+4] = v[2];\n        data[offset+5] = v[3];\n    ",mat3:"\n        data[offset] = v[0];\n        data[offset+1] = v[1];\n        data[offset+2] = v[2];\n\n        data[offset + 4] = v[3];\n        data[offset + 5] = v[4];\n        data[offset + 6] = v[5];\n\n        data[offset + 8] = v[6];\n        data[offset + 9] = v[7];\n        data[offset + 10] = v[8];\n    ",mat4:"\n        for(var i = 0; i < 16; i++)\n        {\n            data[offset + i] = v[i];\n        }\n    "},zW={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function ZW(t,e){if(!t.autoManage)return{size:0,syncFunc:YW};for(var r=function(t,e){var r=[];for(var i in t)e[i]&&r.push(e[i]);return r.sort((function(t,e){return t.index-e.index})),r}(t.uniforms,e),i=function(t){for(var e=t.map((function(t){return{data:t,offset:0,dataLen:0,dirty:0}})),r=0,i=0,n=0,o=0;o<e.length;o++){var s=e[o];if(r=zW[s.data.type],s.data.size>1&&(r=Math.max(r,16)*s.data.size),s.dataLen=r,i%r!=0&&i<16){var a=i%r%16;i+=a,n+=a}i+r>16?(n=16*Math.ceil(n/16),s.offset=n,n+=r,i=r):(s.offset=n,i+=r,n+=r)}return{uboElements:e,size:n=16*Math.ceil(n/16)}}(r),n=i.uboElements,o=i.size,s=["\n    var v = null;\n    var v2 = null;\n    var cv = null;\n    var t = 0;\n    var gl = renderer.gl\n    var index = 0;\n    var data = buffer.data;\n    "],a=0;a<n.length;a++){for(var u=n[a],h=t.uniforms[u.data.name],c=u.data.name,l=!1,d=0;d<TW.length;d++){var f=TW[d];if(f.codeUbo&&f.test(u.data,h)){s.push("offset = "+u.offset/4+";",TW[d].codeUbo(u.data.name,h)),l=!0;break}}if(!l)if(u.data.size>1){var p=_W(u.data.type),m=Math.max(zW[u.data.type]/16,1),v=p/m,_=(4-v%4)%4;s.push("\n                cv = ud."+c+".value;\n                v = uv."+c+";\n                offset = "+u.offset/4+";\n\n                t = 0;\n\n                for(var i=0; i < "+u.data.size*m+"; i++)\n                {\n                    for(var j = 0; j < "+v+"; j++)\n                    {\n                        data[offset++] = v[t++];\n                    }\n                    offset += "+_+";\n                }\n\n                ")}else{var y=WW[u.data.type];s.push("\n                cv = ud."+c+".value;\n                v = uv."+c+";\n                offset = "+u.offset/4+";\n                "+y+";\n                ")}}return s.push("\n       renderer.buffer.update(buffer);\n    "),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join("\n"))}}var KW=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function qW(t,e){var r=aW(t,t.VERTEX_SHADER,e.vertexSrc),i=aW(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();if(t.attachShader(n,r),t.attachShader(n,i),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||function(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||uW(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||uW(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,n,r,i),e.attributeData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;n<i;n++){var o=e.getActiveAttrib(t,n);if(0!==o.name.indexOf("gl_")){var s=bW(e,o.type),a={type:s,name:o.name,size:_W(s),location:e.getAttribLocation(t,o.name)};r[o.name]=a}}return r}(n,t),e.uniformData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var o=e.getActiveUniform(t,n),s=o.name.replace(/\[.*?\]$/,""),a=!!o.name.match(/\[.*?\]$/),u=bW(e,o.type);r[s]={name:s,index:n,type:u,size:o.size,isArray:a,value:cW(u,o.size)}}return r}(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var o=Object.keys(e.attributeData);o.sort((function(t,e){return t>e?1:-1}));for(var s=0;s<o.length;s++)e.attributeData[o[s]].location=s,t.bindAttribLocation(n,s,o[s]);t.linkProgram(n)}t.deleteShader(r),t.deleteShader(i);var a={};for(var s in e.uniformData){var u=e.uniformData[s];a[s]={location:t.getUniformLocation(n,s),value:cW(u.type,u.size)}}return new KW(n,a)}var JW=0,QW={textureCount:0,uboCount:0},$W=function(){function t(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=JW++}return t.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof RW)return RW;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");RW=!0===t({a:"b"},"a","b")}catch(t){RW=!1}return RW}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},t.prototype.contextChange=function(t){this.gl=t,this.reset()},t.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var r=t.program,i=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==r&&(this.program=r,this.gl.useProgram(i.program)),e||(QW.textureCount=0,QW.uboCount=0,this.syncUniformGroup(t.uniformGroup,QW)),i},t.prototype.setUniforms=function(t){var e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)},t.prototype.syncUniformGroup=function(t,e){var r=this.getGlProgram();t.static&&t.dirtyId===r.uniformDirtyGroups[t.id]||(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))},t.prototype.syncUniforms=function(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)},t.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){var r,i=["\n        var v = null;\n        var cv = null;\n        var cu = null;\n        var t = 0;\n        var gl = renderer.gl;\n    "];for(var n in t.uniforms){var o=e[n];if(o){for(var s=t.uniforms[n],a=!1,u=0;u<TW.length;u++)if(TW[u].test(o,s)){i.push(TW[u].code(n,s)),a=!0;break}if(!a){var h=(1===o.size?EW:xW)[o.type].replace("location",'ud["'+n+'"].location');i.push('\n            cu = ud["'+n+'"];\n            cv = cu.value;\n            v = uv["'+n+'"];\n            '+h+";")}}else(null===(r=t.uniforms[n])||void 0===r?void 0:r.group)&&(t.uniforms[n].ubo?i.push("\n                        renderer.shader.syncUniformBufferGroup(uv."+n+", '"+n+"');\n                    "):i.push("\n                        renderer.shader.syncUniformGroup(uv."+n+", syncData);\n                    "))}return new Function("ud","uv","renderer","syncData",i.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},t.prototype.syncUniformBufferGroup=function(t,e){var r=this.getGlProgram();if(!t.static||0!==t.dirtyId||!r.uniformGroups[t.id]){t.dirtyId=0;var i=r.uniformGroups[t.id]||this.createSyncBufferGroup(t,r,e);t.buffer.update(),i(r.uniformData,t.uniforms,this.renderer,QW,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,r.uniformBufferBindings[e])},t.prototype.createSyncBufferGroup=function(t,e,r){var i=this.renderer.gl;this.renderer.buffer.bind(t.buffer);var n=this.gl.getUniformBlockIndex(e.program,r);e.uniformBufferBindings[r]=this.shader.uniformBindCount,i.uniformBlockBinding(e.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;var o=this.getSignature(t,this.shader.program.uniformData,"ubo"),s=this._uboCache[o];if(s||(s=this._uboCache[o]=ZW(t,this.shader.program.uniformData)),t.autoManage){var a=new Float32Array(s.size/4);t.buffer.update(a)}return e.uniformGroups[t.id]=s.syncFunc,e.uniformGroups[t.id]},t.prototype.getSignature=function(t,e,r){var i=t.uniforms,n=[r+"-"];for(var o in i)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")},t.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},t.prototype.generateProgram=function(t){var e=this.gl,r=t.program,i=qW(e,r);return r.glPrograms[this.renderer.CONTEXT_UID]=i,i},t.prototype.reset=function(){this.program=null,this.shader=null},t.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},t}();var tz=function(){function t(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=JM.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new PW,this.defaultState.blend=!0}return t.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[JM.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.ADD]=[t.ONE,t.ONE],e[JM.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.NONE]=[0,0],e[JM.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[JM.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[JM.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[JM.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[JM.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[JM.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[JM.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[JM.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[JM.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[JM.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[JM.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},t.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,r=0;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(r=0;r<this.checks.length;r++)this.checks[r](this,t)},t.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},t.prototype.setBlend=function(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},t.prototype.setOffset=function(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},t.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},t.prototype.setDepthMask=function(t){this.gl.depthMask(t)},t.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},t.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},t.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],r=this.gl;2===e.length?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}},t.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},t.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},t.prototype.updateCheck=function(t,e){var r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):e||-1===r||this.checks.splice(r,1)},t.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},t.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},t.prototype.destroy=function(){this.gl=null},t}(),ez=function(){function t(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=aM.GC_MAX_IDLE,this.checkCountMax=aM.GC_MAX_CHECK_COUNT,this.mode=aM.GC_MODE}return t.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==uD.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;i<e.length;i++){var n=e[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i<e.length;i++)null!==e[i]&&(e[o++]=e[i]);e.length=o}},t.prototype.unload=function(t){var e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(var i=t.children.length-1;i>=0;i--)this.unload(t.children[i])},t.prototype.destroy=function(){this.renderer=null},t}();var rz=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=eD.UNSIGNED_BYTE,this.internalFormat=$M.RGBA,this.samplerType=0},iz=function(){function t(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new vY,this.hasIntegerTextures=!1}return t.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){var e,r,i,n,o,s,a,u,h,c,l,d,f,p,m,v,_,y,g,b,T,E,x;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?((e={})[eD.UNSIGNED_BYTE]=((r={})[$M.RGBA]=t.RGBA8,r[$M.RGB]=t.RGB8,r[$M.RG]=t.RG8,r[$M.RED]=t.R8,r[$M.RGBA_INTEGER]=t.RGBA8UI,r[$M.RGB_INTEGER]=t.RGB8UI,r[$M.RG_INTEGER]=t.RG8UI,r[$M.RED_INTEGER]=t.R8UI,r[$M.ALPHA]=t.ALPHA,r[$M.LUMINANCE]=t.LUMINANCE,r[$M.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,r),e[eD.BYTE]=((i={})[$M.RGBA]=t.RGBA8_SNORM,i[$M.RGB]=t.RGB8_SNORM,i[$M.RG]=t.RG8_SNORM,i[$M.RED]=t.R8_SNORM,i[$M.RGBA_INTEGER]=t.RGBA8I,i[$M.RGB_INTEGER]=t.RGB8I,i[$M.RG_INTEGER]=t.RG8I,i[$M.RED_INTEGER]=t.R8I,i),e[eD.UNSIGNED_SHORT]=((n={})[$M.RGBA_INTEGER]=t.RGBA16UI,n[$M.RGB_INTEGER]=t.RGB16UI,n[$M.RG_INTEGER]=t.RG16UI,n[$M.RED_INTEGER]=t.R16UI,n[$M.DEPTH_COMPONENT]=t.DEPTH_COMPONENT16,n),e[eD.SHORT]=((o={})[$M.RGBA_INTEGER]=t.RGBA16I,o[$M.RGB_INTEGER]=t.RGB16I,o[$M.RG_INTEGER]=t.RG16I,o[$M.RED_INTEGER]=t.R16I,o),e[eD.UNSIGNED_INT]=((s={})[$M.RGBA_INTEGER]=t.RGBA32UI,s[$M.RGB_INTEGER]=t.RGB32UI,s[$M.RG_INTEGER]=t.RG32UI,s[$M.RED_INTEGER]=t.R32UI,s[$M.DEPTH_COMPONENT]=t.DEPTH_COMPONENT24,s),e[eD.INT]=((a={})[$M.RGBA_INTEGER]=t.RGBA32I,a[$M.RGB_INTEGER]=t.RGB32I,a[$M.RG_INTEGER]=t.RG32I,a[$M.RED_INTEGER]=t.R32I,a),e[eD.FLOAT]=((u={})[$M.RGBA]=t.RGBA32F,u[$M.RGB]=t.RGB32F,u[$M.RG]=t.RG32F,u[$M.RED]=t.R32F,u[$M.DEPTH_COMPONENT]=t.DEPTH_COMPONENT32F,u),e[eD.HALF_FLOAT]=((h={})[$M.RGBA]=t.RGBA16F,h[$M.RGB]=t.RGB16F,h[$M.RG]=t.RG16F,h[$M.RED]=t.R16F,h),e[eD.UNSIGNED_SHORT_5_6_5]=((c={})[$M.RGB]=t.RGB565,c),e[eD.UNSIGNED_SHORT_4_4_4_4]=((l={})[$M.RGBA]=t.RGBA4,l),e[eD.UNSIGNED_SHORT_5_5_5_1]=((d={})[$M.RGBA]=t.RGB5_A1,d),e[eD.UNSIGNED_INT_2_10_10_10_REV]=((f={})[$M.RGBA]=t.RGB10_A2,f[$M.RGBA_INTEGER]=t.RGB10_A2UI,f),e[eD.UNSIGNED_INT_10F_11F_11F_REV]=((p={})[$M.RGB]=t.R11F_G11F_B10F,p),e[eD.UNSIGNED_INT_5_9_9_9_REV]=((m={})[$M.RGB]=t.RGB9_E5,m),e[eD.UNSIGNED_INT_24_8]=((v={})[$M.DEPTH_STENCIL]=t.DEPTH24_STENCIL8,v),e[eD.FLOAT_32_UNSIGNED_INT_24_8_REV]=((_={})[$M.DEPTH_STENCIL]=t.DEPTH32F_STENCIL8,_),x=e):((y={})[eD.UNSIGNED_BYTE]=((g={})[$M.RGBA]=t.RGBA,g[$M.RGB]=t.RGB,g[$M.ALPHA]=t.ALPHA,g[$M.LUMINANCE]=t.LUMINANCE,g[$M.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,g),y[eD.UNSIGNED_SHORT_5_6_5]=((b={})[$M.RGB]=t.RGB,b),y[eD.UNSIGNED_SHORT_4_4_4_4]=((T={})[$M.RGBA]=t.RGBA,T),y[eD.UNSIGNED_SHORT_5_5_5_1]=((E={})[$M.RGBA]=t.RGBA,E),x=y),x}(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r<e;r++)this.boundTextures[r]=null;this.emptyTextures={};var i=new rz(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new rz(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(r=0;r<6;r++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(r=0;r<this.boundTextures.length;r++)this.bind(null,r)},t.prototype.bind=function(t,e){void 0===e&&(e=0);var r=this.gl;if((t=null==t?void 0:t.castToBaseTexture())&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),this.updateTexture(t)),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[e]=null},t.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},t.prototype.unbind=function(t){var e=this.gl,r=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var i=0;i<r.length;i++)r[i]===this.unknownTexture&&this.bind(null,i)}for(i=0;i<r.length;i++)r[i]===t&&(this.currentLocation!==i&&(e.activeTexture(e.TEXTURE0+i),this.currentLocation=i),e.bindTexture(t.target,this.emptyTextures[t.target].texture),r[i]=null)},t.prototype.ensureSamplerType=function(t){var e=this,r=e.boundTextures,i=e.hasIntegerTextures,n=e.CONTEXT_UID;if(i)for(var o=t-1;o>=0;--o){var s=r[o];if(s)s._glTextures[n].samplerType!==rD.FLOAT&&this.renderer.texture.unbind(s)}},t.prototype.initTexture=function(t){var e=new rz(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},t.prototype.initTextureType=function(t,e){var r,i;e.internalFormat=null!==(i=null===(r=this.internalFormats[t.type])||void 0===r?void 0:r[t.format])&&void 0!==i?i:t.format,2===this.webGLVersion&&t.type===eD.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},t.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var r=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(r,t,e))e.samplerType!==rD.FLOAT&&(this.hasIntegerTextures=!0);else{var i=t.realWidth,n=t.realHeight,o=r.gl;(e.width!==i||e.height!==n||e.dirtyId<0)&&(e.width=i,e.height=n,o.texImage2D(t.target,0,e.internalFormat,i,n,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},t.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var i=this.managedTextures.indexOf(t);-1!==i&&function(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i<o;++i)t[i]=t[i+r];t.length=o}}(this.managedTextures,i,1)}},t.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==oD.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=nD.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},t.prototype.setStyle=function(t,e){var r=this.gl;if(e.mipmap&&t.mipmap!==oD.ON_MANUAL&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===iD.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===iD.LINEAR){var n=Math.min(t.anisotropicLevel,r.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===iD.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===iD.LINEAR?r.LINEAR:r.NEAREST)},t.prototype.destroy=function(){this.renderer=null},t}(),nz=new $V,oz=function(t){function e(e,r){void 0===e&&(e=KM.UNKNOWN);var i=t.call(this)||this;return r=Object.assign({},aM.RENDER_OPTIONS,r),i.options=r,i.type=e,i.screen=new JV(0,0,r.width,r.height),i.view=r.view||document.createElement("canvas"),i.resolution=r.resolution||aM.RESOLUTION,i.useContextAlpha=r.useContextAlpha,i.autoDensity=!!r.autoDensity,i.preserveDrawingBuffer=r.preserveDrawingBuffer,i.clearBeforeRender=r.clearBeforeRender,i._backgroundColor=0,i._backgroundColorRgba=[0,0,0,1],i._backgroundColorString="#000000",i.backgroundColor=r.backgroundColor||i._backgroundColor,i.backgroundAlpha=r.backgroundAlpha,void 0!==r.transparent&&(UV("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),i.useContextAlpha=r.transparent,i.backgroundAlpha=r.transparent?0:1),i._lastObjectRendered=null,i.plugins={},i}return lY(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var r=this.view.width/this.resolution,i=this.view.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=i+"px"),this.emit("resize",r,i)},e.prototype.generateTexture=function(t,e,r,i){void 0===e&&(e={}),"number"==typeof e&&(UV("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),e={scaleMode:e,resolution:r,region:i});var n=e.region,o=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&(r[i[n]]=t[i[n]])}return r}(e,["region"]);0===(i=n||t.getLocalBounds(null,!0)).width&&(i.width=1),0===i.height&&(i.height=1);var s=MY.create(dY({width:i.width,height:i.height},o));return nz.tx=-i.x,nz.ty=-i.y,this.render(t,{renderTexture:s,clear:!1,transform:nz,skipUpdateTransform:!!t.parent}),s},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var r=this;r.plugins=null,r.type=KM.UNKNOWN,r.view=null,r.screen=null,r._tempDisplayObjectParent=null,r.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=function(t){var e=t.toString(16);return"#"+("000000".substring(0,6-e.length)+e)}(t),function(t,e){void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(Jj),sz=function(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},az=function(){function t(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return t.prototype.destroy=function(){this.renderer=null},t.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},t.prototype.bind=function(t){var e=this.gl,r=this.CONTEXT_UID,i=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)},t.prototype.bindBufferBase=function(t,e){var r=this.gl,i=this.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var n=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,n.buffer)}},t.prototype.bindBufferRange=function(t,e,r){var i=this.gl,n=this.CONTEXT_UID;r=r||0;var o=t._glBuffers[n]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,o.buffer,256*r,256)},t.prototype.update=function(t){var e=this.gl,r=this.CONTEXT_UID,i=t._glBuffers[r];if(t._updateID!==i.updateID)if(i.updateID=t._updateID,e.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),r&&(e||i.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),r=0;r<e.length;r++)this.dispose(this.managedBuffers[e[r]],t)},t.prototype.createGLBuffer=function(t){var e=this.CONTEXT_UID,r=this.gl;return t._glBuffers[e]=new sz(r.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]},t}();!function(t){function e(r){var i=t.call(this,KM.WEBGL,r)||this;return r=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new VV("destroy"),contextChange:new VV("contextChange"),reset:new VV("reset"),update:new VV("update"),postrender:new VV("postrender"),prerender:new VV("prerender"),resize:new VV("resize")},i.runners.contextChange.add(i),i.globalUniforms=new WY({projectionMatrix:new $V},!0),i.addSystem(UW,"mask").addSystem(tW,"context").addSystem(tz,"state").addSystem($W,"shader").addSystem(iz,"texture").addSystem(az,"buffer").addSystem(oW,"geometry").addSystem(iW,"framebuffer").addSystem(BW,"scissor").addSystem(kW,"stencil").addSystem(XW,"projection").addSystem(ez,"textureGC").addSystem(qY,"filter").addSystem(VW,"renderTexture").addSystem(QY,"batch"),i.initPlugins(e.__plugins),i.multisample=void 0,r.context?i.context.initFromContext(r.context):i.context.initFromOptions({alpha:!!i.useContextAlpha,antialias:r.antialias,premultipliedAlpha:i.useContextAlpha&&"notMultiplied"!==i.useContextAlpha,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,function(t){var e;if(!IV){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS 6.4.2 - ✰ "+t+" ✰  %c  %c  http://www.pixijs.com/  %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+t+" - http://www.pixijs.com/");IV=!0}}(2===i.context.webGLVersion?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}lY(e,t),e.create=function(t){if(void 0===AV&&(AV=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:aM.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),AV)return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t,e=this.gl;if(1===this.context.webGLVersion){var r=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,r)}else{r=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,r)}t>=lD.HIGH?this.multisample=lD.HIGH:t>=lD.MEDIUM?this.multisample=lD.MEDIUM:t>=lD.LOW?this.multisample=lD.LOW:this.multisample=lD.NONE},e.prototype.addSystem=function(t,e){var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e){var r,i,n,o;if(e&&(e instanceof MY?(UV("6.0.0","Renderer#render arguments changed, use options instead."),r=e,i=arguments[2],n=arguments[3],o=arguments[4]):(r=e.renderTexture,i=e.clear,n=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(r||(this._lastObjectRendered=t),!o){var s=t.enableTempParent();t.updateTransform(),t.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(e,r,i,n){void 0===r&&(r={});var o=t.prototype.generateTexture.call(this,e,r,i,n);return this.framebuffer.blit(),o},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();t.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return UV("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r}}(oz);var uz=function(){this.texArray=null,this.blend=0,this.type=QM.TRIANGLES,this.start=0,this.size=0,this.data=null},hz=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},t}(),cz=function(){function t(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(t.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),t.prototype.view=function(t){return this[t+"View"]},t.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},t.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},t}(),lz=function(t){function e(e){var r=t.call(this,e)||this;return r.shaderGenerator=null,r.geometryClass=null,r.vertexSize=null,r.state=PW.for2d(),r.size=4*aM.SPRITE_BATCH_SIZE,r._vertexCount=0,r._indexCount=0,r._bufferedElements=[],r._bufferedTextures=[],r._bufferSize=0,r._shader=null,r._packedGeometries=[],r._packedGeometryPoolSize=2,r._flushId=0,r._aBuffers={},r._iBuffers={},r.MAX_TEXTURES=1,r.renderer.on("prerender",r.onPrerender,r),e.runners.contextChange.add(r),r._dcIndex=0,r._aIndex=0,r._iIndex=0,r._attributeBuffer=null,r._indexBuffer=null,r._tempBoundTextures=[],r}return lY(e,t),e.prototype.contextChange=function(){var t=this.renderer.gl;aM.PREFER_ENV===ZM.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),aM.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var r=e.createShader(e.FRAGMENT_SHADER);;){var i=SW.replace(/%forloop%/gi,AW(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,r=e._textureArrayPool,i=this.size/4,n=Math.floor(i/this.MAX_TEXTURES)+1;t.length<i;)t.push(new uz);for(;r.length<n;)r.push(new hz);for(var o=0;o<this.MAX_TEXTURES;o++)this._tempBoundTextures[o]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,r=this.MAX_TEXTURES,i=e._textureArrayPool,n=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++vY._globalBatch,u=0,h=i[0],c=0;n.copyBoundTextures(o,r);for(var l=0;l<this._bufferSize;++l){var d=t[l];t[l]=null,d._batchEnabled!==a&&(h.count>=r&&(n.boundArray(h,o,a,r),this.buildDrawCalls(h,c,l),c=l,h=i[++u],++a),d._batchEnabled=a,d.touched=s,h.elements[h.count++]=d)}h.count>0&&(n.boundArray(h,o,a,r),this.buildDrawCalls(h,c,this._bufferSize),++u,++a);for(l=0;l<o.length;l++)o[l]=null;vY._globalBatch=a},e.prototype.buildDrawCalls=function(t,r,i){var n=this,o=n._bufferedElements,s=n._attributeBuffer,a=n._indexBuffer,u=n.vertexSize,h=e._drawCallPool,c=this._dcIndex,l=this._aIndex,d=this._iIndex,f=h[c];f.start=this._iIndex,f.texArray=t;for(var p=r;p<i;++p){var m=o[p],v=m._texture.baseTexture,_=CV[v.alphaMode?1:0][m.blendMode];o[p]=null,r<p&&f.blend!==_&&(f.size=d-f.start,r=p,(f=h[++c]).texArray=t,f.start=d),this.packInterleavedGeometry(m,s,a,l,d),l+=m.vertexData.length/2*u,d+=m.indices.length,f.blend=_}r<i&&(f.size=d-f.start,++c),this._dcIndex=c,this._aIndex=l,this._iIndex=d},e.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this,e=t._packedGeometries,r=t._attributeBuffer,i=t._indexBuffer;aM.CAN_UPLOAD_SAME_BUFFER?(e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,r=this.renderer,i=r.gl,n=r.state,o=e._drawCallPool,s=null,a=0;a<t;a++){var u=o[a],h=u.texArray,c=u.type,l=u.size,d=u.start,f=u.blend;s!==h&&(s=h,this.bindAndClearTexArray(h)),this.state.blendMode=f,n.set(this.state),i.drawElements(c,l,i.UNSIGNED_SHORT,2*d)}},e.prototype.flush=function(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),aM.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=wV(Math.ceil(t/8)),r=NV(e),i=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);var n=this._aBuffers[i];return n||(this._aBuffers[i]=n=new cz(i*this.vertexSize*4)),n},e.prototype.getIndexBuffer=function(t){var e=wV(Math.ceil(t/12)),r=NV(e),i=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);var n=this._iBuffers[r];return n||(this._iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.packInterleavedGeometry=function(t,e,r,i,n){for(var o=e.uint32View,s=e.float32View,a=i/this.vertexSize,u=t.uvs,h=t.indices,c=t.vertexData,l=t._texture.baseTexture._batchLocation,d=Math.min(t.worldAlpha,1),f=d<1&&t._texture.baseTexture.alphaMode?function(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n*e+.5|0)}(t._tintRGB,d):t._tintRGB+(255*d<<24),p=0;p<c.length;p+=2)s[i++]=c[p],s[i++]=c[p+1],s[i++]=u[p],s[i++]=u[p+1],o[i++]=f,s[i++]=l;for(p=0;p<h.length;p++)r[n++]=a+h[p]},e._drawCallPool=[],e._textureArrayPool=[],e}(JY),dz=function(){function t(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return t.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=WY.from({uSamplers:e},!0);var i=this.fragTemplate;i=(i=i.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new OW(this.vertexSrc,i)}var n={tint:new Float32Array([1,1,1,1]),translationMatrix:new $V,default:this.defaultGroupCache[t]};return new wW(this.programCache[t],n)},t.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+="if(vTextureId < "+r+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"},t}(),fz=function(t){function e(e){void 0===e&&(e=!1);var r=t.call(this)||this;return r._buffer=new FY(null,e,!1),r._indexBuffer=new FY(null,e,!0),r.addAttribute("aVertexPosition",r._buffer,2,!1,eD.FLOAT).addAttribute("aTextureCoord",r._buffer,2,!1,eD.FLOAT).addAttribute("aColor",r._buffer,4,!0,eD.UNSIGNED_BYTE).addAttribute("aTextureId",r._buffer,1,!0,eD.FLOAT).addIndex(r._indexBuffer),r}return lY(e,t),e}(HY),pz="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n    vTextureCoord = aTextureCoord;\n    vTextureId = aTextureId;\n    vColor = aColor * tint;\n}\n",mz="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n    vec4 color;\n    %forloop%\n    gl_FragColor = color * vColor;\n}\n",vz=function(){function t(){}return t.create=function(t){var e=Object.assign({vertex:pz,fragment:mz,geometryClass:fz,vertexSize:6},t),r=e.vertex,i=e.fragment,n=e.vertexSize,o=e.geometryClass;return function(t){function e(e){var s=t.call(this,e)||this;return s.shaderGenerator=new dz(r,i),s.geometryClass=o,s.vertexSize=n,s}return lY(e,t),e}(lz)},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return pz},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentTemplate",{get:function(){return mz},enumerable:!1,configurable:!0}),t}();vz.create();var _z=function(){function t(t){this.renderer=t}return t.prototype.render=function(t){var e=this.renderer,r=t.worldTransform;e.context.globalAlpha=t.worldAlpha,e.setBlendMode(t.blendMode),e.setContextTransform(r,t.roundPixels),t.drawMode!==QM.TRIANGLES?this._renderTriangleMesh(t):this._renderTriangles(t)},t.prototype._renderTriangleMesh=function(t){for(var e=t.geometry.buffers[0].data.length,r=0;r<e-2;r++){var i=2*r;this._renderDrawTriangle(t,i,i+2,i+4)}},t.prototype._renderTriangles=function(t){for(var e=t.geometry.getIndex().data,r=e.length,i=0;i<r;i+=3){var n=2*e[i],o=2*e[i+1],s=2*e[i+2];this._renderDrawTriangle(t,n,o,s)}},t.prototype._renderDrawTriangle=function(t,e,r,i){var n=this.renderer.context,o=t.geometry.buffers[0].data,s=t.uvs,a=t.texture;if(a.valid){var u=16777215!==t.tint,h=a.baseTexture,c=h.width,l=h.height;u&&t._cachedTint!==t.tint&&(t._cachedTint=t.tint,t._cachedTexture=t._cachedTexture||new NY(h),t._tintedCanvas=zj.getTintedCanvas({texture:t._cachedTexture},t.tint));var d=u?t._tintedCanvas:h.getDrawableSource(),f=s[e]*h.width,p=s[r]*h.width,m=s[i]*h.width,v=s[e+1]*h.height,_=s[r+1]*h.height,y=s[i+1]*h.height,g=o[e],b=o[r],T=o[i],E=o[e+1],x=o[r+1],R=o[i+1],S=t.canvasPadding/this.renderer.resolution;if(S>0){var A=t.worldTransform,I=A.a,C=A.b,O=A.c,w=A.d,P=(g+b+T)/3,N=(E+x+R)/3,M=g-P,D=E-N,L=I*M+O*D,U=C*M+w*D,F=Math.sqrt(L*L+U*U),G=1+S/F;g=P+M*G,E=N+D*G,L=I*(M=b-P)+O*(D=x-N),U=C*M+w*D,b=P+M*(G=1+S/(F=Math.sqrt(L*L+U*U))),x=N+D*G,L=I*(M=T-P)+O*(D=R-N),U=C*M+w*D,T=P+M*(G=1+S/(F=Math.sqrt(L*L+U*U))),R=N+D*G}n.save(),n.beginPath(),n.moveTo(g,E),n.lineTo(b,x),n.lineTo(T,R),n.closePath(),n.clip();var B=f*_+v*m+p*y-_*m-v*p-f*y,k=g*_+v*T+b*y-_*T-v*b-g*y,X=f*b+g*m+p*T-b*m-g*p-f*T,H=f*_*T+v*b*m+g*p*y-g*_*m-v*p*T-f*b*y,j=E*_+v*R+x*y-_*R-v*x-E*y,V=f*x+E*m+p*R-x*m-E*p-f*R,Y=f*_*R+v*x*m+E*p*y-E*_*m-v*p*R-f*x*y;n.transform(k/B,j/B,X/B,V/B,H/B,Y/B),n.drawImage(d,0,0,c*h.resolution,l*h.resolution,0,0,c,l),n.restore(),this.renderer.invalidateBlendMode()}},t.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n<i-2;++n){var o=2*n,s=r[o],a=r[o+1],u=r[o+2],h=r[o+3],c=r[o+4],l=r[o+5];e.moveTo(s,a),e.lineTo(u,h),e.lineTo(c,l)}e.fillStyle="#FF0000",e.fill(),e.closePath()},t.prototype.destroy=function(){this.renderer=null},t}();aM.MESH_CANVAS_PADDING=0,yH.prototype._renderCanvas=function(t,e){t.plugins.mesh.render(e)},Bj.prototype._cachedTint=16777215,Bj.prototype._tintedCanvas=null,Bj.prototype._canvasUvs=null,Bj.prototype._renderCanvas=function(t){var e=t.context,r=this.worldTransform,i=16777215!==this.tint,n=this.texture;if(n.valid){i&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedCanvas=zj.getTintedCanvas(this,this.tint));var o=i?this._tintedCanvas:n.baseTexture.getDrawableSource();this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,a=this._canvasUvs,u=i?0:n.frame.x,h=i?0:n.frame.y,c=u+n.frame.width,l=h+n.frame.height;a[0]=u,a[1]=u+this._leftWidth,a[2]=c-this._rightWidth,a[3]=c,a[4]=h,a[5]=h+this._topHeight,a[6]=l-this._bottomHeight,a[7]=l;for(var d=0;d<8;d++)a[d]*=n.baseTexture.resolution;e.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),t.setContextTransform(r,this.roundPixels);for(var f=0;f<3;f++)for(var p=0;p<3;p++){var m=2*p+8*f,v=Math.max(1,a[p+1]-a[p]),_=Math.max(1,a[f+5]-a[f+4]),y=Math.max(1,s[m+10]-s[m]),g=Math.max(1,s[m+11]-s[m+1]);e.drawImage(o,a[p],a[f+4],v,_,s[m],s[m+1],y,g)}}};var yz=!1;_H.prototype._cachedTint=16777215,_H.prototype._tintedCanvas=null,_H.prototype._cachedTexture=null,_H.prototype._renderCanvas=function(t){this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.material._renderCanvas?this.material._renderCanvas(t,this):yz||(yz=!0,globalThis.console&&console.warn("Mesh with custom shaders are not supported in CanvasRenderer."))},_H.prototype._canvasPadding=null,Object.defineProperty(_H.prototype,"canvasPadding",{get:function(){return null!==this._canvasPadding?this._canvasPadding:aM.MESH_CANVAS_PADDING},set:function(t){this._canvasPadding=t}}),Gj.prototype._renderCanvas=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(t,this)},Uj.prototype._renderCanvas=function(t){(this.autoUpdate||this.geometry._width!==this.shader.texture.height)&&(this.geometry._width=this.shader.texture.height,this.geometry.update()),this.shader.update&&this.shader.update(),this.calculateUvs(),this.material._renderCanvas(t,this)};var gz,bz=function(){function t(){}return t.offsetPolygon=function(e,r){var i=[],n=e.length;r=t.isPolygonClockwise(e)?r:-1*r;for(var o=0;o<n;o+=2){var s=o-2;s<0&&(s+=n);var a=(o+2)%n,u=e[o]-e[s],h=e[o+1]-e[s+1],c=Math.sqrt(u*u+h*h);u/=c,h/=c;var l=-(h*=r),d=u*=r,f=[e[s]+l,e[s+1]+d],p=[e[o]+l,e[o+1]+d],m=e[a]-e[o],v=e[a+1]-e[o+1];m/=c=Math.sqrt(m*m+v*v),v/=c;var _=-(v*=r),y=m*=r,g=[e[o]+_,e[o+1]+y],b=[e[a]+_,e[a+1]+y],T=t.findIntersection(f[0],f[1],p[0],p[1],g[0],g[1],b[0],b[1]);T&&i.push.apply(i,T)}return i},t.findIntersection=function(t,e,r,i,n,o,s,a){var u=(a-o)*(r-t)-(s-n)*(i-e),h=(s-n)*(e-o)-(a-o)*(t-n);if(0===u)return 0===h&&0===(r-t)*(e-o)-(i-e)*(t-n)?[(t+r)/2,(e+i)/2]:null;var c=h/u;return[t+c*(r-t),e+c*(i-e)]},t.isPolygonClockwise=function(t){for(var e=0,r=0,i=t.length-2;r<t.length;i=r,r+=2)e+=(t[r]-t[i])*(t[r+1]+t[i+1]);return e>0},t}(),Tz=function(){function t(t){this._svgMatrix=null,this._tempMatrix=new pL,this.renderer=t}return t.prototype._calcCanvasStyle=function(t,e){var r;return t.texture&&t.texture.baseTexture!==DU.WHITE.baseTexture?t.texture.valid?(r=zj.getTintedPattern(t.texture,e),this.setPatternTransform(r,t.matrix||pL.IDENTITY)):r="#808080":r="#"+("00000"+(0|e).toString(16)).slice(-6),r},t.prototype.render=function(t){var e=this.renderer,r=e.context,i=t.worldAlpha,n=t.transform.worldTransform;e.setContextTransform(n),e.setBlendMode(t.blendMode);for(var o,s,a=t.geometry.graphicsData,u=(t.tint>>16&255)/255,h=(t.tint>>8&255)/255,c=(255&t.tint)/255,l=0;l<a.length;l++){var d=a[l],f=d.shape,p=d.fillStyle,m=d.lineStyle,v=0|d.fillStyle.color,_=0|d.lineStyle.color;if(d.matrix&&e.setContextTransform(n.copyTo(this._tempMatrix).append(d.matrix)),p.visible){var y=((v>>16&255)/255*u*255<<16)+((v>>8&255)/255*h*255<<8)+(255&v)/255*c*255;o=this._calcCanvasStyle(p,y)}if(m.visible){var g=((_>>16&255)/255*u*255<<16)+((_>>8&255)/255*h*255<<8)+(255&_)/255*c*255;s=this._calcCanvasStyle(m,g)}if(r.lineWidth=m.width,r.lineCap=m.cap,r.lineJoin=m.join,r.miterLimit=m.miterLimit,d.type===rL.POLY){r.beginPath();var b=(O=f).points,T=d.holes,E=void 0,x=void 0,R=void 0,S=void 0,A=void 0;r.moveTo(b[0],b[1]);for(var I=2;I<b.length;I+=2)r.lineTo(b[I],b[I+1]);if(O.closeStroke&&r.closePath(),T.length>0){A=[],E=0,R=b[0],S=b[1];for(I=2;I+2<b.length;I+=2)E+=(b[I]-R)*(b[I+3]-S)-(b[I+2]-R)*(b[I+1]-S);for(var C=0;C<T.length;C++)if(b=T[C].shape.points){x=0,R=b[0],S=b[1];for(I=2;I+2<b.length;I+=2)x+=(b[I]-R)*(b[I+3]-S)-(b[I+2]-R)*(b[I+1]-S);if(x*E<0){r.moveTo(b[0],b[1]);for(I=2;I<b.length;I+=2)r.lineTo(b[I],b[I+1])}else{r.moveTo(b[b.length-2],b[b.length-1]);for(I=b.length-4;I>=0;I-=2)r.lineTo(b[I],b[I+1])}T[C].shape.closeStroke&&r.closePath(),A[C]=x*E<0}}p.visible&&(r.globalAlpha=p.alpha*i,r.fillStyle=o,r.fill()),m.visible&&this.paintPolygonStroke(O,m,s,T,A,i,r)}else if(d.type===rL.RECT){var O=f;if(p.visible&&(r.globalAlpha=p.alpha*i,r.fillStyle=o,r.fillRect(O.x,O.y,O.width,O.height)),m.visible){var w=m.width*(.5-(1-m.alignment)),P=O.width+2*w,N=O.height+2*w;r.globalAlpha=m.alpha*i,r.strokeStyle=s,r.strokeRect(O.x-w,O.y-w,P,N)}}else if(d.type===rL.CIRC){O=f;if(r.beginPath(),r.arc(O.x,O.y,O.radius,0,2*Math.PI),r.closePath(),p.visible&&(r.globalAlpha=p.alpha*i,r.fillStyle=o,r.fill()),m.visible){if(.5!==m.alignment){w=m.width*(.5-(1-m.alignment));r.beginPath(),r.arc(O.x,O.y,O.radius+w,0,2*Math.PI),r.closePath()}r.globalAlpha=m.alpha*i,r.strokeStyle=s,r.stroke()}}else if(d.type===rL.ELIP){O=f;if((V=1===m.alignment)||this.paintEllipse(O,p,m,o,i,r),m.visible){if(.5!==m.alignment){var M=.5522848,D=(w=m.width*(.5-(1-m.alignment)),2*(O.width+w)),L=2*(O.height+w),U=O.x-D/2,F=O.y-L/2,G=D/2*M,B=L/2*M,k=U+D,X=F+L,H=U+D/2,j=F+L/2;r.beginPath(),r.moveTo(U,j),r.bezierCurveTo(U,j-B,H-G,F,H,F),r.bezierCurveTo(H+G,F,k,j-B,k,j),r.bezierCurveTo(k,j+B,H+G,X,H,X),r.bezierCurveTo(H-G,X,U,j+B,U,j),r.closePath()}r.globalAlpha=m.alpha*i,r.strokeStyle=s,r.stroke()}V&&this.paintEllipse(O,p,m,o,i,r)}else if(d.type===rL.RREC){var V;O=f;if((V=1===m.alignment)||this.paintRoundedRectangle(O,p,m,o,i,r),m.visible){if(.5!==m.alignment){P=O.width,N=O.height,w=m.width*(.5-(1-m.alignment));var Y=O.x-w,W=O.y-w,z=O.width+2*w,Z=O.height+2*w,K=w*(m.alignment>=1?Math.min(z/P,Z/N):Math.min(P/z,N/Z)),q=O.radius+K,J=Math.min(z,Z)/2;q=q>J?J:q,r.beginPath(),r.moveTo(Y,W+q),r.lineTo(Y,W+Z-q),r.quadraticCurveTo(Y,W+Z,Y+q,W+Z),r.lineTo(Y+z-q,W+Z),r.quadraticCurveTo(Y+z,W+Z,Y+z,W+Z-q),r.lineTo(Y+z,W+q),r.quadraticCurveTo(Y+z,W,Y+z-q,W),r.lineTo(Y+q,W),r.quadraticCurveTo(Y,W,Y,W+q),r.closePath()}r.globalAlpha=m.alpha*i,r.strokeStyle=s,r.stroke()}V&&this.paintRoundedRectangle(O,p,m,o,i,r)}}},t.prototype.paintPolygonStroke=function(t,e,r,i,n,o,s){if(.5!==e.alignment){var a=e.width*(.5-(1-e.alignment)),u=bz.offsetPolygon(t.points,a),h=void 0;s.beginPath(),s.moveTo(u[0],u[1]);for(var c=2;c<u.length;c+=2)s.lineTo(u[c],u[c+1]);t.closeStroke&&s.closePath();for(var l=0;l<i.length;l++){if(h=i[l].shape.points,u=bz.offsetPolygon(h,a),n[l]){s.moveTo(u[0],u[1]);for(c=2;c<u.length;c+=2)s.lineTo(u[c],u[c+1])}else{s.moveTo(u[u.length-2],u[u.length-1]);for(c=u.length-4;c>=0;c-=2)s.lineTo(u[c],u[c+1])}i[l].shape.closeStroke&&s.closePath()}}s.globalAlpha=e.alpha*o,s.strokeStyle=r,s.stroke()},t.prototype.paintEllipse=function(t,e,r,i,n,o){var s=2*t.width,a=2*t.height,u=t.x-s/2,h=t.y-a/2,c=.5522848,l=s/2*c,d=a/2*c,f=u+s,p=h+a,m=u+s/2,v=h+a/2;0===r.alignment&&o.save(),o.beginPath(),o.moveTo(u,v),o.bezierCurveTo(u,v-d,m-l,h,m,h),o.bezierCurveTo(m+l,h,f,v-d,f,v),o.bezierCurveTo(f,v+d,m+l,p,m,p),o.bezierCurveTo(m-l,p,u,v+d,u,v),o.closePath(),0===r.alignment&&o.clip(),e.visible&&(o.globalAlpha=e.alpha*n,o.fillStyle=i,o.fill()),0===r.alignment&&o.restore()},t.prototype.paintRoundedRectangle=function(t,e,r,i,n,o){var s=t.x,a=t.y,u=t.width,h=t.height,c=t.radius,l=Math.min(u,h)/2;c=c>l?l:c,0===r.alignment&&o.save(),o.beginPath(),o.moveTo(s,a+c),o.lineTo(s,a+h-c),o.quadraticCurveTo(s,a+h,s+c,a+h),o.lineTo(s+u-c,a+h),o.quadraticCurveTo(s+u,a+h,s+u,a+h-c),o.lineTo(s+u,a+c),o.quadraticCurveTo(s+u,a,s+u-c,a),o.lineTo(s+c,a),o.quadraticCurveTo(s,a,s,a+c),o.closePath(),0===r.alignment&&o.clip(),e.visible&&(o.globalAlpha=e.alpha*n,o.fillStyle=i,o.fill()),0===r.alignment&&o.restore()},t.prototype.setPatternTransform=function(t,e){if(!1!==this._svgMatrix){if(!this._svgMatrix){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r&&r.createSVGMatrix&&(this._svgMatrix=r.createSVGMatrix()),!this._svgMatrix||!t.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=e.a,this._svgMatrix.b=e.b,this._svgMatrix.c=e.c,this._svgMatrix.d=e.d,this._svgMatrix.e=e.tx,this._svgMatrix.f=e.ty,t.setTransform(this._svgMatrix.inverse())}},t.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},t}(),Ez=new pL;IX.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=LU.create({width:r.width,height:r.height,scaleMode:t,resolution:e});gz||(gz=new Wj),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(Ez),Ez.invert(),Ez.tx-=r.x,Ez.ty-=r.y,gz.render(this,{renderTexture:i,clear:!0,transform:Ez});var n=DU.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.setResolution(e),n},IX.prototype.cachedGraphicsData=[],IX.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var xz=new pL,Rz=function(){function t(t){this.renderer=t}return t.prototype.render=function(t){var e=t._texture,r=this.renderer,i=r.context;if(e.valid){var n=e._frame.width,o=e._frame.height,s=t.transform.worldTransform,a=0,u=0,h=e.baseTexture.getDrawableSource();if(!(e.orig.width<=0||e.orig.height<=0)&&e.valid&&h){r.setBlendMode(t.blendMode,!0),r.context.globalAlpha=t.worldAlpha;var c=e.baseTexture.scaleMode===iD.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==c&&(i[r.smoothProperty]=c),e.trim?(a=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,u=e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(a=(.5-t.anchor.x)*e.orig.width,u=(.5-t.anchor.y)*e.orig.height),e.rotate&&(s.copyTo(xz),s=xz,EL.matrixAppendRotationInv(s,e.rotate,a,u),a=0,u=0),a-=n/2,u-=o/2,r.setContextTransform(s,t.roundPixels,1),t.roundPixels&&(a|=0,u|=0);var l=e.baseTexture.resolution,d=r._outerBlend;d&&(i.save(),i.beginPath(),i.rect(a*r.resolution,u*r.resolution,n*r.resolution,o*r.resolution),i.clip()),16777215!==t.tint?(t._cachedTint===t.tint&&t._tintedCanvas.tintId===t._texture._updateID||(t._cachedTint=t.tint,t._tintedCanvas=zj.getTintedCanvas(t,t.tint)),i.drawImage(t._tintedCanvas,0,0,Math.floor(n*l),Math.floor(o*l),Math.floor(a*r.resolution),Math.floor(u*r.resolution),Math.floor(n*r.resolution),Math.floor(o*r.resolution))):i.drawImage(h,e._frame.x*l,e._frame.y*l,Math.floor(n*l),Math.floor(o*l),Math.floor(a*r.resolution),Math.floor(u*r.resolution),Math.floor(n*r.resolution),Math.floor(o*r.resolution)),d&&i.restore(),r.setBlendMode(JM.NORMAL)}}},t.prototype.destroy=function(){this.renderer=null},t}();NX.prototype._tintedCanvas=null,NX.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var Sz=new uL,Az=function(){function t(t){this.renderer=t}return t.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},t.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},t.prototype.canvas=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof LU?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=Sz).width=this.renderer.width,i.height=this.renderer.height);var s=Math.floor(i.width*r+1e-4),a=Math.floor(i.height*r+1e-4),u=new tL(s,a,1),h=e.getImageData(i.x*r,i.y*r,s,a);return u.context.putImageData(h,0,0),u.canvas},t.prototype.pixels=function(t){var e,r,i,n,o=this.renderer;t&&(n=t instanceof LU?t:o.generateTexture(t)),n?(e=n.baseTexture._canvasRenderTarget.context,r=n.baseTexture._canvasRenderTarget.resolution,i=n.frame):(e=o.rootContext,r=o.resolution,(i=Sz).width=o.width,i.height=o.height);var s=i.x*r,a=i.y*r,u=i.width*r,h=i.height*r;return e.getImageData(s,a,u,h).data},t.prototype.destroy=function(){this.renderer=null},t}(),Iz=function(t,e){return Iz=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Iz(t,e)};function Cz(t,e){var r=t;if(e instanceof yU){var i=e.source,n=0===i.width?r.canvas.width:Math.min(r.canvas.width,i.width),o=0===i.height?r.canvas.height:Math.min(r.canvas.height,i.height);return r.ctx.drawImage(i,0,0,n,o,0,0,r.canvas.width,r.canvas.height),!0}return!1}var Oz=function(t){function e(e){var r=t.call(this,e)||this;return r.uploadHookHelper=r,r.canvas=document.createElement("canvas"),r.canvas.width=16,r.canvas.height=16,r.ctx=r.canvas.getContext("2d"),r.registerUploadHook(Cz),r}return function(t,e){function r(){this.constructor=t}Iz(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(QX),wz=new pL,Pz=new pL,Nz=[new sL,new sL,new sL,new sL];uH.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=e.baseTexture,o=n.getDrawableSource(),s=n.resolution;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var a=new tL(e._frame.width,e._frame.height,s);16777215!==this.tint?(this._tintedCanvas=zj.getTintedCanvas(this,this.tint),a.context.drawImage(this._tintedCanvas,0,0)):a.context.drawImage(o,-e._frame.x*s,-e._frame.y*s),this._cachedTint=this.tint,this._canvasPattern=a.context.createPattern(a.canvas,"repeat")}r.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),this.tileTransform.updateLocalTransform();var u=this.tileTransform.localTransform,h=this._width,c=this._height;wz.identity(),Pz.copyFrom(u),this.uvRespectAnchor||Pz.translate(-this.anchor.x*h,-this.anchor.y*c),Pz.scale(this.tileScale.x/s,this.tileScale.y/s),wz.prepend(Pz),wz.prepend(i),t.setContextTransform(wz),r.fillStyle=this._canvasPattern;var l=this.anchor.x*-h,d=this.anchor.y*-c;Nz[0].set(l,d),Nz[1].set(l+h,d),Nz[2].set(l+h,d+c),Nz[3].set(l,d+c);for(var f=0;f<4;f++)Pz.applyInverse(Nz[f],Nz[f]);r.beginPath(),r.moveTo(Nz[0].x,Nz[0].y);for(f=1;f<4;f++)r.lineTo(Nz[f].x,Nz[f].y);r.closePath(),r.fill()}},qk.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var u=0;u<this.children.length;++u){var h=this.children[u];if(h.visible&&h._texture.valid){var c=h._texture.frame;if(e.globalAlpha=this.worldAlpha*h.alpha,h.rotation%(2*Math.PI)==0)i&&(t.setContextTransform(r,!1,1),i=!1),n=h.anchor.x*(-c.width*h.scale.x)+h.position.x+.5,o=h.anchor.y*(-c.height*h.scale.y)+h.position.y+.5,s=c.width*h.scale.x,a=c.height*h.scale.y;else{i||(i=!0),h.displayObjectUpdateTransform();var l=h.worldTransform;t.setContextTransform(l,this.roundPixels,1),n=h.anchor.x*-c.width+.5,o=h.anchor.y*-c.height+.5,s=c.width,a=c.height}var d=h._texture.baseTexture.resolution;e.drawImage(h._texture.baseTexture.getDrawableSource(),c.x*d,c.y*d,c.width*d,c.height*d,n*t.resolution,o*t.resolution,s*t.resolution,a*t.resolution)}}}},KL.prototype._renderCanvas=function(t){},KL.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask),this._renderCanvas(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},WL.prototype.renderCanvas=function(t){},HX.prototype._renderCanvas=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),NX.prototype._renderCanvas.call(this,t)},Wj.registerPlugin("accessibility",JL),Wj.registerPlugin("extract",Az),Wj.registerPlugin("graphics",Tz),Wj.registerPlugin("interaction",uU),Wj.registerPlugin("mesh",_z),Wj.registerPlugin("prepare",Oz),Wj.registerPlugin("sprite",Rz);var Mz=function(t,e){return Mz=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])},Mz(t,e)};var Dz=function(t){function e(e){var r=t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void)\n{\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    if (c.a > 0.0) {\n        c.rgb /= c.a;\n\n        vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n        rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n        rgb.r *= red;\n        rgb.g *= green;\n        rgb.b *= blue;\n        c.rgb = rgb * brightness;\n\n        c.rgb *= c.a;\n    }\n\n    gl_FragColor = c * alpha;\n}\n")||this;return r.gamma=1,r.saturation=1,r.contrast=1,r.brightness=1,r.red=1,r.green=1,r.blue=1,r.alpha=1,Object.assign(r,e),r}return function(t,e){function r(){this.constructor=t}Mz(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.apply=function(t,e,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,t.applyFilter(this,e,r,i)},e}(DF),Lz=qf("process:video"),Uz=function(){function t(t){var e,r;this.frameRate=null,this.resolution=null,this.backgroundColor=null,this.streamList=[],this.textList=[],this.isStart=!1,this.output=null,this.worker=null,this.renderer=null,this.stage=null,this.ticker=$L.shared,this.isPaused=!1;var i=t.frameRate,n=t.resolution,o=t.backgroundColor;this.frameRate=i,this.resolution=n,this.backgroundColor=o,this.worker=AP(),this.renderer=lG({width:n.width,height:n.height,backgroundColor:o,antialias:!0,resolution:1,forceCanvas:zR||qR}),this.stage=new KL,this.stage.sortableChildren=!0,this.ticker.autoStart=!1,this.ticker.stop(),this.draw=Qh(e=this.draw).call(e,this),this.setStreamParams=Qh(r=this.setStreamParams).call(r,this)}return t.prototype.setResolution=function(t){var e;this.resolution=t,null===(e=this.renderer)||void 0===e||e.resize(t.width,t.height)},t.prototype.setBackgroundColor=function(t){this.backgroundColor=t,this.renderer&&(this.renderer.backgroundColor=t)},t.prototype.addStream=function(t){var e,r=this,i=t.source,n=t.order,o=null,s=null;if(i instanceof MediaStream){var a,u=$c(a=this.streamList).call(a,(function(t){return t.source===i}));u?o=u.element:((o=Eg()).onpause=function(){Lz("video is paused, try to resume"),Bl((function(){var t,e;null===(e=null===(t=o)||void 0===t?void 0:t.play)||void 0===e||e.call(t)}),50)},o.muted=!0,o.srcObject=i,o.load())}else o=i;var h=$c(e=this.streamList).call(e,(function(t){return t.element===o}));s=h?h.texture:DU.from(o);var c=new NX(s),l=o instanceof HTMLVideoElement?o.videoWidth:o.naturalWidth,d=o instanceof HTMLVideoElement?o.videoHeight:o.naturalHeight;if(0===l||0===d){var f=o instanceof HTMLVideoElement?"loadedmetadata":"load";o.addEventListener(f,(function e(){o.removeEventListener(f,e,!1),r.setStreamParams(c,o,t)}),!1)}else this.setStreamParams(c,o,t);c.zIndex=n,this.stage.addChild(c),this.streamList.push(id(id({},t),{element:o,texture:s,sprite:c}))},t.prototype.removeStream=function(t){var e,r,i,n=Sc(e=this.streamList).call(e,(function(e){return e.id===t}));if(-1!==n){var o,s=ad(Vc(r=this.streamList).call(r,n,1),1)[0];if(this.stage.removeChild(s.sprite),s.sprite.filters=null,s.sprite.destroy(),s.sprite=null,$c(i=this.streamList).call(i,(function(t){return t.element===s.element}))||s.texture.destroy(!0),s.texture=null,s.source instanceof MediaStream)if(!$c(o=this.streamList).call(o,(function(t){return t.source===s.source}))){var a=s.element;a.onpause=null,a.pause(),a.srcObject=null,a.load(),a.remove()}s.element=null}else Lz("remove failed, stream "+t+" is not existed")},t.prototype.addText=function(t){var e=t.x,r=t.y,i=t.order,n=t.content,o=t.style,s=o.font_alpha,a=void 0===s?100:s,u=o.background_color,h=o.background_alpha,c=void 0===h?100:h,l=new KL;l.sortableChildren=!0;var d=this.transformTextStyle(o),f=new HX(n,d);if(f.alpha=Number(a)/100,f.zIndex=1,l.addChild(f),u){var p=new IX;p.beginFill("number"==typeof u?u:DD(u),Number(c)/100),p.drawRect(0,0,l.width,l.height),p.endFill(),p.zIndex=0,l.addChild(p)}l.pivot.x=l.width/2,l.pivot.y=l.height/2,l.x=e,l.y=r,l.zIndex=i,this.stage.addChild(l),this.textList.push(id(id({},t),{container:l}))},t.prototype.removeText=function(t){var e,r,i=Sc(e=this.textList).call(e,(function(e){return e.id===t}));if(-1!==i){var n=ad(Vc(r=this.textList).call(r,i,1),1)[0];this.stage.removeChild(n.container),n.container.destroy(!0),n.container=null}else Lz("remove failed, text "+t+" is not existed")},t.prototype.start=function(){this.isStart?Lz("rendering has started"):this.renderer?(this.isStart=!0,this.isPaused=!1,this.draw(),this.output=this.renderer.view.captureStream(this.frameRate)):Lz("renderer is not existed")},t.prototype.stop=function(){this.isStart?(this.isStart=!1,this.isPaused=!1,this.destroy()):Lz("rendering has stopped")},t.prototype.getOutput=function(){return this.output},t.prototype.getRenderView=function(){var t;return null===(t=this.renderer)||void 0===t?void 0:t.view},t.prototype.pause=function(){this.isPaused=!0},t.prototype.resume=function(){this.isPaused=!1},t.prototype.setStreamParams=function(t,e,r){var i=r.x,n=r.y,o=r.width,s=r.height,a=r.operations,u=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,h=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,c={width:o,height:s};0!==u&&0!==h&&(c=o/s<u/h?{width:o,height:o*h/u}:{width:s*u/h,height:s}),t.anchor.set(.5,.5),t.width=c.width,t.height=c.height,t.x=i,t.y=n,cc(a).call(a,(function(e){var r,i,n,o=e.type,s=e.params,a=void 0===s?{}:s;if("image_mirror"===o&&(a.left_right&&(t.scale.x*=-1),a.up_down&&(t.scale.y*=-1)),"image_filter_normal"===o){t.filters||(t.filters=[]);var u=function(t){return 1+t/100},h={contrast:u(null!==(r=a.contrast)&&void 0!==r?r:0),brightness:u(null!==(i=a.brightness)&&void 0!==i?i:0),saturation:u(null!==(n=a.saturation)&&void 0!==n?n:0)};t.filters.push(new Dz(h))}}))},t.prototype.transformTextStyle=function(t){var e,r={};return cc(e=rl(t)).call(e,(function(e){var i=BP[e];if(i)switch(i){case"fontWeight":r[i]=t[e]?"bold":"normal";break;case"fontStyle":r[i]=t[e]?"italic":"normal";break;case"dropShadowColor":t[e]&&(r.dropShadow=!0,r[i]=t[e]);break;case"dropShadowAlpha":r[i]=Number(t[e])/100;break;default:r[i]=t[e]}})),new UX(r)},t.prototype.draw=function(){this.isStart&&this.renderer&&this.stage?(this.isPaused||(this.ticker.update(),this.renderer.render(this.stage)),this.requestAnimationFrameWrapper(this.draw)):Lz("render stop")},t.prototype.destroy=function(){var t,e,r,i,n,o,s,a=this;null===(i=this.worker)||void 0===i||i.terminate(),this.worker=null;var u=Yl(t=this.streamList).call(t,(function(t){return t.id}));cc(u).call(u,(function(t){a.removeStream(t)})),this.streamList=[];var h=Yl(e=this.textList).call(e,(function(t){return t.id}));cc(h).call(h,(function(t){a.removeText(t)})),this.textList=[],null===(n=this.stage)||void 0===n||n.destroy({children:!0,texture:!0,baseTexture:!0}),this.stage=null,null===(o=this.renderer)||void 0===o||o.destroy(!0),this.renderer=null,null===(s=this.output)||void 0===s||cc(r=s.getTracks()).call(r,(function(t){t.stop()})),this.output=null},t.prototype.setWorkerInterval=function(t,e){var r,i,n=this;null===(r=this.worker)||void 0===r||r.addEventListener("message",t),null===(i=this.worker)||void 0===i||i.postMessage({type:"start",data:{time:e}});return function(){var e,r;null===(e=n.worker)||void 0===e||e.postMessage({type:"stop"}),null===(r=n.worker)||void 0===r||r.removeEventListener("message",t)}},t.prototype.requestAnimationFrameWrapper=function(t){var e=!1,r=this.setWorkerInterval((function(){!e&&document.hidden&&(e=!0,r(),t())}),1e3/this.frameRate);requestAnimationFrame((function(){e||(e=!0,r(),t())}))},t}(),Fz=zh("Array").entries,Gz=Yr,Bz=kt,kz=Q,Xz=Fz,Hz=Array.prototype,jz={DOMTokenList:!0,NodeList:!0},Vz=function(t){var e=t.entries;return t===Hz||kz(Hz,t)&&e===Hz.entries||Bz(jz,Gz(t))?Xz:e},Yz=qf("process:audio"),Wz=function(){function t(){this.streamList=[],this.isStart=!1,this.output=null,this.audioContext=null,this.audioDestination=null,this.audioConstantSource=null;var t=Tg(),e=t.createGain();if(e.gain.value=1,t.createConstantSource){var r=t.createConstantSource();r.start();var i=t.createGain();i.gain.value=0,r.connect(i),i.connect(e),this.audioConstantSource=r}this.audioContext=t,this.audioDestination=e}return t.prototype.addStream=function(t){var e,r,i,n=this,o=t.source,s=t.operations,a=null,u=$c(e=this.streamList).call(e,(function(t){return t.source===o}));u?a=u.audioSource:o instanceof MediaStream?o.getAudioTracks().length>0&&(a=this.audioContext.createMediaStreamSource(o)):(a=o._audioSource||this.audioContext.createMediaElementSource(o),o._audioSource=a,a.connect(this.audioContext.destination));var h=[];if(a){cc(s).call(s,(function(t){var e,r,i,o,s,a,u=t.type,c=t.params,l=void 0===c?{}:c;if("audio_volumes"===u){var d=n.audioContext.createGain();d.gain.value=(null!==(e=l.all)&&void 0!==e?e:100)/100,h.push(d)}if("audio_compressor"===u){var f=n.audioContext.createDynamicsCompressor();f.threshold.value=null!==(r=l.threshold)&&void 0!==r?r:kP.threshold.value,f.ratio.value=null!==(i=l.ratio)&&void 0!==i?i:kP.ratio.value,f.knee.value=null!==(o=l.knee)&&void 0!==o?o:kP.knee.value,f.attack.value=(null!==(s=l.attack)&&void 0!==s?s:kP.attack.value)/1e3,f.release.value=(null!==(a=l.release)&&void 0!==a?a:kP.release.value)/1e3,h.push(f)}}));var c=h.length;if(c>0)try{for(var l=sd(Vz(h).call(h)),d=l.next();!d.done;d=l.next()){var f=ad(d.value,2),p=f[0],m=f[1];0===p&&a.connect(m),p===c-1&&m.connect(this.audioDestination),p<c-1&&m.connect(h[p+1])}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}else a.connect(this.audioDestination)}this.streamList.push(id(id({},t),{audioSource:a,audioNodeList:h}))},t.prototype.removeStream=function(t){var e,r,i,n,o=Sc(e=this.streamList).call(e,(function(e){return e.id===t}));if(-1!==o){var s=ad(Vc(r=this.streamList).call(r,o,1),1)[0];if(s.audioSource){var a=s.audioSource,u=s.audioNodeList,h=u.length;if(h>0)try{for(var c=sd(Vz(u).call(u)),l=c.next();!l.done;l=c.next()){var d=ad(l.value,2),f=d[0],p=d[1];0===f&&a.disconnect(p),f===h-1&&p.disconnect(this.audioDestination),f<h-1&&p.disconnect(u[f+1])}}catch(t){i={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}else a.disconnect(this.audioDestination)}s.audioSource=null,s.audioNodeList=null}else Yz("remove failed, stream "+t+" is not existed")},t.prototype.start=function(){if(this.isStart)Yz("process has started");else if(this.audioContext&&this.audioDestination){this.isStart=!0;var t=this.audioContext.createMediaStreamDestination();this.audioDestination.connect(t),this.output=t.stream}else Yz("audio context is not existed")},t.prototype.stop=function(){this.isStart?(this.isStart=!1,this.destroy()):Yz("process has stopped")},t.prototype.getOutput=function(){return this.output},t.prototype.destroy=function(){var t,e,r,i,n,o,s,a=this,u=Yl(t=this.streamList).call(t,(function(t){return t.id}));cc(u).call(u,(function(t){a.removeStream(t)})),this.streamList=[],null===(r=this.audioConstantSource)||void 0===r||r.stop(),null===(i=this.audioConstantSource)||void 0===i||i.disconnect(),this.audioConstantSource=null,null===(n=this.audioDestination)||void 0===n||n.disconnect(),this.audioDestination=null,window.TXLiveAudioContext||(null===(o=this.audioContext)||void 0===o||o.close(),this.audioContext=null),null===(s=this.output)||void 0===s||cc(e=s.getTracks()).call(e,(function(t){t.stop()})),this.output=null},t}(),zz=qf("process"),Zz=function(){function t(t){void 0===t&&(t={}),this.frameRate=15,this.resolution=FP,this.backgroundColor=0,this.lastData=null,this.curData=null,this.isProcessStart=!1,this.output=null,this.videoProcess=null,this.audioProcess=null;var e=t.frameRate,r=t.resolution,i=t.backgroundColor,n=t.data;e&&this.setFrameRate(e),r&&this.setResolution(r),i&&this.setBackgroundColor(i),n&&this.setData(n)}return t.prototype.setFrameRate=function(t){t?"number"!=typeof t||t<=0?zz("frameRate must be a number greater than 0"):this.frameRate=t:zz("frameRate must be existed")},t.prototype.setResolution=function(t){var e;t?"object"===Nh(t)&&"number"==typeof t.width&&"number"==typeof t.height&&(t.width>0&&t.height>0||0===t.width&&0===t.height)?(this.resolution=t,t.width>0&&t.height>0&&(null===(e=this.videoProcess)||void 0===e||e.setResolution(t))):zz("resolution width and height must be a number greater than or equal to 0"):zz("resolution must be existed")},t.prototype.setBackgroundColor=function(t){var e;null!=t?"number"!=typeof t||t<0||t>16777215?zz("backgroundColor must be a valid color number"):(this.backgroundColor=t,null===(e=this.videoProcess)||void 0===e||e.setBackgroundColor(t)):zz("backgroundColor must be existed")},t.prototype.setData=function(t){var e,r,i,n,o,s,a=this;if(UP(t)){try{for(var u=sd(t),h=u.next();!h.done;h=u.next()){var c,l=h.value,d=l.id,f=l.type,p=l.order,m=l.items;if(!d)return void zz("data.id is not existed");if(!Sl(c=rl(GP)).call(c,f))return void zz("data.type("+f+") is invalid");if(void 0!==p&&"number"!=typeof p)return void zz("data.order must be a number");if(!UP(m))return void zz("data.items must be an array");try{for(var v=(i=void 0,sd(m)),_=v.next();!_.done;_=v.next()){var y,g=_.value,b=g.id,T=g.type,E=g.source,x=g.content,R=g.operations;if(!b)return void zz("data.items.id is not existed");if(!Sl(y=GP[f]).call(y,T))return void zz("data.items.type("+T+") is invalid");if("video"===f){if(!("video"!==T||E instanceof NP||E instanceof MediaStream||E instanceof HTMLVideoElement))return void zz("data.items.source("+T+") is invalid");if("image"===T&&!(E instanceof HTMLImageElement))return void zz("data.items.source("+T+") is invalid")}else if("audio"===f){if(!(E instanceof NP||E instanceof MediaStream||E instanceof HTMLVideoElement||E instanceof HTMLAudioElement))return void zz("data.items.source("+T+") is invalid")}else if("text"===f){if(!x)return void zz("data.items.content is not existed");var S=x.text,A=x.text_style;if(!S)return void zz("data.items.content.text is not existed");if("object"!==Nh(A)||UP(A)||null===A)return void zz("data.items.content.text_style is invalid")}if(void 0!==R){if(!UP(R))return void zz("data.items.operations must be an array");var I=function(t){var e,r,i=t.type,n=t.params,o=void 0===n?{}:n;if("audio_volumes"===i&&void 0!==o.all&&"number"!=typeof o.all)return zz("audio_volumes param must be a number"),{value:void 0};if("audio_compressor"===i&&rl(o).length>0&&!rd(e=rl(o)).call(e,(function(t){var e=kP[t];if(!e)return zz("audio_compressor param "+t+" is invalid"),!1;var r=o[t];return!("number"!=typeof r||r<e.min||r>e.max)||(zz("audio_compressor param "+t+" must be a number between "+e.min+" and "+e.max),!1)})))return{value:void 0};if("image_filter_normal"===i&&rl(o).length>0&&!rd(r=rl(o)).call(r,(function(t){var e=o[t];return!("number"!=typeof e||e<-100||e>100)||(zz("image_filter_normal param "+t+" must be a number between -100 and 100"),!1)})))return{value:void 0}};try{for(var C=(o=void 0,sd(R)),O=C.next();!O.done;O=C.next()){var w=I(O.value);if("object"===Nh(w))return w.value}}catch(t){o={error:t}}finally{try{O&&!O.done&&(s=C.return)&&s.call(C)}finally{if(o)throw o.error}}}}}catch(t){i={error:t}}finally{try{_&&!_.done&&(n=v.return)&&n.call(v)}finally{if(i)throw i.error}}}}catch(t){e={error:t}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(this.lastData=this.curData,this.curData=bI(t),this.isProcessStart){var P=ad((D=this.curData,L=this.lastData,[h_(L,D,yg),h_(D,L,yg)]),2),N=P[0],M=P[1];this.videoProcess&&(this.videoProcess.pause(),this.removeVideoData(N),this.addVideoData(M),Bl((function(){var t;null===(t=a.videoProcess)||void 0===t||t.resume()}),1500/this.frameRate)),this.removeAudioData(N),this.addAudioData(M)}var D,L}else zz("data must be an array")},t.prototype.start=function(){var t=this;return new VR((function(e,r){var i;if(t.isProcessStart)return zz("processing has started"),void r(new Error("processing has started"));if(!t.curData||0===t.curData.length)return zz("data is empty"),void r(new Error("data is empty"));t.isProcessStart=!0;var n=t,o=n.frameRate,s=n.resolution,a=n.backgroundColor;s.width>0&&s.height>0&&(t.videoProcess=new Uz({frameRate:o,resolution:s,backgroundColor:a}),t.addVideoData(t.curData)),t.audioProcess=new Wz,t.addAudioData(t.curData),null===(i=t.videoProcess)||void 0===i||i.start(),t.audioProcess.start(),e()}))},t.prototype.stop=function(){var t,e,r;this.isProcessStart?(this.isProcessStart=!1,null===(e=this.videoProcess)||void 0===e||e.stop(),this.audioProcess.stop(),this.lastData=null,this.videoProcess=null,this.audioProcess=null,null===(r=this.output)||void 0===r||cc(t=r.getTracks()).call(t,(function(t){t.stop()})),this.output=null):zz("processing has stopped")},t.prototype.isStart=function(){return this.isProcessStart},t.prototype.getOutput=function(){var t,e,r,i;if(!this.isProcessStart)return null;var n=this.output||new MediaStream,o=n.getVideoTracks().length>0,s=n.getAudioTracks().length>0,a=null===(e=null===(t=this.videoProcess)||void 0===t?void 0:t.getOutput())||void 0===e?void 0:e.getVideoTracks();!o&&(null==a?void 0:a.length)?n.addTrack(a[0]):o&&!(null==a?void 0:a.length)&&n.removeTrack(n.getVideoTracks()[0]);var u=null===(i=null===(r=this.audioProcess)||void 0===r?void 0:r.getOutput())||void 0===i?void 0:i.getAudioTracks();return!s&&(null==u?void 0:u.length)?n.addTrack(u[0]):s&&!(null==u?void 0:u.length)&&n.removeTrack(n.getAudioTracks()[0]),this.output=n,n},t.prototype.getRenderView=function(){var t;return null===(t=this.videoProcess)||void 0===t?void 0:t.getRenderView()},t.prototype.addVideoData=function(t){var e=this;if(this.videoProcess){var r=vc(t).call(t,(function(t){return"video"===t.type||"text"===t.type}));cc(r).call(r,(function(t){var r=t.id,i=t.order,n=void 0===i?0:i,o=t.items;cc(o).call(o,(function(t){var i=t.id,o=t.type,s=t.source,a=t.width,u=void 0===a?e.resolution.width:a,h=t.height,c=void 0===h?e.resolution.height:h,l=t.position,d=void 0===l?{}:l,f=t.content,p=void 0===f?{}:f,m=t.operations,v=void 0===m?[]:m,_=d.x,y=void 0===_?0:_,g=d.y,b=void 0===g?0:g,T=p.text,E=void 0===T?"":T,x=p.text_style,R=void 0===x?{}:x,S=r+"-"+i;if("video"===o||"image"===o){if(0===u||0===c)return;var A=s instanceof NP?s.getMediaStream():s;if(!A)return;e.videoProcess.addStream({id:S,width:u,height:c,x:y,y:b,order:n,source:A,operations:v})}else"text"===o&&e.videoProcess.addText({id:S,x:y,y:b,order:n,operations:v,content:E,style:R})}))}))}},t.prototype.removeVideoData=function(t){var e=this;if(this.videoProcess){var r=vc(t).call(t,(function(t){return"video"===t.type||"text"===t.type}));cc(r).call(r,(function(t){var r=t.id,i=t.items;cc(i).call(i,(function(t){var i=t.id,n=t.type,o=r+"-"+i;"video"===n||"image"===n?e.videoProcess.removeStream(o):"text"===n&&e.videoProcess.removeText(o)}))}))}},t.prototype.addAudioData=function(t){var e=this,r=vc(t).call(t,(function(t){return"video"===t.type||"audio"===t.type}));cc(r).call(r,(function(t){var r=t.id,i=t.items;cc(i).call(i,(function(t){var i=t.id,n=t.type,o=t.source,s=t.operations,a=void 0===s?[]:s;if("video"===n||"audio"===n){var u=o instanceof NP?o.getMediaStream():o;if(!u)return;e.audioProcess.addStream({id:r+"-"+i,source:u,operations:a})}}))}))},t.prototype.removeAudioData=function(t){var e=this,r=vc(t).call(t,(function(t){return"video"===t.type||"audio"===t.type}));cc(r).call(r,(function(t){var r=t.id,i=t.items;cc(i).call(i,(function(t){var i=t.id,n=t.type;"video"!==n&&"audio"!==n||e.audioProcess.removeStream(r+"-"+i)}))}))},t}();qf.disable();var Kz=qf("app"),qz=function(){function t(){var t,e,r;this.videoView=null,this.canvasView=null,this.videoQuality=id({},Qf["720p"]),this.audioQuality=id(id({},$f.standard),{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}),this.connectRetry={maxCount:3,curCount:0,delay:1,timeoutId:0},this.connection=null,this.isStreamPushing=!1,this.streamList=[],this.streamOutput=null,this.deviceManager=null,this.videoEffectManager=null,this.audioEffectManager=null,this.effectProcess=null,this.effectTrackList=[],this.observer={onError:null,onWarning:null,onCaptureFirstAudioFrame:null,onCaptureFirstVideoFrame:null,onPushStatusUpdate:null,onStatisticsUpdate:null},this.onConnectionStatusUpdate=Qh(t=this.onConnectionStatusUpdate).call(t,this),this.setProcessData=Qh(e=this.setProcessData).call(e,this),this.getCommonData=Qh(r=this.getCommonData).call(r,this),this.deviceManager=new DP({getCommonData:this.getCommonData}),this.videoEffectManager=new YP({getCommonData:this.getCommonData}),this.audioEffectManager=new zP({getCommonData:this.getCommonData})}return t.checkSupport=function(){return nd(void 0,void 0,void 0,(function(){var t;return od(this,(function(e){switch(e.label){case 0:return t={isWebRTCSupported:!(!window.RTCPeerConnection&&!window.webkitRTCPeerConnection)},[4,new VR((function(t){try{var e,r=new RTCPeerConnection({iceServers:[]});r.addEventListener("negotiationneeded",(function e(){r.createOffer().then((function(i){var n,o=Sl(n=i.sdp.toLowerCase()).call(n,"h264");r.removeEventListener("negotiationneeded",e),r.close(),t(o)}))}));var i=document.createElement("canvas");i.getContext("2d");var n=i.captureStream(0);cc(e=n.getTracks()).call(e,(function(t){r.addTrack(t,n)}))}catch(e){t(!1)}}))];case 1:return t.isH264EncodeSupported=e.sent(),[4,nd(void 0,void 0,void 0,(function(){var t,e,r,i;return od(this,(function(n){var o;switch(n.label){case 0:return n.trys.push([0,2,,3]),t=new RTCPeerConnection({iceServers:[],sdpSemantics:"unified-plan"}),e={},t.addTransceiver?(t.addTransceiver("audio",{direction:"recvonly"}),t.addTransceiver("video",{direction:"recvonly"})):e={offerToReceiveVideo:!0,offerToReceiveAudio:!0},[4,t.createOffer(e)];case 1:return r=n.sent(),i=Sl(o=r.sdp.toLowerCase()).call(o,"h264"),t.close(),[2,i];case 2:return n.sent(),[2,!1];case 3:return[2]}}))}))];case 2:return[2,(t.isH264DecodeSupported=e.sent(),t.isMediaDevicesSupported=JR(),t.isScreenCaptureSupported=QR(),t.isMediaFileSupported=!(!document.createElement("canvas").captureStream||!window.AudioContext&&!window.webkitAudioContext),t)]}}))}))},t.init=function(){var t=Uf.browserDetails,e=t.browser,r=t.version;Kz("browser is "+e+", version is "+r);var i=document.body;if(i)if(window.TXLiveAudioContext)Kz("TXLiveAudioContext is existed");else{var n=["touchstart","touchend","mouseup","click"],o=function t(){cc(n).call(n,(function(e){return i.removeEventListener(e,t,!1)}));var e=new(window.AudioContext||window.webkitAudioContext);bg(e),window.TXLiveAudioContext=e};cc(n).call(n,(function(t){return i.addEventListener(t,o,!1)}))}else Kz("document.body is not existed")},t.prototype.setRenderView=function(t){if(this.videoView)Kz("render view is existed");else{var e="string"==typeof t?document.getElementById(t):t;e&&e instanceof HTMLDivElement?this.videoView=Eg({parentEl:e,style:Jf,crossOrigin:!1,loop:!1}):Kz("require container element id or HTMLDivElement")}},t.prototype.setVideoQuality=function(t){Qf[t]?this.videoQuality=id(id({},this.videoQuality),Qf[t]):Kz("video quality "+t+" is not existed")},t.prototype.setAudioQuality=function(t){$f[t]?this.audioQuality=id(id({},this.audioQuality),$f[t]):Kz("audio quality "+t+" is not existed")},t.prototype.setProperty=function(t,e){var r,i;switch(t){case"setVideoResolution":"object"===Nh(e)&&"number"==typeof e.width&&"number"==typeof e.height&&e.width>0&&e.height>0?(this.videoQuality.width=e.width,this.videoQuality.height=e.height):Kz("videoResolution width and height must be a number greater than 0");break;case"setVideoFPS":"number"==typeof e&&e>0?this.videoQuality.frameRate=e:Kz("videoFPS must be a number greater than 0");break;case"setVideoBitrate":"number"==typeof e&&e>0?(this.videoQuality.bitrate=e,null===(r=this.connection)||void 0===r||r.setVideoBitrate(e)):Kz("videoBitrate must be a number greater than 0");break;case"setAudioSampleRate":"number"==typeof e&&e>0?this.audioQuality.sampleRate=e:Kz("audioSampleRate must be a number greater than 0");break;case"setAudioBitrate":"number"==typeof e&&e>0?(this.audioQuality.bitrate=e,null===(i=this.connection)||void 0===i||i.setAudioBitrate(e)):Kz("audioBitrate must be a number greater than 0");break;case"enableAudioAEC":this.audioQuality.echoCancellation=!!e;break;case"enableAudioAGC":this.audioQuality.autoGainControl=!!e;break;case"enableAudioANS":this.audioQuality.noiseSuppression=!!e;break;case"setConnectRetryCount":"number"==typeof e&&e>=0&&e<=10?this.connectRetry.maxCount=e:Kz("connectRetryCount must be a number between 0 and 10");break;case"setConnectRetryDelay":"number"==typeof e&&e>=0&&e<=10?this.connectRetry.delay=e:Kz("connectRetryDelay must be a number between 0 and 10");break;case"enableLog":e?qf.enable("*"):qf.disable();break;default:Kz(t+" is not existed")}},t.prototype.startCamera=function(t){var e,r,i;return nd(this,void 0,void 0,(function(){var n,o,s,a,u,h,c,l,d,f=this;return od(this,(function(p){switch(p.label){case 0:if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw Kz("stream is pushing, please stop pushing first"),new Error("stream is pushing");if((null===(e=this.streamOutput)||void 0===e?void 0:e.getVideoTracks().length)>0)throw Kz("video track is existed"),new Error("video track is existed")}n=Ff(),o=new NP({type:"device",video:!0,audio:!1,onEvent:function(t){var e,r,i;t.type===pp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(i=(r=f.observer).onWarning)||void 0===i||i.call(r,Zf.TXLIVE_WARNING_CAMERA_INTERRUPTED,"interrupted",{streamId:n}))}}),s=this.videoQuality,a=s.frameRate,u=s.width,h=s.height,o.setVideoConfig({deviceId:t||"",frameRate:a,resolution:{width:u,height:h}}),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,o.start()];case 2:return c=p.sent(),l=jP("video",o),this.initTrackData(l,c),this.streamList.push({id:n,type:"camera",source:o,track:l}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,n];case 3:throw d=p.sent(),null===(i=(r=this.observer).onWarning)||void 0===i||i.call(r,Zf.TXLIVE_WARNING_CAMERA_START_FAILED,d.toString(),null),d;case 4:return[2]}}))}))},t.prototype.stopCamera=function(t){var e,r,i;if(this.videoEffectManager.enabled||!this.isStreamPushing){var n=vc(e=this.streamList).call(e,(function(e){return"camera"===e.type&&(void 0===t||e.id===t)}));if(0!==n.length){var o=function(t,e){var r;e instanceof NP&&e.stop();var i,n=Sc(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==n&&Vc(i=s.streamList).call(i,n,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay()},s=this;try{for(var a=sd(n),u=a.next();!u.done;u=a.next()){var h=u.value;o(h.id,h.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}else Kz("camera stream is not existed")}else Kz("stream is pushing, please stop pushing first")},t.prototype.startMicrophone=function(t){var e,r,i;return nd(this,void 0,void 0,(function(){var n,o,s,a,u,h,c,l,d,f,p=this;return od(this,(function(m){switch(m.label){case 0:if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw Kz("stream is pushing, please stop pushing first"),new Error("stream is pushing");if((null===(e=this.streamOutput)||void 0===e?void 0:e.getAudioTracks().length)>0)throw Kz("audio track is existed"),new Error("audio track is existed")}n=Ff(),o=new NP({type:"device",video:!1,audio:!0,onEvent:function(t){var e,r,i;t.type===pp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(i=(r=p.observer).onWarning)||void 0===i||i.call(r,Zf.TXLIVE_WARNING_MICROPHONE_INTERRUPTED,"interrupted",{streamId:n}))}}),s=this.audioQuality,a=s.sampleRate,u=s.echoCancellation,h=s.noiseSuppression,c=s.autoGainControl,o.setAudioConfig({deviceId:t||"",sampleRate:a,echoCancellation:u,noiseSuppression:h,autoGainControl:c}),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,o.start()];case 2:return l=m.sent(),d=jP("audio",o),this.initTrackData(d,l),this.streamList.push({id:n,type:"microphone",source:o,track:d}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,n];case 3:throw f=m.sent(),null===(i=(r=this.observer).onWarning)||void 0===i||i.call(r,Zf.TXLIVE_WARNING_MICROPHONE_START_FAILED,f.toString(),null),f;case 4:return[2]}}))}))},t.prototype.stopMicrophone=function(t){var e,r,i;if(this.videoEffectManager.enabled||!this.isStreamPushing){var n=vc(e=this.streamList).call(e,(function(e){return"microphone"===e.type&&(void 0===t||e.id===t)}));if(0!==n.length){var o=function(t,e){var r;e instanceof NP&&e.stop();var i,n=Sc(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==n&&Vc(i=s.streamList).call(i,n,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay()},s=this;try{for(var a=sd(n),u=a.next();!u.done;u=a.next()){var h=u.value;o(h.id,h.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}else Kz("microphone stream is not existed")}else Kz("stream is pushing, please stop pushing first")},t.prototype.startScreenCapture=function(t){var e,r,i,n;return void 0===t&&(t=!1),nd(this,void 0,void 0,(function(){var o,s,a,u,h,c,l,d,f,p,m,v,_,y,g=this;return od(this,(function(b){switch(b.label){case 0:if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw Kz("stream is pushing, please stop pushing first"),new Error("stream is pushing");if((null===(e=this.streamOutput)||void 0===e?void 0:e.getVideoTracks().length)>0)throw Kz("video track is existed"),new Error("video track is existed");if(t&&(null===(r=this.streamOutput)||void 0===r?void 0:r.getAudioTracks().length)>0)throw Kz("audio track is existed"),new Error("audio track is existed")}o=Ff(),s=new NP({type:"screen",video:!0,audio:t,onEvent:function(t){var e,r,i;t.type===pp&&"stream ended"===(null===(e=t.data)||void 0===e?void 0:e.message)&&(null===(i=(r=g.observer).onWarning)||void 0===i||i.call(r,Zf.TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED,"interrupted",{streamId:o}))}}),a=this.videoQuality,u=a.frameRate,h=a.width,c=a.height,s.setVideoConfig({frameRate:u,resolution:{width:h,height:c}}),t&&(l=this.audioQuality,d=l.sampleRate,f=l.echoCancellation,p=l.noiseSuppression,m=l.autoGainControl,s.setAudioConfig({sampleRate:d,echoCancellation:f,noiseSuppression:p,autoGainControl:m})),b.label=1;case 1:return b.trys.push([1,3,,4]),[4,s.start()];case 2:return v=b.sent(),_=jP("video",s),this.initTrackData(_,v),this.streamList.push({id:o,type:"screen",source:s,track:_}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,o];case 3:throw y=b.sent(),null===(n=(i=this.observer).onWarning)||void 0===n||n.call(i,Zf.TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED,y.toString(),null),y;case 4:return[2]}}))}))},t.prototype.stopScreenCapture=function(t){var e,r,i;if(this.videoEffectManager.enabled||!this.isStreamPushing){var n=vc(e=this.streamList).call(e,(function(e){return"screen"===e.type&&(void 0===t||e.id===t)}));if(0!==n.length){var o=function(t,e){var r;e instanceof NP&&e.stop();var i,n=Sc(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==n&&Vc(i=s.streamList).call(i,n,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay()},s=this;try{for(var a=sd(n),u=a.next();!u.done;u=a.next()){var h=u.value;o(h.id,h.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}else Kz("screen stream is not existed")}else Kz("stream is pushing, please stop pushing first")},t.prototype.startVirtualCamera=function(t){var e,r,i,n;return nd(this,void 0,void 0,(function(){var o,s,a,u,h,c,l,d,f,p;return od(this,(function(m){switch(m.label){case 0:if(!(t&&t instanceof File))throw Kz("file is invalid"),new Error("file is invalid");if(o=function(t){var e="";switch(t.type){case"video/mp4":e="video";break;case"audio/mpeg":e="audio";break;case"image/jpeg":case"image/png":case"image/bmp":e="image";break;default:e=""}return e}(t),!o)throw Kz("file type is invalid"),new Error("file type is invalid");if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw Kz("stream is pushing, please stop pushing first"),new Error("stream is pushing");if(("video"===o||"image"===o)&&(null===(e=this.streamOutput)||void 0===e?void 0:e.getVideoTracks().length)>0)throw Kz("video track is existed"),new Error("video track is existed");if(("video"===o||"audio"===o)&&(null===(r=this.streamOutput)||void 0===r?void 0:r.getAudioTracks().length)>0)throw Kz("audio track is existed"),new Error("audio track is existed")}s=Ff(),a=new NP({type:"file",video:"audio"!==o,audio:"image"!==o,fileSource:t}),u=this.videoQuality,h=u.frameRate,c=u.width,l=u.height,a.setVideoConfig({frameRate:h,resolution:{width:c,height:l}}),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,a.start()];case 2:return d=m.sent(),f=jP("audio"!==o?"video":"audio",a),this.initTrackData(f,d),this.streamList.push({id:s,type:"file",source:a,track:f}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,s];case 3:throw p=m.sent(),null===(n=(i=this.observer).onWarning)||void 0===n||n.call(i,Zf.TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED,p.toString(),null),p;case 4:return[2]}}))}))},t.prototype.stopVirtualCamera=function(t){var e,r,i;if(this.videoEffectManager.enabled||!this.isStreamPushing){var n=vc(e=this.streamList).call(e,(function(e){return"file"===e.type&&(void 0===t||e.id===t)}));if(0!==n.length){var o=function(t,e){var r;e instanceof NP&&e.stop();var i,n=Sc(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==n&&Vc(i=s.streamList).call(i,n,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay()},s=this;try{for(var a=sd(n),u=a.next();!u.done;u=a.next()){var h=u.value;o(h.id,h.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}else Kz("file stream is not existed")}else Kz("stream is pushing, please stop pushing first")},t.prototype.startMediaFile=function(t){return this.startVirtualCamera(t)},t.prototype.stopMediaFile=function(t){return this.stopVirtualCamera(t)},t.prototype.startCustomCapture=function(t){var e,r;return nd(this,void 0,void 0,(function(){var i,n,o,s;return od(this,(function(a){if(!(t&&t instanceof MediaStream))throw Kz("stream is invalid"),new Error("stream is invalid");if(i=t.getVideoTracks().length,n=t.getAudioTracks().length,0===i&&0===n)throw Kz("stream is empty"),new Error("stream is empty");if(i>1||n>1)throw Kz("the number of "+(i>1?"video":"audio")+" tracks is greater than 1"),new Error("the number of "+(i>1?"video":"audio")+" tracks is greater than 1");if(!this.videoEffectManager.enabled){if(this.isStreamPushing)throw Kz("stream is pushing, please stop pushing first"),new Error("stream is pushing");if(i>0&&(null===(e=this.streamOutput)||void 0===e?void 0:e.getVideoTracks().length)>0)throw Kz("video track is existed"),new Error("video track is existed");if(n>0&&(null===(r=this.streamOutput)||void 0===r?void 0:r.getAudioTracks().length)>0)throw Kz("audio track is existed"),new Error("audio track is existed")}return o=Ff(),s=jP(i>0?"video":"audio",t),this.initTrackData(s,t),this.streamList.push({id:o,type:"custom",source:t,track:s}),this.videoEffectManager.enabled?this.startVideoProcess():this.startVideoPlay(),[2,o]}))}))},t.prototype.stopCustomCapture=function(t){var e,r,i;if(this.videoEffectManager.enabled||!this.isStreamPushing){var n=vc(e=this.streamList).call(e,(function(e){return"custom"===e.type&&(void 0===t||e.id===t)}));if(0!==n.length){var o=function(t,e){var r,i,n=Sc(r=s.streamList).call(r,(function(e){return e.id===t}));-1!==n&&Vc(i=s.streamList).call(i,n,1);s.videoEffectManager.enabled?s.updateVideoProcess():s.stopVideoPlay(e)},s=this;try{for(var a=sd(n),u=a.next();!u.done;u=a.next()){var h=u.value;o(h.id,h.source)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}else Kz("custom stream is not existed")}else Kz("stream is pushing, please stop pushing first")},t.prototype.startPush=function(t){var e,r;return nd(this,void 0,void 0,(function(){var i,n,o=this;return od(this,(function(s){switch(s.label){case 0:if(!t)throw Kz("push url is not existed"),new Error("push url is not existed");if(this.isStreamPushing)throw Kz("stream is pushing, please stop pushing first"),new Error("stream is pushing");if(!this.streamOutput)throw Kz("no stream for pushing"),new Error("no stream for pushing");this.connection||(this.connection=new nN({onStatusUpdate:this.onConnectionStatusUpdate,onStatisticsUpdate:function(t){var e,r,i,n,s=t;void 0===s.video.frameWidth&&(null===(e=o.videoView)||void 0===e?void 0:e.videoWidth)&&(s.video.frameWidth=o.videoView.videoWidth),void 0===s.video.frameHeight&&(null===(r=o.videoView)||void 0===r?void 0:r.videoHeight)&&(s.video.frameHeight=o.videoView.videoHeight),null===(n=(i=o.observer).onStatisticsUpdate)||void 0===n||n.call(i,s)}})),this.connection.setUrl(t),this.connection.setStreamSource(this.streamOutput),this.connection.setVideoBitrate(this.videoQuality.bitrate),this.connection.setAudioBitrate(this.audioQuality.bitrate),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.connection.start()];case 2:return s.sent(),[3,4];case 3:throw i=s.sent(),n="RequestError"===i.name?Zf.TXLIVE_ERROR_REQUEST_FAILED:Zf.TXLIVE_ERROR_WEBRTC_FAILED,null===(r=(e=this.observer).onError)||void 0===r||r.call(e,n,i.toString(),null),i;case 4:return[2]}}))}))},t.prototype.stopPush=function(){var t;this.isStreamPushing?(this.connectRetry.timeoutId&&(window.clearTimeout(this.connectRetry.timeoutId),this.connectRetry.timeoutId=null,this.connectRetry.curCount=0),null===(t=this.connection)||void 0===t||t.stop()):Kz("no stream is pushing")},t.prototype.isPushing=function(){return!(!this.streamOutput||!this.isStreamPushing)},t.prototype.getMediaStream=function(t){var e;if(!t)return Kz("streamId is not existed"),null;var r=$c(e=this.streamList).call(e,(function(e){return e.id===t}));return r?r.source instanceof NP?r.source.getMediaStream():r.source:(Kz("stream is not existed"),null)},t.prototype.getDeviceManager=function(){return this.deviceManager},t.prototype.getVideoEffectManager=function(){return this.videoEffectManager},t.prototype.getAudioEffectManager=function(){return this.audioEffectManager},t.prototype.setVideoMute=function(t){var e,r;null===(r=this.streamOutput)||void 0===r||cc(e=r.getVideoTracks()).call(e,(function(e){e.enabled=!t})),this.canvasView&&(t?this.canvasView.style.filter="brightness(0%)":this.canvasView.style.removeProperty("filter"))},t.prototype.setAudioMute=function(t){var e,r;null===(r=this.streamOutput)||void 0===r||cc(e=r.getAudioTracks()).call(e,(function(e){e.enabled=!t}))},t.prototype.pauseVideo=function(){this.setVideoMute(!0)},t.prototype.pauseAudio=function(){this.setAudioMute(!0)},t.prototype.resumeVideo=function(){this.setVideoMute(!1)},t.prototype.resumeAudio=function(){this.setAudioMute(!1)},t.prototype.setVideoContentHint=function(t){var e,r;null===(r=this.streamOutput)||void 0===r||cc(e=r.getVideoTracks()).call(e,(function(e){e.contentHint=t}))},t.prototype.setObserver=function(t){var e,r=this,i=rl(this.observer);cc(e=rl(t)).call(e,(function(e){var n=t[e];Sl(i).call(i,e)&&"function"==typeof n&&(r.observer[e]=n)}))},t.prototype.destroy=function(){var t,e;(this.connectRetry.timeoutId&&(window.clearTimeout(this.connectRetry.timeoutId),this.connectRetry.timeoutId=null),this.connection&&(this.connection.stop(),this.connection=null),this.effectProcess&&(this.effectProcess.stop(),this.effectProcess=null),this.streamList)&&(cc(t=this.streamList).call(t,(function(t){t.source instanceof NP&&t.source.stop()})),this.streamList=null);this.streamOutput&&(cc(e=this.streamOutput.getTracks()).call(e,(function(t){"ended"!==t.readyState&&t.stop()})),this.streamOutput=null);this.videoView&&(this.videoView.pause(),this.videoView.srcObject=null,this.videoView.load(),this.videoView.remove(),this.videoView=null),this.canvasView&&(this.canvasView.remove(),this.canvasView=null),this.observer=null,this.deviceManager=null,this.videoEffectManager=null},t.prototype.onConnectionStatusUpdate=function(t){var e,r,i,n,o,s,a,u=this;t.type===np?(this.isStreamPushing=!0,this.connectRetry.curCount=0,null===(r=(e=this.observer).onPushStatusUpdate)||void 0===r||r.call(e,Kf.TXLIVE_PUSH_STATUS_CONNECTED,"connected",null)):t.type===rp?(this.isStreamPushing=!1,"connection disconnected"===(null===(i=t.data)||void 0===i?void 0:i.message)?(this.connection.stop(),this.connectRetry.timeoutId&&(window.clearTimeout(this.connectRetry.timeoutId),this.connectRetry.timeoutId=null),this.connectRetry.timeoutId=Bl((function(){var t,e,r,i;u.connectRetry.curCount+=1;var n=u.connectRetry,o=n.curCount,s=n.maxCount;o<=s?(Kz("current retry count: "+o+", max retry count: "+s),null===(e=(t=u.observer).onPushStatusUpdate)||void 0===e||e.call(t,Kf.TXLIVE_PUSH_STATUS_RECONNECTING,"reconnecting",null),u.connection.start()):(null===(i=(r=u.observer).onPushStatusUpdate)||void 0===i||i.call(r,Kf.TXLIVE_PUSH_STATUS_DISCONNECTED,"disconnected",null),u.connectRetry.curCount=0,u.stopVideoProcess()),u.connectRetry.timeoutId=null}),1e3*this.connectRetry.delay)):(null===(o=(n=this.observer).onPushStatusUpdate)||void 0===o||o.call(n,Kf.TXLIVE_PUSH_STATUS_DISCONNECTED,"disconnected",null),this.stopVideoProcess())):t.type===ip&&(null===(a=(s=this.observer).onPushStatusUpdate)||void 0===a||a.call(s,Kf.TXLIVE_PUSH_STATUS_CONNECTING,"connecting",null))},t.prototype.initTrackData=function(t,e){if(e.getVideoTracks().length>0){var r,i=vc(r=this.streamList).call(r,(function(t){var e,r=t.source,i=r instanceof NP?r.getMediaStream():r;return null===(e=null==i?void 0:i.getVideoTracks())||void 0===e?void 0:e.length}));t.setOrder(i.length)}e.getAudioTracks().length>0&&t.setVolume(100)},t.prototype.setProcessData=function(){var t,e,r,i,n,o,s=null;this.videoEffectManager.enabled?s=Yl(e=ql(r=Yl(i=this.streamList).call(i,(function(t){return t.track}))).call(r,this.effectTrackList)).call(e,(function(t){return t.data})):s=Yl(n=vc(o=this.streamList).call(o,(function(t){var e,r=t.source,i=r instanceof NP?r.getMediaStream():r;return null===(e=null==i?void 0:i.getAudioTracks())||void 0===e?void 0:e.length}))).call(n,(function(t){return t.track.data}));null===(t=this.effectProcess)||void 0===t||t.setData(s)},t.prototype.startVideoPlay=function(){var t,e,r,i,n;return nd(this,void 0,void 0,(function(){var o,s,a,u,h,c,l,d;return od(this,(function(f){switch(f.label){case 0:return this.streamOutput||(this.streamOutput=new MediaStream),this.effectProcess||(this.effectProcess=new Zz),o=this.streamList[this.streamList.length-1],s=o.source,a=s instanceof NP?s.getMediaStream():s,u=null,a.getAudioTracks().length>0?(this.setProcessData(),this.effectProcess.isStart()?[3,2]:(this.effectProcess.setResolution({width:0,height:0}),[4,this.effectProcess.start()])):[3,3];case 1:f.sent(),f.label=2;case 2:u=this.effectProcess.getOutput(),f.label=3;case 3:if(h=a.getVideoTracks(),0===this.streamOutput.getVideoTracks().length&&h.length>0&&(this.streamOutput.addTrack(h[0]),null===(e=(t=this.observer).onCaptureFirstVideoFrame)||void 0===e||e.call(t)),c=null==u?void 0:u.getAudioTracks(),0===this.streamOutput.getAudioTracks().length&&(null==c?void 0:c.length)>0&&(this.streamOutput.addTrack(c[0]),null===(i=(r=this.observer).onCaptureFirstAudioFrame)||void 0===i||i.call(r)),!this.videoView)return[2];if(this.canvasView||(l=qR&&s instanceof NP?s.getRenderView():null)&&(l.setAttribute("style",Jf),this.canvasView=l,this.videoView.setAttribute("style",""+Jf+gg),null===(n=this.videoView.parentElement)||void 0===n||n.insertBefore(l,this.videoView)),this.videoView.srcObject)return[2];if(this.videoView.srcObject=this.streamOutput,this.videoView.load(),!this.videoView.autoplay)return[2];f.label=4;case 4:return f.trys.push([4,6,,7]),[4,this.videoView.play()];case 5:return f.sent(),Kz("play ok"),[3,7];case 6:return d=f.sent(),Kz("play failed",d),[3,7];case 7:return[2]}}))}))},t.prototype.stopVideoPlay=function(t){var e,r,i=this;if(this.streamOutput){var n,o=null===(e=this.effectProcess)||void 0===e?void 0:e.getOutput();if(null===(r=null==o?void 0:o.getAudioTracks())||void 0===r?void 0:r.length)rd(n=this.streamList).call(n,(function(e){var r=e.source;return r instanceof NP?!r.getAudioTrack():r===t}))&&(this.streamOutput.removeTrack(o.getAudioTracks()[0]),this.effectProcess.stop());var s,a=this.streamOutput.getTracks();if(cc(a).call(a,(function(t){"ended"===t.readyState&&i.streamOutput.removeTrack(t)})),t&&t instanceof MediaStream)cc(s=t.getTracks()).call(s,(function(t){i.streamOutput.removeTrack(t)}));this.canvasView&&0===this.streamOutput.getVideoTracks().length&&(this.canvasView.remove(),this.canvasView=null,this.videoView.setAttribute("style",Jf)),this.streamOutput.getTracks().length>0||(this.streamOutput=null,this.videoView&&(this.videoView.pause(),this.videoView.srcObject=null,this.videoView.load()))}},t.prototype.startVideoProcess=function(){var t,e,r,i,n,o,s;return nd(this,void 0,void 0,(function(){var a,u,h,c,l,d,f,p,m,v,_,y,g,b,T,E,x,R,S;return od(this,(function(A){switch(A.label){case 0:var I;if(this.streamOutput||(this.streamOutput=new MediaStream),this.effectProcess||(this.effectProcess=new Zz),a=this.videoEffectManager.getMixingConfig(),u=a.videoWidth,h=a.videoHeight,c=a.videoFramerate,l=a.backgroundColor,d=this.streamList[this.streamList.length-1],f=d.source,p=f instanceof NP?f.getMediaStream():f,null===(t=null==p?void 0:p.getVideoTracks())||void 0===t?void 0:t.length)m=null!==(e=f instanceof NP?f.getResolution():p.getVideoTracks()[0].getSettings())&&void 0!==e?e:{},v=vc(I=this.streamList).call(I,(function(t){var e,r=t.source,i=r instanceof NP?r.getMediaStream():r;return null===(e=null==i?void 0:i.getVideoTracks())||void 0===e?void 0:e.length})),1===v.length?d.track.setLayout({width:u,height:h,x:u/2,y:h/2}):(_=m.width,y=m.height,g=null!=_?_:u,b=null!=y?y:h,d.track.setLayout({width:g/2,height:b/2,x:g/4,y:b/4}));return this.setProcessData(),this.effectProcess.isStart()?[3,2]:(this.effectProcess.setResolution({width:u,height:h}),this.effectProcess.setFrameRate(c),this.effectProcess.setBackgroundColor(l),[4,this.effectProcess.start()]);case 1:A.sent(),A.label=2;case 2:if(T=this.effectProcess.getOutput(),E=T.getVideoTracks(),0===this.streamOutput.getVideoTracks().length&&E.length>0&&(this.streamOutput.addTrack(E[0]),null===(i=(r=this.observer).onCaptureFirstVideoFrame)||void 0===i||i.call(r)),x=T.getAudioTracks(),0===this.streamOutput.getAudioTracks().length&&x.length>0&&(this.streamOutput.addTrack(x[0]),null===(o=(n=this.observer).onCaptureFirstAudioFrame)||void 0===o||o.call(n)),!this.videoView)return[2];if(this.canvasView||(R=qR?this.effectProcess.getRenderView():null)&&(R.setAttribute("style",Jf),this.canvasView=R,this.videoView.setAttribute("style",""+Jf+gg),null===(s=this.videoView.parentElement)||void 0===s||s.insertBefore(R,this.videoView)),this.videoView.srcObject)return[2];if(this.videoView.srcObject=this.streamOutput,this.videoView.load(),!this.videoView.autoplay)return[2];A.label=3;case 3:return A.trys.push([3,5,,6]),[4,this.videoView.play()];case 4:return A.sent(),Kz("play ok"),[3,6];case 5:return S=A.sent(),Kz("play failed",S),[3,6];case 6:return[2]}}))}))},t.prototype.updateVideoProcess=function(){0!==this.streamList.length||this.isStreamPushing?this.setProcessData():this.stopVideoProcess()},t.prototype.stopVideoProcess=function(){var t,e=this;if(this.videoEffectManager.enabled&&this.streamOutput&&0===this.streamList.length){var r,i=null===(t=this.effectProcess)||void 0===t?void 0:t.getOutput();if(i)cc(r=i.getTracks()).call(r,(function(t){e.streamOutput.removeTrack(t)})),this.effectProcess.stop();this.streamOutput=null,this.canvasView&&(this.canvasView.remove(),this.canvasView=null,this.videoView.setAttribute("style",Jf)),this.videoView&&(this.videoView.pause(),this.videoView.srcObject=null,this.videoView.load())}},t.prototype.getCommonData=function(){return{streamList:this.streamList,videoEffectManager:this.videoEffectManager,observer:this.observer,videoQuality:this.videoQuality,audioQuality:this.audioQuality,streamOutput:this.streamOutput,isStreamPushing:this.isStreamPushing,connection:this.connection,setProcessData:this.setProcessData,effectTrackList:this.effectTrackList,effectProcess:this.effectProcess}},t}();return qz.init(),qz}));
