/*! For license information please see 897.813ee1ea36bd1bd5e2d3.js.LICENSE.txt */ (self.webpackChunkcoinflip=self.webpackChunkcoinflip||[]).push([[897],{1924:(t,e,r)=>{"use strict";var i=r(210),s=r(5559),n=s(i("String.prototype.indexOf"));t.exports=function(t,e){var r=i(t,!!e);return"function"==typeof r&&n(t,".prototype.")>-1?s(r):r}},5559:(t,e,r)=>{"use strict";var i=r(8612),s=r(210),n=r(7771),o=s("%TypeError%"),a=s("%Function.prototype.apply%"),h=s("%Function.prototype.call%"),l=s("%Reflect.apply%",!0)||i.call(h,a),u=s("%Object.defineProperty%",!0),c=s("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){if("function"!=typeof t)throw new o("a function is required");var e=l(i,h,arguments);return n(e,1+c(0,t.length-(arguments.length-1)),!0)};var d=function(){return l(i,a,arguments)};u?u(t.exports,"apply",{value:d}):t.exports.apply=d},2296:(t,e,r)=>{"use strict";var i=r(1044)(),s=r(210),n=i&&s("%Object.defineProperty%",!0);if(n)try{n({},"a",{value:1})}catch(t){n=!1}var o=s("%SyntaxError%"),a=s("%TypeError%"),h=r(7296);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],c=!!h&&h(t,e);if(n)n(t,e,{configurable:null===l&&c?c.configurable:!l,enumerable:null===i&&c?c.enumerable:!i,value:r,writable:null===s&&c?c.writable:!s});else{if(!u&&(i||s||l))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9187:t=>{"use strict";function e(t,e,i){i=i||2;var n,o,a,h,c,d,p,m=e&&e.length,g=m?e[0]*i:t.length,y=r(t,0,g,i,!0),_=[];if(!y||y.next===y.prev)return _;if(m&&(y=function(t,e,i,s){var n,o,a,h=[];for(n=0,o=e.length;n80*i){n=a=t[0],o=h=t[1];for(var x=i;xa&&(a=c),d>h&&(h=d);p=0!==(p=Math.max(a-n,h-o))?32767/p:0}return s(y,_,i,n,o,p,0),_}function r(t,e,r,i,s){var n,o;if(s===I(t,e,r,i)>0)for(n=e;n=e;n-=i)o=E(n,t[n],t[n+1],o);return o&&y(o,o.next)&&(w(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!y(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(w(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function s(t,e,r,l,u,c,f){if(t){!f&&c&&function(t,e,r,i){var s=t;do{0===s.z&&(s.z=d(s.x,s.y,e,r,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,r,i,s,n,o,a,h,l=1;do{for(r=t,t=null,n=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(s=r,r=r.nextZ,a--):(s=i,i=i.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;r=i}n.nextZ=null,l*=2}while(o>1)}(s)}(t,l,u,c);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(p.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),w(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?s(t=a(i(t),e,r),e,r,l,u,c,2):2===f&&h(t,e,r,l,u,c):s(i(t),e,r,l,u,c,1);break}}}function n(t){var e=t.prev,r=t,i=t.next;if(g(e,r,i)>=0)return!1;for(var s=e.x,n=r.x,o=i.x,a=e.y,h=r.y,l=i.y,u=sn?s>o?s:o:n>o?n:o,f=a>h?a>l?a:l:h>l?h:l,m=i.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&p(s,a,n,h,o,l,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,r,i){var s=t.prev,n=t,o=t.next;if(g(s,n,o)>=0)return!1;for(var a=s.x,h=n.x,l=o.x,u=s.y,c=n.y,f=o.y,m=ah?a>l?a:l:h>l?h:l,x=u>c?u>f?u:f:c>f?c:f,b=d(m,y,e,r,i),v=d(_,x,e,r,i),T=t.prevZ,E=t.nextZ;T&&T.z>=b&&E&&E.z<=v;){if(T.x>=m&&T.x<=_&&T.y>=y&&T.y<=x&&T!==s&&T!==o&&p(a,u,h,c,l,f,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;if(T=T.prevZ,E.x>=m&&E.x<=_&&E.y>=y&&E.y<=x&&E!==s&&E!==o&&p(a,u,h,c,l,f,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(;T&&T.z>=b;){if(T.x>=m&&T.x<=_&&T.y>=y&&T.y<=x&&T!==s&&T!==o&&p(a,u,h,c,l,f,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=v;){if(E.x>=m&&E.x<=_&&E.y>=y&&E.y<=x&&E!==s&&E!==o&&p(a,u,h,c,l,f,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function a(t,e,r){var s=t;do{var n=s.prev,o=s.next.next;!y(n,o)&&_(n,s,s.next,o)&&v(n,o)&&v(o,n)&&(e.push(n.i/r|0),e.push(s.i/r|0),e.push(o.i/r|0),w(s),w(s.next),s=t=o),s=s.next}while(s!==t);return i(s)}function h(t,e,r,n,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&m(h,l)){var u=T(h,l);return h=i(h,h.next),u=i(u,u.next),s(h,e,r,n,o,a,0),void s(u,e,r,n,o,a,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var r=function(t,e){var r,i=e,s=t.x,n=t.y,o=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){var a=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=s&&a>o&&(o=a,r=i.x=i.x&&i.x>=u&&s!==i.x&&p(nr.x||i.x===r.x&&c(r,i)))&&(r=i,f=h)),i=i.next}while(i!==l);return r}(t,e);if(!r)return e;var s=T(r,t);return i(s,s.next),i(r,r.next)}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,r,i,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,r=t;do{(e.x=(t-o)*(n-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(n-a)>=(s-o)*(i-a)}function m(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&&_(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(v(t,e)&&v(e,t)&&function(t,e){var r=t,i=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do{r.y>n!=r.next.y>n&&r.next.y!==r.y&&s<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||y(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,r,i){var s=b(g(t,e,r)),n=b(g(t,e,i)),o=b(g(r,i,t)),a=b(g(r,i,e));return s!==n&&o!==a||!(0!==s||!x(t,r,e))||!(0!==n||!x(t,i,e))||!(0!==o||!x(r,t,i))||!(0!==a||!x(r,e,i))}function x(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 b(t){return t>0?1:t<0?-1:0}function v(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function T(t,e){var r=new A(t.i,t.x,t.y),i=new A(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,r.next=s,s.prev=r,i.next=r,r.prev=i,n.next=i,i.prev=n,i}function E(t,e,r,i){var s=new A(t,e,r);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function w(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 A(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 I(t,e,r,i){for(var s=0,n=e,o=r-i;n0&&(i+=t[s-1].length,r.holes.push(i))}return r}},6729:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function i(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(t,e,i,n,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new s(i,n||t,o),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(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,s=[];if(0===this._eventsCount)return s;for(i in t=this._events)e.call(t,i)&&s.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},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 s=0,n=i.length,o=new Array(n);s{"use strict";var e=Object.prototype.toString,r=Math.max,i=function(t,e){for(var r=[],i=0;i{"use strict";var i=r(7648);t.exports=Function.prototype.bind||i},210:(t,e,r)=>{"use strict";var i,s=SyntaxError,n=Function,o=TypeError,a=function(t){try{return n('"use strict"; return ('+t+").constructor;")()}catch(t){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(t){h=null}var l=function(){throw new o},u=h?function(){try{return l}catch(t){try{return h(arguments,"callee").get}catch(t){return l}}}():l,c=r(1405)(),d=r(8185)(),f=Object.getPrototypeOf||(d?function(t){return t.__proto__}:null),p={},m="undefined"!=typeof Uint8Array&&f?f(Uint8Array):i,g={"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":c&&f?f([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":n,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c&&f?f(f([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c&&f?f((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c&&f?f((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c&&f?f(""[Symbol.iterator]()):i,"%Symbol%":c?Symbol:i,"%SyntaxError%":s,"%ThrowTypeError%":u,"%TypedArray%":m,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet};if(f)try{null.error}catch(t){var y=f(f(t));g["%Error.prototype%"]=y}var _=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var s=t("%AsyncGenerator%");s&&f&&(r=f(s.prototype))}return g[e]=r,r},x={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(8612),v=r(8824),T=b.call(Function.call,Array.prototype.concat),E=b.call(Function.apply,Array.prototype.splice),w=b.call(Function.call,String.prototype.replace),A=b.call(Function.call,String.prototype.slice),I=b.call(Function.call,RegExp.prototype.exec),R=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,C=function(t,e){var r,i=t;if(v(x,i)&&(i="%"+(r=x[i])[0]+"%"),v(g,i)){var n=g[i];if(n===p&&(n=_(i)),void 0===n&&!e)throw new o("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new s("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new o('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,t))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=A(t,0,1),r=A(t,-1);if("%"===e&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new s("invalid intrinsic syntax, expected opening `%`");var i=[];return w(t,R,(function(t,e,r,s){i[i.length]=r?w(s,S,"$1"):e||t})),i}(t),i=r.length>0?r[0]:"",n=C("%"+i+"%",e),a=n.name,l=n.value,u=!1,c=n.alias;c&&(i=c[0],E(r,T([0,1],c)));for(var d=1,f=!0;d=r.length){var _=h(l,p);l=(f=!!_)&&"get"in _&&!("originalValue"in _.get)?_.get:l[p]}else f=v(l,p),l=l[p];f&&!u&&(g[a]=l)}}return l}},7296:(t,e,r)=>{"use strict";var i=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(i)try{i([],"length")}catch(t){i=null}t.exports=i},1044:(t,e,r)=>{"use strict";var i=r(210)("%Object.defineProperty%",!0),s=function(){if(i)try{return i({},"a",{value:1}),!0}catch(t){return!1}return!1};s.hasArrayLengthDefineBug=function(){if(!s())return null;try{return 1!==i([],"length",{value:1}).length}catch(t){return!0}},t.exports=s},8185:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1405:(t,e,r)=>{"use strict";var i="undefined"!=typeof Symbol&&Symbol,s=r(5419);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&s()}},5419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(t,e);if(42!==s.value||!0!==s.enumerable)return!1}return!0}},8824:(t,e,r)=>{"use strict";var i=Function.prototype.call,s=Object.prototype.hasOwnProperty,n=r(8612);t.exports=n.call(i,s)},631:(t,e,r)=>{var i="function"==typeof Map&&Map.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=i&&s&&"function"==typeof s.get?s.get:null,o=i&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,h=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=a&&h&&"function"==typeof h.get?h.get:null,u=a&&Set.prototype.forEach,c="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,x=String.prototype.replace,b=String.prototype.toUpperCase,v=String.prototype.toLowerCase,T=RegExp.prototype.test,E=Array.prototype.concat,w=Array.prototype.join,A=Array.prototype.slice,I=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,M="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,O=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function F(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||T.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var i=t<0?-I(-t):I(t);if(i!==t){var s=String(i),n=_.call(e,s.length+1);return x.call(s,r,"$&_")+"."+x.call(x.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return x.call(e,r,"$&_")}var D=r(4654),B=D.custom,U=H(B)?B:null;function L(t,e,r){var i="double"===(r.quoteStyle||e)?'"':"'";return i+t+i}function k(t){return x.call(String(t),/"/g,""")}function G(t){return!("[object Array]"!==$(t)||P&&"object"==typeof t&&P in t)}function j(t){return!("[object RegExp]"!==$(t)||P&&"object"==typeof t&&P in t)}function H(t){if(M)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,i,s,a){var h=i||{};if(X(h,"quoteStyle")&&"single"!==h.quoteStyle&&"double"!==h.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(X(h,"maxStringLength")&&("number"==typeof h.maxStringLength?h.maxStringLength<0&&h.maxStringLength!==1/0:null!==h.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!X(h,"customInspect")||h.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(X(h,"indent")&&null!==h.indent&&"\t"!==h.indent&&!(parseInt(h.indent,10)===h.indent&&h.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(X(h,"numericSeparator")&&"boolean"!=typeof h.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var b=h.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return z(e,h);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var T=String(e);return b?F(e,T):T}if("bigint"==typeof e){var I=String(e)+"n";return b?F(e,I):I}var S=void 0===h.depth?5:h.depth;if(void 0===s&&(s=0),s>=S&&S>0&&"object"==typeof e)return G(e)?"[Array]":"[Object]";var B,V=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=w.call(Array(t.indent+1)," ")}return{base:r,prev:w.call(Array(e+1),r)}}(h,s);if(void 0===a)a=[];else if(W(a,e)>=0)return"[Circular]";function Y(e,r,i){if(r&&(a=A.call(a)).push(r),i){var n={depth:h.depth};return X(h,"quoteStyle")&&(n.quoteStyle=h.quoteStyle),t(e,n,s+1,a)}return t(e,h,s+1,a)}if("function"==typeof e&&!j(e)){var tt=function(t){if(t.name)return t.name;var e=y.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=J(e,Y);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+w.call(et,", ")+" }":"")}if(H(e)){var rt=M?x.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||M?rt:q(rt)}if((B=e)&&"object"==typeof B&&("undefined"!=typeof HTMLElement&&B instanceof HTMLElement||"string"==typeof B.nodeName&&"function"==typeof B.getAttribute)){for(var it="<"+v.call(String(e.nodeName)),st=e.attributes||[],nt=0;nt"}if(G(e)){if(0===e.length)return"[]";var ot=J(e,Y);return V&&!function(t){for(var e=0;e=0)return!1;return!0}(ot)?"["+Q(ot,V)+"]":"[ "+w.call(ot,", ")+" ]"}if(function(t){return!("[object Error]"!==$(t)||P&&"object"==typeof t&&P in t)}(e)){var at=J(e,Y);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+w.call(at,", ")+" }":"{ ["+String(e)+"] "+w.call(E.call("[cause]: "+Y(e.cause),at),", ")+" }"}if("object"==typeof e&&m){if(U&&"function"==typeof e[U]&&D)return D(e,{depth:S-s});if("symbol"!==m&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!n||!t||"object"!=typeof t)return!1;try{n.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ht=[];return o&&o.call(e,(function(t,r){ht.push(Y(r,e,!0)+" => "+Y(t,e))})),Z("Map",n.call(e),ht,V)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{n.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var lt=[];return u&&u.call(e,(function(t){lt.push(Y(t,e))})),Z("Set",l.call(e),lt,V)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t,c);try{d.call(t,d)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return K("WeakMap");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{d.call(t,d);try{c.call(t,c)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return K("WeakSet");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{return f.call(t),!0}catch(t){}return!1}(e))return K("WeakRef");if(function(t){return!("[object Number]"!==$(t)||P&&"object"==typeof t&&P in t)}(e))return q(Y(Number(e)));if(function(t){if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}(e))return q(Y(R.call(e)));if(function(t){return!("[object Boolean]"!==$(t)||P&&"object"==typeof t&&P in t)}(e))return q(p.call(e));if(function(t){return!("[object String]"!==$(t)||P&&"object"==typeof t&&P in t)}(e))return q(Y(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==$(t)||P&&"object"==typeof t&&P in t)}(e)&&!j(e)){var ut=J(e,Y),ct=O?O(e)===Object.prototype:e instanceof Object||e.constructor===Object,dt=e instanceof Object?"":"null prototype",ft=!ct&&P&&Object(e)===e&&P in e?_.call($(e),8,-1):dt?"Object":"",pt=(ct||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ft||dt?"["+w.call(E.call([],ft||[],dt||[]),": ")+"] ":"");return 0===ut.length?pt+"{}":V?pt+"{"+Q(ut,V)+"}":pt+"{ "+w.call(ut,", ")+" }"}return String(e)};var V=Object.prototype.hasOwnProperty||function(t){return t in this};function X(t,e){return V.call(t,e)}function $(t){return m.call(t)}function W(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return z(_.call(t,0,e.maxStringLength),e)+i}return L(x.call(x.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Y),"single",e)}function Y(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+b.call(e.toString(16))}function q(t){return"Object("+t+")"}function K(t){return t+" { ? }"}function Z(t,e,r,i){return t+" ("+e+") {"+(i?Q(r,i):w.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+w.call(t,","+r)+"\n"+e.prev}function J(t,e){var r=G(t),i=[];if(r){i.length=t.length;for(var s=0;s{"use strict";var i=r(210),s=r(2296),n=r(1044)(),o=r(7296),a=i("%TypeError%"),h=i("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||h(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,l=!0;if("length"in t&&o){var u=o(t,"length");u&&!u.configurable&&(i=!1),u&&!u.writable&&(l=!1)}return(i||l||!r)&&(n?s(t,"length",e,!0,!0):s(t,"length",e)),t}},7478:(t,e,r)=>{"use strict";var i=r(210),s=r(1924),n=r(631),o=i("%TypeError%"),a=i("%WeakMap%",!0),h=i("%Map%",!0),l=s("WeakMap.prototype.get",!0),u=s("WeakMap.prototype.set",!0),c=s("WeakMap.prototype.has",!0),d=s("Map.prototype.get",!0),f=s("Map.prototype.set",!0),p=s("Map.prototype.has",!0),m=function(t,e){for(var r,i=t;null!==(r=i.next);i=r)if(r.key===e)return i.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,i={assert:function(t){if(!i.has(t))throw new o("Side channel does not contain "+n(t))},get:function(i){if(a&&i&&("object"==typeof i||"function"==typeof i)){if(t)return l(t,i)}else if(h){if(e)return d(e,i)}else if(r)return function(t,e){var r=m(t,e);return r&&r.value}(r,i)},has:function(i){if(a&&i&&("object"==typeof i||"function"==typeof i)){if(t)return c(t,i)}else if(h){if(e)return p(e,i)}else if(r)return function(t,e){return!!m(t,e)}(r,i);return!1},set:function(i,s){a&&i&&("object"==typeof i||"function"==typeof i)?(t||(t=new a),u(t,i,s)):h?(e||(e=new h),f(e,i,s)):(r||(r={key:{},next:null}),function(t,e,r){var i=m(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}}(r,i,s))}};return i}},2511:function(t,e,r){var i;t=r.nmd(t),function(s){e&&e.nodeType,t&&t.nodeType;var n="object"==typeof r.g&&r.g;n.global!==n&&n.window!==n&&n.self;var o,a=2147483647,h=36,l=26,u=38,c=700,d=/^xn--/,f=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=h-1,y=Math.floor,_=String.fromCharCode;function x(t){throw new RangeError(m[t])}function b(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function v(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+b((t=t.replace(p,".")).split("."),e).join(".")}function T(t){for(var e,r,i=[],s=0,n=t.length;s=55296&&e<=56319&&s65535&&(e+=_((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+_(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,r){var i=0;for(t=r?y(t/c):t>>1,t+=y(t/e);t>g*l>>1;i+=h)t=y(t/g);return y(i+(g+1)*t/(t+u))}function I(t){var e,r,i,s,n,o,u,c,d,f,p,m=[],g=t.length,_=0,b=128,v=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&x("not-basic"),m.push(t.charCodeAt(i));for(s=r>0?r+1:0;s=g&&x("invalid-input"),((c=(p=t.charCodeAt(s++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:h)>=h||c>y((a-_)/o))&&x("overflow"),_+=c*o,!(c<(d=u<=v?1:u>=v+l?l:u-v));u+=h)o>y(a/(f=h-d))&&x("overflow"),o*=f;v=A(_-n,e=m.length+1,0==n),y(_/e)>a-b&&x("overflow"),b+=y(_/e),_%=e,m.splice(_++,0,b)}return E(m)}function R(t){var e,r,i,s,n,o,u,c,d,f,p,m,g,b,v,E=[];for(m=(t=T(t)).length,e=128,r=0,n=72,o=0;o=e&&py((a-r)/(g=i+1))&&x("overflow"),r+=(u-e)*g,e=u,o=0;oa&&x("overflow"),p==e){for(c=r,d=h;!(c<(f=d<=n?1:d>=n+l?l:d-n));d+=h)v=c-f,b=h-f,E.push(_(w(f+v%b,0))),c=y(v/b);E.push(_(w(c,0))),n=A(r,g,i==s),r=0,++i}++r,++e}return E.join("")}o={version:"1.4.1",ucs2:{decode:T,encode:E},decode:I,encode:R,toASCII:function(t){return v(t,(function(t){return f.test(t)?"xn--"+R(t):t}))},toUnicode:function(t){return v(t,(function(t){return d.test(t)?I(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return o}.call(e,r,e,t))||(t.exports=i)}()},9532:t=>{"use strict";var e=String.prototype.replace,r=/%20/g,i="RFC3986";t.exports={default:i,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:i}},5984:(t,e,r)=>{"use strict";var i=r(4730),s=r(7325),n=r(9532);t.exports={formats:n,parse:s,stringify:i}},7325:(t,e,r)=>{"use strict";var i=r(9368),s=Object.prototype.hasOwnProperty,n=Array.isArray,o={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:i.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},h=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},l=function(t,e,r,i){if(t){var n=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(n),l=a?n.slice(0,a.index):n,u=[];if(l){if(!r.plainObjects&&s.call(Object.prototype,l)&&!r.allowPrototypes)return;u.push(l)}for(var c=0;r.depth>0&&null!==(a=o.exec(n))&&c=0;--n){var o,a=t[n];if("[]"===a&&r.parseArrays)o=[].concat(s);else{o=r.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(l,10);r.parseArrays||""!==l?!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[])[u]=s:"__proto__"!==l&&(o[l]=s):o={0:s}}s=o}return s}(u,e,r,i)}};t.exports=function(t,e){var r=function(t){if(!t)return o;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?o.charset:t.charset;return{allowDots:void 0===t.allowDots?o.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:o.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:o.comma,decoder:"function"==typeof t.decoder?t.decoder:o.decoder,delimiter:"string"==typeof t.delimiter||i.isRegExp(t.delimiter)?t.delimiter:o.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:o.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof t?function(t,e){var r,l={__proto__:null},u=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,c=e.parameterLimit===1/0?void 0:e.parameterLimit,d=u.split(e.delimiter,c),f=-1,p=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(g=n(g)?[g]:g),s.call(l,m)?l[m]=i.combine(l[m],g):l[m]=g}return l}(t,r):t,c=r.plainObjects?Object.create(null):{},d=Object.keys(u),f=0;f{"use strict";var i=r(7478),s=r(9368),n=r(9532),o=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},h=Array.isArray,l=Array.prototype.push,u=function(t,e){l.apply(t,h(e)?e:[e])},c=Date.prototype.toISOString,d=n.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:s.encode,encodeValuesOnly:!1,format:d,formatter:n.formatters[d],indices:!1,serializeDate:function(t){return c.call(t)},skipNulls:!1,strictNullHandling:!1},p={},m=function t(e,r,n,o,a,l,c,d,m,g,y,_,x,b,v,T){for(var E,w=e,A=T,I=0,R=!1;void 0!==(A=A.get(p))&&!R;){var S=A.get(e);if(I+=1,void 0!==S){if(S===I)throw new RangeError("Cyclic object value");R=!0}void 0===A.get(p)&&(I=0)}if("function"==typeof d?w=d(r,w):w instanceof Date?w=y(w):"comma"===n&&h(w)&&(w=s.maybeMap(w,(function(t){return t instanceof Date?y(t):t}))),null===w){if(a)return c&&!b?c(r,f.encoder,v,"key",_):r;w=""}if("string"==typeof(E=w)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||s.isBuffer(w))return c?[x(b?r:c(r,f.encoder,v,"key",_))+"="+x(c(w,f.encoder,v,"value",_))]:[x(r)+"="+x(String(w))];var C,M=[];if(void 0===w)return M;if("comma"===n&&h(w))b&&c&&(w=s.maybeMap(w,c)),C=[{value:w.length>0?w.join(",")||null:void 0}];else if(h(d))C=d;else{var P=Object.keys(w);C=m?P.sort(m):P}for(var N=o&&h(w)&&1===w.length?r+"[]":r,O=0;O0?v+b:""}},9368:(t,e,r)=>{"use strict";var i=r(9532),s=Object.prototype.hasOwnProperty,n=Array.isArray,o=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),a=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},i=0;i1;){var e=t.pop(),r=e.obj[e.prop];if(n(r)){for(var i=[],s=0;s=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||n===i.RFC1738&&(40===u||41===u)?h+=a.charAt(l):u<128?h+=o[u]:u<2048?h+=o[192|u>>6]+o[128|63&u]:u<55296||u>=57344?h+=o[224|u>>12]+o[128|u>>6&63]+o[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&a.charCodeAt(l)),h+=o[240|u>>18]+o[128|u>>12&63]+o[128|u>>6&63]+o[128|63&u])}return h},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(n(t)){for(var r=[],i=0;i{"use strict";var i=r(2511);function s(){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 n=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,h=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(h),u=["%","/","?",";","#"].concat(l),c=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(5984);function _(t,e,r){if(t&&"object"==typeof t&&t instanceof s)return t;var i=new s;return i.parse(t,e,r),i}s.prototype.parse=function(t,e,r){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s=t.indexOf("?"),o=-1!==s&&s127?N+="x":N+=P[O];if(!N.match(d)){var D=C.slice(0,I),B=C.slice(I+1),U=P.match(f);U&&(D.push(U[1]),B.unshift(U[2])),B.length&&(_="/"+B.join(".")+_),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=i.toASCII(this.hostname));var L=this.port?":"+this.port:"",k=this.hostname||"";this.host=k+L,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!p[v])for(I=0,M=l.length;I0)&&r.host.split("@"))&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)),r.search=t.search,r.query=t.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var w=T.slice(-1)[0],A=(r.host||t.host||T.length>1)&&("."===w||".."===w)||""===w,I=0,R=T.length;R>=0;R--)"."===(w=T[R])?T.splice(R,1):".."===w?(T.splice(R,1),I++):I&&(T.splice(R,1),I--);if(!b&&!v)for(;I--;I)T.unshift("..");!b||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),A&&"/"!==T.join("/").substr(-1)&&T.push("");var S,C=""===T[0]||T[0]&&"/"===T[0].charAt(0);return E&&(r.hostname=C?"":T.length?T.shift():"",r.host=r.hostname,(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)),(b=b||r.host&&T.length)&&!C&&T.unshift(""),T.length>0?r.pathname=T.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===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},s.prototype.parseHost=function(){var t=this.host,e=o.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},e.Qc=_,e.DB=function(t,e){return _(t,!1,!0).resolve(e)},e.WU=function(t){return"string"==typeof t&&(t=_(t)),t instanceof s?t.format():s.prototype.format.call(t)}},7126:(t,e,r)=>{"use strict";r.d(e,{I:()=>P});var i={grad:.9,turn:360,rad:360/(2*Math.PI)},s=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},n=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},o=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},a=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},h=function(t){return{r:o(t.r,0,255),g:o(t.g,0,255),b:o(t.b,0,255),a:o(t.a)}},l=function(t){return{r:n(t.r),g:n(t.g),b:n(t.b),a:n(t.a,3)}},u=/^#([0-9a-f]{3,8})$/i,c=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},d=function(t){var e=t.r,r=t.g,i=t.b,s=t.a,n=Math.max(e,r,i),o=n-Math.min(e,r,i),a=o?n===e?(r-i)/o:n===r?2+(i-e)/o:4+(e-r)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}},f=function(t){var e=t.h,r=t.s,i=t.v,s=t.a;e=e/360*6,r/=100,i/=100;var n=Math.floor(e),o=i*(1-r),a=i*(1-(e-n)*r),h=i*(1-(1-e+n)*r),l=n%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:s}},p=function(t){return{h:a(t.h),s:o(t.s,0,100),l:o(t.l,0,100),a:o(t.a)}},m=function(t){return{h:n(t.h),s:n(t.s),l:n(t.l),a:n(t.a,3)}},g=function(t){return f((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},y=function(t){return{h:(e=d(t)).h,s:(s=(200-(r=e.s))*(i=e.v)/100)>0&&s<200?r*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,r,i,s},_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,x=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,T={string:[[function(t){var e=u.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?n(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?n(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=b.exec(t)||v.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:h({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=_.exec(t)||x.exec(t);if(!e)return null;var r,s,n=p({h:(r=e[1],s=e[2],void 0===s&&(s="deg"),Number(r)*(i[s]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return g(n)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,i=t.b,n=t.a,o=void 0===n?1:n;return s(e)&&s(r)&&s(i)?h({r:Number(e),g:Number(r),b:Number(i),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,r=t.s,i=t.l,n=t.a,o=void 0===n?1:n;if(!s(e)||!s(r)||!s(i))return null;var a=p({h:Number(e),s:Number(r),l:Number(i),a:Number(o)});return g(a)},"hsl"],[function(t){var e=t.h,r=t.s,i=t.v,n=t.a,h=void 0===n?1:n;if(!s(e)||!s(r)||!s(i))return null;var l=function(t){return{h:a(t.h),s:o(t.s,0,100),v:o(t.v,0,100),a:o(t.a)}}({h:Number(e),s:Number(r),v:Number(i),a:Number(h)});return f(l)},"hsv"]]},E=function(t,e){for(var r=0;r=.5},t.prototype.toHex=function(){return e=(t=l(this.rgba)).r,r=t.g,i=t.b,o=(s=t.a)<1?c(n(255*s)):"","#"+c(e)+c(r)+c(i)+o;var t,e,r,i,s,o},t.prototype.toRgb=function(){return l(this.rgba)},t.prototype.toRgbString=function(){return e=(t=l(this.rgba)).r,r=t.g,i=t.b,(s=t.a)<1?"rgba("+e+", "+r+", "+i+", "+s+")":"rgb("+e+", "+r+", "+i+")";var t,e,r,i,s},t.prototype.toHsl=function(){return m(y(this.rgba))},t.prototype.toHslString=function(){return e=(t=m(y(this.rgba))).h,r=t.s,i=t.l,(s=t.a)<1?"hsla("+e+", "+r+"%, "+i+"%, "+s+")":"hsl("+e+", "+r+"%, "+i+"%)";var t,e,r,i,s},t.prototype.toHsv=function(){return t=d(this.rgba),{h:n(t.h),s:n(t.s),v:n(t.v),a:n(t.a,3)};var t},t.prototype.invert=function(){return S({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),S(w(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),S(w(this.rgba,-t))},t.prototype.grayscale=function(){return S(w(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),S(I(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),S(I(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?S({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):n(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=y(this.rgba);return"number"==typeof t?S({h:t,s:e.s,l:e.l,a:e.a}):n(e.h)},t.prototype.isEqual=function(t){return this.toHex()===S(t).toHex()},t}(),S=function(t){return t instanceof R?t:new R(t)},C=[];!function(t){t.forEach((function(t){C.indexOf(t)<0&&(t(R,T),C.push(t))}))}([function(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var s in r)i[r[s]]=s;var n={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,o,a=i[this.toHex()];if(a)return a;if(null==e?void 0:e.closest){var h=this.toRgb(),l=1/0,u="black";if(!n.length)for(var c in r)n[c]=new t(r[c]).toRgb();for(var d in r){var f=(s=h,o=n[d],Math.pow(s.r-o.r,2)+Math.pow(s.g-o.g,2)+Math.pow(s.b-o.b,2));ft===e[r]));if(null!==t&&null!==e){const r=Object.keys(t),i=Object.keys(e);return r.length===i.length&&r.every((r=>t[r]===e[r]))}return t===e}toRgba(){const[t,e,r,i]=this._components;return{r:t,g:e,b:r,a:i}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,i]=this._components;return(t=t??[])[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*i),t}toRgbArray(t){t=t??[];const[e,r,i]=this._components;return t[0]=e,t[1]=r,t[2]=i,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(t){const[e,r,i,s]=M.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=r,this._components[2]*=i,this._components[3]*=s,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let r=this._int>>16&255,i=this._int>>8&255,s=255&this._int;return e&&(r=r*t+.5|0,i=i*t+.5|0,s=s*t+.5|0),(255*t<<24)+(r<<16)+(i<<8)+s}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,i]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,i,s]=this._components;return t[0]=e,t[1]=r,t[2]=i,t[3]=s,t}normalize(t){let e,r,i,s;if(("number"==typeof t||t instanceof Number)&&t>=0&&t<=16777215)e=(t>>16&255)/255,r=(t>>8&255)/255,i=(255&t)/255,s=1;else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,r,i,s=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,r,i,s=255]=t,e/=255,r/=255,i/=255,s/=255;else if("string"==typeof t||"object"==typeof t){if("string"==typeof t){const e=M.HEX_PATTERN.exec(t);e&&(t=`#${e[2]}`)}const n=S(t);n.isValid()&&(({r:e,g:r,b:i,a:s}=n.rgba),e/=255,r/=255,i/=255)}if(void 0===e)throw new Error(`Unable to convert color ${t}`);this._components[0]=e,this._components[1]=r,this._components[2]=i,this._components[3]=s,this.refreshInt()}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach(((i,s)=>{t[s]=Math.min(Math.max(i,e),r)})),t)}};let P=M;P.shared=new M,P.temp=new M,P.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i},7361:(t,e,r)=>{"use strict";r.d(e,{A7:()=>x,G5:()=>v,I2:()=>h,N3:()=>s,Nt:()=>f,T$:()=>o,UN:()=>y,V0:()=>n,V3:()=>b,Vi:()=>i,WB:()=>p,aH:()=>d,cB:()=>_,iw:()=>m,lg:()=>a,mr:()=>T,oT:()=>c,sp:()=>l,vK:()=>u,yl:()=>g});var i=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(i||{}),s=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(s||{}),n=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(n||{}),o=(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",t))(o||{}),a=(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",t))(a||{}),h=(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",t))(h||{}),l=(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",t))(l||{}),u=(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",t))(u||{}),c=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(c||{}),d=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(d||{}),f=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(f||{}),p=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(p||{}),m=(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.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(m||{}),g=(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",t))(g||{}),y=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(y||{}),_=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(_||{}),x=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(x||{}),b=(t=>(t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA",t))(b||{}),v=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(v||{}),T=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{})},6951:(t,e,r)=>{"use strict";r.d(e,{iw:()=>i.iw,M4:()=>Fe,$N:()=>De,ah:()=>w,T$:()=>i.T$,V0:()=>i.V0,mr:()=>i.mr,YP:()=>nt,bg:()=>dt,jd:()=>ct,VL:()=>b,a$:()=>v,JZ:()=>M,Bv:()=>rt,Zk:()=>Q,Sj:()=>ot,Ie:()=>J,ZQ:()=>s.ZQ,lW:()=>E,qm:()=>y,P:()=>Me,yl:()=>i.yl,V3:()=>i.V3,Y8:()=>Be,Cd:()=>P.Cd,Il:()=>o.I,lH:()=>ht,TA:()=>Le,ZX:()=>P.ZX,lg:()=>i.lg,Vi:()=>i.Vi,Pj:()=>P.Pj,nw:()=>a.n,I2:()=>i.I2,wn:()=>st,jV:()=>Tt,kV:()=>At,AI:()=>ut,WB:()=>St,UN:()=>i.UN,tT:()=>It,Ei:()=>Kt,fy:()=>xe,zV:()=>$t,wG:()=>C,TO:()=>Mt,W1:()=>qt,e_:()=>f,_w:()=>ke,PA:()=>ft,A7:()=>i.A7,KI:()=>i.WB,G5:()=>i.G5,HI:()=>Ft,zj:()=>Dt,y3:()=>P.y3,XR:()=>Se,bO:()=>tt,i0:()=>Pe,AB:()=>P.AB,_b:()=>P._b,cB:()=>i.cB,hN:()=>Ht,E9:()=>P.E9,mg:()=>P.mg,$r:()=>Y,NW:()=>Vt,lD:()=>bt,ud:()=>vt,jl:()=>P.jl,N3:()=>i.N3,Ae:()=>P.Ae,TI:()=>_t,uW:()=>xt,J$:()=>Yt,Th:()=>Oe,_z:()=>g,c9:()=>P.c9,RC:()=>m,oT:()=>i.oT,aH:()=>i.aH,HS:()=>P.HS,pX:()=>je,id:()=>Gt,ex:()=>Z,p:()=>de,z9:()=>Ot,fD:()=>fe,ZM:()=>d,zI:()=>me,Ld:()=>jt,Od:()=>ge,sp:()=>i.sp,vK:()=>i.vK,xE:()=>yt,wr:()=>_e,UX:()=>Nt,CT:()=>be,aF:()=>pt,vB:()=>Ee.vB,Sb:()=>Ee.Sb,wx:()=>P.wx,k7:()=>Xe,oR:()=>ve,uF:()=>Ee.uF,oo:()=>K,q4:()=>$e,eH:()=>Ve,ls:()=>Te,Rv:()=>h,Nt:()=>i.Nt,e6:()=>Ae,pb:()=>p,a7:()=>c,TF:()=>ne,Y9:()=>Re,kP:()=>Ie,Rw:()=>a.R,qw:()=>ee,K0:()=>ae,Kc:()=>L,DL:()=>oe,Lv:()=>P.Lv,tq:()=>s.tq,Xd:()=>s.Xd,sg:()=>N,O2:()=>le,P6:()=>n});var i=r(7361),s=r(6075),n=r(7441),o=r(7126),a=r(463);class h{constructor(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)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(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`)}}}const l=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function u(t){let e="";for(let r=0;r0&&(e+="\nelse "),r=0;--i){const s=f[i];if(s.test&&s.test(t,r))return new s(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class m{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,r,i,s,n,o,a){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:l}=this;this._aliasCount++;for(let u=0,c=l.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return 0===this.items.length}get name(){return this._name}}Object.defineProperties(m.prototype,{dispatch:{value:m.prototype.emit},run:{value:m.prototype.emit}});class g{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new m("setRealSize"),this.onUpdate=new m("update"),this.onError=new m("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,r){return!1}dispose(){}destroy(){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)}static test(t,e){return!1}}class y extends g{constructor(t,e){const{width:r,height:i}=e||{};if(!r||!i)throw new Error("BufferResource width or height invalid");super(r,i),this.data=t}upload(t,e,r){const s=t.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===i.iw.UNPACK);const n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?s.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,s.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0}dispose(){this.data=null}static test(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array}}const _={scaleMode:i.aH.NEAREST,format:i.I2.RGBA,alphaMode:i.iw.NPM},x=class extends n.EventEmitter{constructor(t=null,e=null){super(),e=Object.assign({},x.defaultOptions,e);const{alphaMode:r,mipmap:i,anisotropicLevel:o,scaleMode:a,width:h,height:l,wrapMode:u,format:c,type:d,target:f,resolution:m,resourceOptions:y}=e;!t||t instanceof g||((t=p(t,y)).internal=!0),this.resolution=m||s.Xd.RESOLUTION,this.width=Math.round((h||0)*this.resolution)/this.resolution,this.height=Math.round((l||0)*this.resolution)/this.resolution,this._mipmap=i,this.anisotropicLevel=o,this._wrapMode=u,this._scaleMode=a,this.format=c,this.type=d,this.target=f,this.alphaMode=r,this.uid=(0,n.uid)(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=h>0&&l>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let 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}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(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}_refreshPOT(){this.isPowerOfTwo=(0,n.isPow2)(this.realWidth)&&(0,n.isPow2)(this.realHeight)}setResolution(t){const 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}setResource(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}update(){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))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete n.BaseTextureCache[this.cacheId],delete n.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),x.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,r=s.Xd.STRICT_TEXTURE_CACHE){const i="string"==typeof t;let o=null;if(i)o=t;else{if(!t._pixiId){const r=e?.pixiIdPrefix||"pixiid";t._pixiId=`${r}_${(0,n.uid)()}`}o=t._pixiId}let a=n.BaseTextureCache[o];if(i&&r&&!a)throw new Error(`The cacheId "${o}" does not exist in BaseTextureCache.`);return a||(a=new x(t,e),a.cacheId=o,x.addToCache(a,o)),a}static fromBuffer(t,e,r,s){t=t||new Float32Array(e*r*4);const n=new y(t,{width:e,height:r}),o=t instanceof Float32Array?i.vK.FLOAT:i.vK.UNSIGNED_BYTE;return new x(n,Object.assign({},_,{type:o},s))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),n.BaseTextureCache[e]&&n.BaseTextureCache[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),n.BaseTextureCache[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=n.BaseTextureCache[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete n.BaseTextureCache[t],e}}else if(t?.textureCacheIds){for(let e=0;e1){for(let t=0;t"float"===t.type&&1===t.size&&!t.isArray,code:t=>`\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:(t,e)=>!("sampler2D"!==t.type&&"samplerCube"!==t.type&&"sampler2DArray"!==t.type||1!==t.size||t.isArray||null!=e&&void 0===e.castToBaseTexture),code:t=>`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:(t,e)=>"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a,code:t=>`\n gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));\n `,codeUbo:t=>`\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:(t,e)=>"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x,code:t=>`\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:t=>`\n v = uv.${t};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n `},{test:t=>"vec2"===t.type&&1===t.size&&!t.isArray,code:t=>`\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:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width,code:t=>`\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:t=>`\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:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n data[offset+3] = v.alpha;\n `},{test:(t,e)=>"vec3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n \n gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n `},{test:t=>"vec4"===t.type&&1===t.size&&!t.isArray,code:t=>`\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 }`}],O={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:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",samplerCube:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",sampler2DArray:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }"},F={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)"},D={};let B,U=D;function L(){if(U===D||U?.isContextLost()){const t=s.Xd.ADAPTER.createCanvas();let e;s.Xd.PREFER_ENV>=i.Vi.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),U=e}return U}const k={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 G(t){return k[t]}let j=null;const H={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 V(t,e){if(!j){const e=Object.keys(H);j={};for(let r=0;r0&&(e+="\nelse "),rthis.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)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,r=et._textureArrayPool,i=this.renderer.batch,s=this._tempBoundTextures,n=this.renderer.textureGC.count;let o=++b._globalBatch,a=0,h=r[0],l=0;i.copyBoundTextures(s,e);for(let u=0;u=e&&(i.boundArray(h,s,o,e),this.buildDrawCalls(h,l,u),l=u,h=r[++a],++o),c._batchEnabled=o,c.touched=n,h.elements[h.count++]=c)}h.count>0&&(i.boundArray(h,s,o,e),this.buildDrawCalls(h,l,this._bufferSize),++a,++o);for(let t=0;t0);for(let t=0;t=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)}boundArray(t,e,r,i){const{elements:s,ids:n,count:o}=t;let a=0;for(let t=0;t=0&&h=i.Vi.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),!r)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),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"),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")})}handleContextLost(t){t.preventDefault(),setTimeout((()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()}),0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,void 0!==t.removeEventListener&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const 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");const 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")}}ht.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},ht.extension={type:a.n.RendererSystem,name:"context"},a.R.add(ht);class lt extends y{upload(t,e,r){const s=t.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===i.iw.UNPACK);const n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?s.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,s.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0}}class ut{constructor(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 m("disposeFramebuffer"),this.multisample=i.G5.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new b(null,{scaleMode:i.aH.NEAREST,resolution:1,mipmap:i.WB.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new b(new lt(null,{width:this.width,height:this.height}),{scaleMode:i.aH.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.WB.OFF,format:i.I2.DEPTH_COMPONENT,type:i.vK.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(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(let r=0;r{const r=this.source;this.url=r.src;const i=()=>{this.destroyed||(r.onload=null,r.onerror=null,this.resize(r.width,r.height),this._load=null,this.createBitmap?t(this.process()):t(this))};r.complete&&r.src?i():(r.onload=i,r.onerror=t=>{e(t),this.onError.emit(t)})}))),this._load}process(){const t=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,r=!t.crossOrigin||"anonymous"===t.crossOrigin;return this._process=fetch(t.src,{mode:r?"cors":"no-cors"}).then((t=>t.blob())).then((r=>e(r,0,0,t.width,t.height,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===i.iw.UNPACK?"premultiply":"none"}))).then((t=>this.destroyed?Promise.reject():(this.bitmap=t,this.update(),this._process=null,Promise.resolve(this)))),this._process}upload(t,e,r){if("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,r,this.bitmap),!this.preserveBitmap){let t=!0;const i=e._glTextures;for(const s in i){const n=i[s];if(n!==r&&n.dirtyId!==e.dirtyId){t=!1;break}}t&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return"undefined"!=typeof HTMLImageElement&&("string"==typeof t||t instanceof HTMLImageElement)}}class pt{constructor(){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)}set(t,e,r){const i=e.width,s=e.height;if(r){const e=t.width/2/i,n=t.height/2/s,o=t.x/i+e,a=t.y/s+n;r=P.Lv.add(r,P.Lv.NW),this.x0=o+e*P.Lv.uX(r),this.y0=a+n*P.Lv.uY(r),r=P.Lv.add(r,2),this.x1=o+e*P.Lv.uX(r),this.y1=a+n*P.Lv.uY(r),r=P.Lv.add(r,2),this.x2=o+e*P.Lv.uX(r),this.y2=a+n*P.Lv.uY(r),r=P.Lv.add(r,2),this.x3=o+e*P.Lv.uX(r),this.y3=a+n*P.Lv.uY(r)}else this.x0=t.x/i,this.y0=t.y/s,this.x1=(t.x+t.width)/i,this.y1=t.y/s,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/s,this.x3=t.x/i,this.y3=(t.y+t.height)/s;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}toString(){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}]`}}const mt=new pt;function gt(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class yt extends n.EventEmitter{constructor(t,e,r,i,s,n,o){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new P.Ae(0,0,1,1)),t instanceof yt&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=i,this.valid=!1,this._uvs=mt,this.uvMatrix=null,this.orig=r||e,this._rotate=Number(s||0),!0===s)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=n?new P.E9(n.x,n.y):new P.E9(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(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)}destroy(t){if(this.baseTexture){if(t){const{resource:t}=this.baseTexture;t?.url&&n.TextureCache[t.url]&&yt.removeFromCache(t.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,yt.removeFromCache(this),this.textureCacheIds=null}clone(){const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),r=new yt(this.baseTexture,!this.noFrame&&t,e,this.trim?.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(r._frame=t),r}updateUvs(){this._uvs===mt&&(this._uvs=new pt),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},r=s.Xd.STRICT_TEXTURE_CACHE){const i="string"==typeof t;let o=null;if(i)o=t;else if(t instanceof b){if(!t.cacheId){const r=e?.pixiIdPrefix||"pixiid";t.cacheId=`${r}-${(0,n.uid)()}`,b.addToCache(t,t.cacheId)}o=t.cacheId}else{if(!t._pixiId){const r=e?.pixiIdPrefix||"pixiid";t._pixiId=`${r}_${(0,n.uid)()}`}o=t._pixiId}let a=n.TextureCache[o];if(i&&r&&!a)throw new Error(`The cacheId "${o}" does not exist in TextureCache.`);return a||t instanceof b?!a&&t instanceof b&&(a=new yt(t),yt.addToCache(a,o)):(e.resolution||(e.resolution=(0,n.getResolutionOfUrl)(t)),a=new yt(new b(t,e)),a.baseTexture.cacheId=o,b.addToCache(a.baseTexture,o),yt.addToCache(a,o)),a}static fromURL(t,e){const r=Object.assign({autoLoad:!1},e?.resourceOptions),i=yt.from(t,Object.assign({resourceOptions:r},e),!1),s=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):s.load().then((()=>Promise.resolve(i)))}static fromBuffer(t,e,r,i){return new yt(b.fromBuffer(t,e,r,i))}static fromLoader(t,e,r,i){const s=new b(t,Object.assign({scaleMode:b.defaultOptions.scaleMode,resolution:(0,n.getResolutionOfUrl)(e)},i)),{resource:o}=s;o instanceof ft&&(o.url=e);const a=new yt(s);return r||(r=e),b.addToCache(a.baseTexture,r),yt.addToCache(a,r),r!==e&&(b.addToCache(a.baseTexture,e),yt.addToCache(a,e)),a.baseTexture.valid?Promise.resolve(a):new Promise((t=>{a.baseTexture.once("loaded",(()=>t(a)))}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),n.TextureCache[e]&&n.TextureCache[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),n.TextureCache[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=n.TextureCache[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete n.TextureCache[t],e}}else if(t?.textureCacheIds){for(let e=0;ethis.baseTexture.width,o=r+s>this.baseTexture.height;if(n||o){const t=n&&o?"and":"or",a=`X: ${e} + ${i} = ${e+i} > ${this.baseTexture.width}`,h=`Y: ${r} + ${s} = ${r+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${a} ${t} ${h}`)}this.valid=i&&s&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return yt._EMPTY||(yt._EMPTY=new yt(new b),gt(yt._EMPTY),gt(yt._EMPTY.baseTexture)),yt._EMPTY}static get WHITE(){if(!yt._WHITE){const t=s.Xd.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),yt._WHITE=new yt(b.from(t)),gt(yt._WHITE),gt(yt._WHITE.baseTexture)}return yt._WHITE}}class _t extends yt{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,r=!0){const i=this.baseTexture.resolution,s=Math.round(t*i)/i,n=Math.round(e*i)/i;this.valid=s>0&&n>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=n,r&&this.baseTexture.resize(s,n),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new _t(new ct(t))}}class xt{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,r=i.G5.NONE){const s=new ct(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new _t(s)}getOptimalTexture(t,e,r=1,s=i.G5.NONE){let o;t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?o=s>1?-s:-1:(o=((65535&(t=(0,n.nextPow2)(t)))<<16|65535&(e=(0,n.nextPow2)(e)))>>>0,s>1&&(o+=4294967296*s)),this.texturePool[o]||(this.texturePool[o]=[]);let a=this.texturePool[o].pop();return a||(a=this.createTexture(t,e,s)),a.filterPoolKey=o,a.setResolution(r),a}getFilterTexture(t,e,r){const s=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||i.G5.NONE);return s.filterFrame=t.filterFrame,s}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=!1!==t)for(const t in this.texturePool){const e=this.texturePool[t];if(e)for(let t=0;t0&&t.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const e=this.texturePool[t];if(e)for(let t=0;t1&&(s=this.getOptimalFilterTexture(t.width,t.height,e.resolution),s.filterFrame=t.filterFrame),r[n].apply(this,t,s,i.yl.CLEAR,e);const o=t;t=s,s=o}r[n].apply(this,t,h.renderTexture,i.yl.BLEND,e),n>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(t),this.returnFilterTexture(s)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=i.yl.CLEAR){const{renderTexture:r,state:s}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t?.filterFrame){const e=this.tempRect;e.x=0,e.y=0,e.width=t.filterFrame.width,e.height=t.filterFrame.height,r.bind(t,t.filterFrame,e)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=1&s.stateId||this.forceClear;(e===i.yl.CLEAR||e===i.yl.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,r,s){const n=this.renderer;n.state.set(t.state),this.bindAndClear(r,s),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(i.lg.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(i.lg.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:r,destinationFrame:i}=this.activeState,{orig:s}=e._texture,n=t.set(i.width,0,0,i.height,r.x,r.y),o=e.worldTransform.copyTo(P.y3.TEMP_MATRIX);return o.invert(),n.prepend(o),n.scale(1/s.width,1/s.height),n.translate(e.anchor.x,e.anchor.y),n}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,r=1,s=i.G5.NONE){return this.texturePool.getOptimalTexture(t,e,r,s)}getFilterTexture(t,e,r){if("number"==typeof t){const r=t;t=e,e=r}t=t||this.activeState.renderTexture;const s=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||i.G5.NONE);return s.filterFrame=t.filterFrame,s}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const r=Et[0],i=Et[1],s=Et[2],n=Et[3];r.set(e.left,e.top),i.set(e.left,e.bottom),s.set(e.right,e.top),n.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(s,s),t.apply(n,n);const o=Math.min(r.x,i.x,s.x,n.x),a=Math.min(r.y,i.y,s.y,n.y),h=Math.max(r.x,i.x,s.x,n.x),l=Math.max(r.y,i.y,s.y,n.y);e.x=o,e.y=a,e.width=h-o,e.height=l-a}roundFrame(t,e,r,i,s){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(s){const{a:t,b:e,c:r,d:i}=s;if((Math.abs(e)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4))return}(s=s?wt.copyFrom(s):wt.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}}}At.extension={type:a.n.RendererSystem,name:"filter"},a.R.add(At);class It{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.G5.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Rt=new P.Ae;class St{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new ut(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new P.Ae,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){let e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;s.Xd.PREFER_ENV===i.Vi.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=t=>e.drawBuffersWEBGL(t):(this.hasMRT=!1,t.drawBuffers=()=>{}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,r=0){const{gl:i}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=r),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let e=0;e>r,i=e.height>>r,s=t/e.width;this.setViewport(e.x*s,e.y*s,t,i)}else{const e=t.width>>r,i=t.height>>r;this.setViewport(0,0,e,i)}}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)}setViewport(t,e,r,i){const s=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),s.width===r&&s.height===i&&s.x===t&&s.y===e||(s.x=t,s.y=e,s.width=r,s.height=i,this.gl.viewport(t,e,r,i))}get size(){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}}clear(t,e,r,s,n=i.V0.COLOR|i.V0.DEPTH){const{gl:o}=this;o.clearColor(t,e,r,s),o.clear(n)}initFramebuffer(t){const{gl:e}=this,r=new It(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r}resizeFramebuffer(t){const{gl:e}=this,r=t.glFramebuffers[this.CONTEXT_UID];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));const i=t.colorTextures;let s=i.length;e.drawBuffers||(s=Math.min(s,1));for(let n=0;n1&&this.canMultisampleFramebuffer(t)?i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer():i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const o=[];for(let a=0;a1&&r.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const i=t.depthTexture;this.renderer.texture.bind(i,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,i._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))}canMultisampleFramebuffer(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let r=i.G5.NONE;if(t<=1||null===e)return r;for(let i=0;i=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&this.disposeFramebuffer(r.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let r=0;re.createVertexArrayOES(),t.bindVertexArray=t=>e.bindVertexArrayOES(t),t.deleteVertexArray=t=>e.deleteVertexArrayOES(t)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(2!==e.webGLVersion){const e=t.getExtension("ANGLE_instanced_arrays");e?(t.vertexAttribDivisor=(t,r)=>e.vertexAttribDivisorANGLE(t,r),t.drawElementsInstanced=(t,r,i,s,n)=>e.drawElementsInstancedANGLE(t,r,i,s,n),t.drawArraysInstanced=(t,r,i,s)=>e.drawArraysInstancedANGLE(t,r,i,s)):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:r}=this;let i=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},s=!0);const n=i[e.program.id]||this.initGeometryVao(t,e,s);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?r.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let r=0;r0?this.maskStack[this.maskStack.length-1]._colorMask:15;r!==e&&this.renderer.gl.colorMask(0!=(1&r),0!=(2&r),0!=(4&r),0!=(8&r))}destroy(){this.renderer=null}}Dt.extension={type:a.n.RendererSystem,name:"mask"},a.R.add(Dt);class Bt{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,r=this.getStackLength();this.maskStack=t;const i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Ut=new P.y3,Lt=[],kt=class extends Bt{constructor(t){super(t),this.glConst=s.Xd.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:r}=t,{renderer:i}=this,s=i.renderTexture,n=r.getBounds(!0,Lt.pop()??new P.Ae);this.roundFrameToPixels(n,s.current?s.current.resolution:i.resolution,s.sourceFrame,s.destinationFrame,i.projection.transform),e&&n.fit(e),t._scissorRectLocal=n}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:i,d:s}=t;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(s)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect())return!1;if(kt.isMatrixRotated(e.worldTransform))return!1;if(kt.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const r=t._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(t,e,r,i,s){kt.isMatrixRotated(s)||((s=s?Ut.copyFrom(s):Ut.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(s,t),t.fit(i),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&Lt.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};let Gt=kt;Gt.extension={type:a.n.RendererSystem,name:"scissor"},a.R.add(Gt);class jt extends Bt{constructor(t){super(t),this.glConst=s.Xd.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:r}=this.renderer,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++;const s=t._colorMask;0!==s&&(t._colorMask=0,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,0!==s&&(t._colorMask=s,r.colorMask(0!=(1&s),0!=(2&s),0!=(4&s),0!=(8&s))),this._useCurrent()}pop(t){const e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{const r=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,i=r?r._colorMask:15;0!==i&&(r._colorMask=0,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,0!==i&&(r._colorMask=i,e.colorMask(0!=(1&i),0!=(2&i),0!=(4&i),0!=(8&i))),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}jt.extension={type:a.n.RendererSystem,name:"stencil"},a.R.add(jt);class Ht{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get:()=>((0,n.deprecation)("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract)},prepare:{enumerable:!1,get:()=>((0,n.deprecation)("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare)},interaction:{enumerable:!1,get:()=>((0,n.deprecation)("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events)}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}Ht.extension={type:[a.n.RendererSystem,a.n.CanvasRendererSystem],name:"_plugin"},a.R.add(Ht);class Vt{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new P.y3,this.transform=null}update(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);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,e,r,i){const s=this.projectionMatrix,n=i?-1:1;s.identity(),s.a=1/e.width*2,s.d=n*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-n-e.y*s.d}setTransform(t){}destroy(){this.renderer=null}}Vt.extension={type:a.n.RendererSystem,name:"projection"},a.R.add(Vt);const Xt=new P.wx;class $t{constructor(t){this.renderer=t,this._tempMatrix=new P.y3}generateTexture(t,e){const{region:r,...i}=e||{},s=r||t.getLocalBounds(null,!0);0===s.width&&(s.width=1),0===s.height&&(s.height=1);const n=_t.create({width:s.width,height:s.height,...i});this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const o=t.transform;return t.transform=Xt,this.renderer.render(t,{renderTexture:n,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=o,n}destroy(){}}$t.extension={type:[a.n.RendererSystem,a.n.CanvasRendererSystem],name:"textureGenerator"},a.R.add($t);const Wt=new P.Ae,zt=new P.Ae;class Yt{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new P.Ae,this.destinationFrame=new P.Ae,this.viewportFrame=new P.Ae}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,r){const i=this.renderer;let s,n,o;this.current=t,t?(s=t.baseTexture,o=s.resolution,e||(Wt.width=t.frame.width,Wt.height=t.frame.height,e=Wt),r||(zt.x=t.frame.x,zt.y=t.frame.y,zt.width=e.width,zt.height=e.height,r=zt),n=s.framebuffer):(o=i.resolution,e||(Wt.width=i._view.screen.width,Wt.height=i._view.screen.height,e=Wt),r||((r=Wt).width=e.width,r.height=e.height));const 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=i.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(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)}clear(t,e){const r=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=o.I.shared.setValue(t||r);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&i.premultiply(i.alpha);const s=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer._view.screen,a=s.width!==n.width||s.height!==n.height;if(a){let{x:t,y:e,width:r,height:i}=this.viewportFrame;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(t,e,r,i)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,e),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Yt.extension={type:a.n.RendererSystem,name:"renderTexture"},a.R.add(Yt);class qt{}class Kt{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Zt(t,e,r){const i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function Qt(t){const e=new Array(t);for(let t=0;t`${e}: ${t}`)),i=t.getShaderInfoLog(e),s=i.split("\n"),n={},o=s.map((t=>parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1")))).filter((t=>!(!t||n[t]||(n[t]=!0,0)))),a=[""];o.forEach((t=>{r[t-1]=`%c${r[t-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));const h=r.join("\n");a[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function ee(t,e){const r=Zt(t,t.VERTEX_SHADER,e.vertexSrc),i=Zt(t,t.FRAGMENT_SHADER,e.fragmentSrc),s=t.createProgram();t.attachShader(s,r),t.attachShader(s,i);const n=e.extra?.transformFeedbackVaryings;if(n&&("function"!=typeof t.transformFeedbackVaryings?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(s,n.names,"separate"===n.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||function(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||te(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||te(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,s,r,i),e.attributeData=function(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let s=0;st>e?1:-1));for(let i=0;i({data:t,offset:0,dataLen:0,dirty:0})));let r=0,i=0,s=0;for(let t=0;t1&&(r=Math.max(r,16)*n.data.size),n.dataLen=r,i%r!=0&&i<16){const t=i%r%16;i+=t,s+=t}i+r>16?(s=16*Math.ceil(s/16),n.offset=s,s+=r,i=r):(n.offset=s,i+=r,s+=r)}return s=16*Math.ceil(s/16),{uboElements:e,size:s}}function oe(t,e){const r=[];for(const i in t)e[i]&&r.push(e[i]);return r.sort(((t,e)=>t.index-e.index)),r}function ae(t,e){if(!t.autoManage)return{size:0,syncFunc:re};const r=oe(t.uniforms,e),{uboElements:i,size:s}=ne(r),n=["\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 "];for(let e=0;e1){const t=G(r.data.type),e=Math.max(se[r.data.type]/16,1),i=t/e,s=(4-i%4)%4;n.push(`\n cv = ud.${o}.value;\n v = uv.${o};\n offset = ${r.offset/4};\n\n t = 0;\n\n for(var i=0; i < ${r.data.size*e}; i++)\n {\n for(var j = 0; j < ${i}; j++)\n {\n data[offset++] = v[t++];\n }\n offset += ${s};\n }\n\n `)}else{const t=ie[r.data.type];n.push(`\n cv = ud.${o}.value;\n v = uv.${o};\n offset = ${r.offset/4};\n ${t};\n `)}}return n.push("\n renderer.buffer.update(buffer);\n "),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join("\n"))}}let he;function le(){if("boolean"==typeof he)return he;try{const t=new Function("param1","param2","param3","return param1[param2] === param3;");he=!0===t({a:"b"},"a","b")}catch(t){he=!1}return he}let ue=0;const ce={textureCount:0,uboCount:0};class de{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=ue++}systemCheck(){if(!le())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const 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||(ce.textureCount=0,ce.uboCount=0,this.syncUniformGroup(t.uniformGroup,ce)),i}setUniforms(t){const e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)}syncUniformGroup(t,e){const r=this.getGlProgram();t.static&&t.dirtyId===r.uniformDirtyGroups[t.id]||(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))}syncUniforms(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){const r=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(const i in t.uniforms){const s=e[i];if(!s){t.uniforms[i]?.group&&(t.uniforms[i].ubo?r.push(`\n renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');\n `):r.push(`\n renderer.shader.syncUniformGroup(uv.${i}, syncData);\n `));continue}const n=t.uniforms[i];let o=!1;for(let t=0;t>=1,r++;this.stateId=t.data}for(let e=0;et.systems[e])),r=[...e,...Object.keys(t.systems).filter((t=>!e.includes(t)))];for(const e of r)this.addSystem(t.systems[e],e)}addRunners(...t){t.forEach((t=>{this.runners[t]=new m(t)}))}addSystem(t,e){const r=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=r,this._systemsHash[e]=r;for(const t in this.runners)this.runners[t].add(r);return this}emitWithCustomOptions(t,e){const r=Object.keys(this._systemsHash);t.items.forEach((i=>{const s=r.find((t=>this._systemsHash[t]===i));i[t.name](e[s])}))}destroy(){Object.values(this.runners).forEach((t=>{t.destroy()})),this._systemsHash={}}}const ye=class{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=ye.defaultMaxIdle,this.checkCountMax=ye.defaultCheckCountMax,this.mode=ye.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==i.UN.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let i=0;ithis.maxIdle&&(t.destroyTexture(s,!0),e[i]=null,r=!0)}if(r){let t=0;for(let r=0;r=0;e--)this.unload(t.children[e])}destroy(){this.renderer=null}};let _e=ye;_e.defaultMode=i.UN.AUTO,_e.defaultMaxIdle=3600,_e.defaultCheckCountMax=600,_e.extension={type:a.n.RendererSystem,name:"textureGC"},a.R.add(_e);class xe{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.vK.UNSIGNED_BYTE,this.internalFormat=i.I2.RGBA,this.samplerType=0}}class be{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new b,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[i.vK.UNSIGNED_BYTE]:{[i.I2.RGBA]:t.RGBA8,[i.I2.RGB]:t.RGB8,[i.I2.RG]:t.RG8,[i.I2.RED]:t.R8,[i.I2.RGBA_INTEGER]:t.RGBA8UI,[i.I2.RGB_INTEGER]:t.RGB8UI,[i.I2.RG_INTEGER]:t.RG8UI,[i.I2.RED_INTEGER]:t.R8UI,[i.I2.ALPHA]:t.ALPHA,[i.I2.LUMINANCE]:t.LUMINANCE,[i.I2.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[i.vK.BYTE]:{[i.I2.RGBA]:t.RGBA8_SNORM,[i.I2.RGB]:t.RGB8_SNORM,[i.I2.RG]:t.RG8_SNORM,[i.I2.RED]:t.R8_SNORM,[i.I2.RGBA_INTEGER]:t.RGBA8I,[i.I2.RGB_INTEGER]:t.RGB8I,[i.I2.RG_INTEGER]:t.RG8I,[i.I2.RED_INTEGER]:t.R8I},[i.vK.UNSIGNED_SHORT]:{[i.I2.RGBA_INTEGER]:t.RGBA16UI,[i.I2.RGB_INTEGER]:t.RGB16UI,[i.I2.RG_INTEGER]:t.RG16UI,[i.I2.RED_INTEGER]:t.R16UI,[i.I2.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[i.vK.SHORT]:{[i.I2.RGBA_INTEGER]:t.RGBA16I,[i.I2.RGB_INTEGER]:t.RGB16I,[i.I2.RG_INTEGER]:t.RG16I,[i.I2.RED_INTEGER]:t.R16I},[i.vK.UNSIGNED_INT]:{[i.I2.RGBA_INTEGER]:t.RGBA32UI,[i.I2.RGB_INTEGER]:t.RGB32UI,[i.I2.RG_INTEGER]:t.RG32UI,[i.I2.RED_INTEGER]:t.R32UI,[i.I2.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[i.vK.INT]:{[i.I2.RGBA_INTEGER]:t.RGBA32I,[i.I2.RGB_INTEGER]:t.RGB32I,[i.I2.RG_INTEGER]:t.RG32I,[i.I2.RED_INTEGER]:t.R32I},[i.vK.FLOAT]:{[i.I2.RGBA]:t.RGBA32F,[i.I2.RGB]:t.RGB32F,[i.I2.RG]:t.RG32F,[i.I2.RED]:t.R32F,[i.I2.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[i.vK.HALF_FLOAT]:{[i.I2.RGBA]:t.RGBA16F,[i.I2.RGB]:t.RGB16F,[i.I2.RG]:t.RG16F,[i.I2.RED]:t.R16F},[i.vK.UNSIGNED_SHORT_5_6_5]:{[i.I2.RGB]:t.RGB565},[i.vK.UNSIGNED_SHORT_4_4_4_4]:{[i.I2.RGBA]:t.RGBA4},[i.vK.UNSIGNED_SHORT_5_5_5_1]:{[i.I2.RGBA]:t.RGB5_A1},[i.vK.UNSIGNED_INT_2_10_10_10_REV]:{[i.I2.RGBA]:t.RGB10_A2,[i.I2.RGBA_INTEGER]:t.RGB10_A2UI},[i.vK.UNSIGNED_INT_10F_11F_11F_REV]:{[i.I2.RGB]:t.R11F_G11F_B10F},[i.vK.UNSIGNED_INT_5_9_9_9_REV]:{[i.I2.RGB]:t.RGB9_E5},[i.vK.UNSIGNED_INT_24_8]:{[i.I2.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[i.vK.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[i.I2.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:{[i.vK.UNSIGNED_BYTE]:{[i.I2.RGBA]:t.RGBA,[i.I2.RGB]:t.RGB,[i.I2.ALPHA]:t.ALPHA,[i.I2.LUMINANCE]:t.LUMINANCE,[i.I2.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[i.vK.UNSIGNED_SHORT_5_6_5]:{[i.I2.RGB]:t.RGB},[i.vK.UNSIGNED_SHORT_4_4_4_4]:{[i.I2.RGBA]:t.RGBA},[i.vK.UNSIGNED_SHORT_5_5_5_1]:{[i.I2.RGBA]:t.RGBA}},e}(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let t=0;t=0;--r){const t=e[r];t&&t._glTextures[s].samplerType!==i.oT.FLOAT&&this.renderer.texture.unbind(t)}}initTexture(t){const e=new xe(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){e.internalFormat=this.internalFormats[t.type]?.[t.format]??t.format,2===this.webGLVersion&&t.type===i.vK.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const r=this.renderer;if(this.initTextureType(t,e),t.resource?.upload(r,t,e))e.samplerType!==i.oT.FLOAT&&(this.hasIntegerTextures=!0);else{const i=t.realWidth,s=t.realHeight,n=r.gl;(e.width!==i||e.height!==s||e.dirtyId<0)&&(e.width=i,e.height=s,n.texImage2D(t.target,0,e.internalFormat,i,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:r}=this;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)){const e=this.managedTextures.indexOf(t);-1!==e&&(0,n.removeItems)(this.managedTextures,e,1)}}updateTextureStyle(t){const e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==i.WB.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=i.Nt.CLAMP,t.resource?.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const r=this.gl;if(e.mipmap&&t.mipmap!==i.WB.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===i.aH.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);const e=this.renderer.context.extensions.anisotropicFiltering;if(e&&t.anisotropicLevel>0&&t.scaleMode===i.aH.LINEAR){const i=Math.min(t.anisotropicLevel,r.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===i.aH.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===i.aH.LINEAR?r.LINEAR:r.NEAREST)}destroy(){this.renderer=null}}be.extension={type:a.n.RendererSystem,name:"texture"},a.R.add(be);class ve{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glTransformFeedbacks[r]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:r,renderer:i}=this;e&&i.shader.bind(e),r.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:r,CONTEXT_UID:i}=this,s=e.createTransformFeedback();t._glTransformFeedbacks[i]=s,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,s);for(let s=0;sb.defaultOptions.wrapMode,set(t){(0,n.deprecation)("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),b.defaultOptions.wrapMode=t}},SCALE_MODE:{get:()=>b.defaultOptions.scaleMode,set(t){(0,n.deprecation)("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),b.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get:()=>b.defaultOptions.mipmap,set(t){(0,n.deprecation)("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),b.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get:()=>b.defaultOptions.anisotropicLevel,set(t){(0,n.deprecation)("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),b.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get:()=>((0,n.deprecation)("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),st.defaultResolution),set(t){st.defaultResolution=t}},FILTER_MULTISAMPLE:{get:()=>((0,n.deprecation)("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),st.defaultMultisample),set(t){st.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get:()=>rt.defaultMaxTextures,set(t){(0,n.deprecation)("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),rt.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get:()=>rt.defaultBatchSize,set(t){(0,n.deprecation)("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),rt.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get:()=>rt.canUploadSameBuffer,set(t){(0,n.deprecation)("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),rt.canUploadSameBuffer=t}},GC_MODE:{get:()=>_e.defaultMode,set(t){(0,n.deprecation)("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),_e.defaultMode=t}},GC_MAX_IDLE:{get:()=>_e.defaultMaxIdle,set(t){(0,n.deprecation)("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),_e.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get:()=>_e.defaultCheckCountMax,set(t){(0,n.deprecation)("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),_e.defaultCheckCountMax=t}},PRECISION_VERTEX:{get:()=>Y.defaultVertexPrecision,set(t){(0,n.deprecation)("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Y.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get:()=>Y.defaultFragmentPrecision,set(t){(0,n.deprecation)("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Y.defaultFragmentPrecision=t}}});var Ee=r(4116);const we=[];function Ae(t){for(const e of we)if(e.test(t))return new e(t);throw new Error("Unable to auto-detect a suitable renderer.")}a.R.handleByList(a.n.Renderer,we);const Ie="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}",Re="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";class Se{constructor(t){this.renderer=t}contextChange(t){let e;if(1===this.renderer.context.webGLVersion){const r=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,r)}else{const r=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,r)}e>=i.G5.HIGH?this.multisample=i.G5.HIGH:e>=i.G5.MEDIUM?this.multisample=i.G5.MEDIUM:e>=i.G5.LOW?this.multisample=i.G5.LOW:this.multisample=i.G5.NONE}destroy(){}}Se.extension={type:a.n.RendererSystem,name:"_multisample"},a.R.add(Se);class Ce{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Me{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:r,CONTEXT_UID:i}=this;if(this.boundBufferBases[e]!==t){const s=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,s.buffer)}}bindBufferRange(t,e,r){const{gl:i,CONTEXT_UID:s}=this;r=r||0;const n=t._glBuffers[s]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,n.buffer,256*r,256)}update(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glBuffers[r]||this.createGLBuffer(t);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{const r=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,r)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const 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])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let r=0;rt.resource)).filter((t=>t)).map((t=>t.load()));return this._load=Promise.all(t).then((()=>{const{realWidth:t,realHeight:e}=this.items[0];return this.resize(t,e),Promise.resolve(this)})),this._load}}class De extends Fe{constructor(t,e){const{width:r,height:i}=e||{};let s,n;Array.isArray(t)?(s=t,n=t.length):n=t,super(n,{width:r,height:i}),s&&this.initFromArray(s,e)}addBaseTextureAt(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this}bind(t){super.bind(t),t.target=i.sp.TEXTURE_2D_ARRAY}upload(t,e,r){const{length:i,itemDirtyIds:s,items:n}=this,{gl:o}=t;r.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,i,0,e.format,r.type,null);for(let t=0;t0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=i.sp.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}upload(t,e,r){const i=this.itemDirtyIds;for(let s=0;s{if(null!==this.url)try{const e=await s.Xd.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await e.blob();if(this.destroyed)return;const n=await createImageBitmap(r,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===i.iw.UNPACK?"premultiply":"none"});if(this.destroyed)return;this.source=n,this.update(),t(this)}catch(t){if(this.destroyed)return;e(t),this.onError.emit(t)}else t(this)}))),this._load}upload(t,e,r){return this.source instanceof ImageBitmap?("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),super.upload(t,e,r)):(this.load(),!1)}dispose(){this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&"undefined"!=typeof ImageBitmap&&("string"==typeof t||t instanceof ImageBitmap)}static get EMPTY(){return ke._EMPTY=ke._EMPTY??s.Xd.ADAPTER.createCanvas(0,0),ke._EMPTY}}const Ge=class extends dt{constructor(t,e){e=e||{},super(s.Xd.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((t=>{if(this._resolve=()=>{this.resize(this.source.width,this.source.height),t(this)},Ge.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}))),this._load}_loadSvg(){const t=new Image;dt.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=e*this.scale,s=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/r*e,s=this._overrideHeight||this._overrideWidth/e*r),i=Math.round(i),s=Math.round(s);const o=this.source;o.width=i,o.height=s,o._pixiId=`canvas_${(0,n.uid)()}`,o.getContext("2d").drawImage(t,0,0,e,r,0,0,i,s),this._resolve(),this._resolve=null}}static getSize(t){const e=Ge.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return"svg"===e||"string"==typeof t&&t.startsWith("data:image/svg+xml")||"string"==typeof t&&Ge.SVG_XML.test(t)}};let je=Ge;je.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;const He=class extends dt{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof t&&(t=[t]);const i=t[0].src||t[0];dt.crossOrigin(r,i,e.crossorigin);for(let e=0;e{this.valid?e(this):(this._resolve=e,t.load())})),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Ee.vB.shared.add(this.update,this),this._isConnectedToTicker=!0)}_onPlayStop(){this._isConnectedToTicker&&(Ee.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const 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()}dispose(){this._isConnectedToTicker&&(Ee.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1);const t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Ee.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Ee.vB.shared.add(this.update,this),this._isConnectedToTicker=!0))}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t)}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||He.TYPES.includes(e)}};let Ve=He;Ve.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ve.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},f.push(ke,ft,Be,Ve,je,y,Le,De);class Xe{constructor(){this._glTransformFeedbacks={},this.buffers=[],this.disposeRunner=new m("disposeTransformFeedback")}bindBuffer(t,e){this.buffers[t]=e}destroy(){this.disposeRunner.emit(this,!1)}}const $e="7.2.4"},8820:(t,e,r)=>{"use strict";r.d(e,{YZ:()=>s,W2:()=>u,s$:()=>n,Ql:()=>o});var i=r(6951);class s{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?i.Ae.EMPTY:((t=t||new i.Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(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)}addPointMatrix(t,e){const{a:r,b:i,c:s,d:n,tx:o,ty:a}=t,h=r*e.x+s*e.y+o,l=i*e.x+n*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)}addQuad(t){let e=this.minX,r=this.minY,i=this.maxX,s=this.maxY,n=t[0],o=t[1];e=ni?n:i,s=o>s?o:s,n=t[2],o=t[3],e=ni?n:i,s=o>s?o:s,n=t[4],o=t[5],e=ni?n:i,s=o>s?o:s,n=t[6],o=t[7],e=ni?n:i,s=o>s?o:s,this.minX=e,this.minY=r,this.maxX=i,this.maxY=s}addFrame(t,e,r,i,s){this.addFrameMatrix(t.worldTransform,e,r,i,s)}addFrameMatrix(t,e,r,i,s){const n=t.a,o=t.b,a=t.c,h=t.d,l=t.tx,u=t.ty;let c=this.minX,d=this.minY,f=this.maxX,p=this.maxY,m=n*e+a*r+l,g=o*e+h*r+u;c=mf?m:f,p=g>p?g:p,m=n*i+a*r+l,g=o*i+h*r+u,c=mf?m:f,p=g>p?g:p,m=n*e+a*s+l,g=o*e+h*s+u,c=mf?m:f,p=g>p?g:p,m=n*i+a*s+l,g=o*i+h*s+u,c=mf?m:f,p=g>p?g:p,this.minX=c,this.minY=d,this.maxX=f,this.maxY=p}addVertexData(t,e,r){let i=this.minX,s=this.minY,n=this.maxX,o=this.maxY;for(let a=e;an?e:n,o=r>o?r:o}this.minX=i,this.minY=s,this.maxX=n,this.maxY=o}addVertices(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)}addVerticesMatrix(t,e,r,i,s=0,n=s){const o=t.a,a=t.b,h=t.c,l=t.d,u=t.tx,c=t.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY;for(let t=r;ti?t.maxX:i,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,e){const r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,s=t.maxXo?s:o,this.maxY=n>a?n:a}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,s=t.maxXo?s:o,this.maxY=n>a?n:a}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,r,i,s,n){t-=s,e-=n,r+=s,i+=n,this.minX=this.minXr?this.maxX:r,this.minY=this.minYi?this.maxY:i}}class n extends i.P6.EventEmitter{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new i.wx,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new s,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let r=0;r1)for(let e=0;ethis.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}swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);i.P6.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e0&&i<=e){s=this.children.splice(r,i);for(let t=0;t1&&this.children.sort(h),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t0&&e.height>0))return;let r,i;this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==l.prototype._render&&(r=this.getBounds(!0));const s=t.projection.transform;if(s&&(i?(i=a.copyFrom(i),i.prepend(s)):i=s),r&&e.intersects(r,i))this._render(t);else if(this.cullArea)return;for(let e=0,r=this.children.length;eu.defaultSortableChildren,set(t){i.P6.deprecation("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),u.defaultSortableChildren=t}}})},463:(t,e,r)=>{"use strict";r.d(e,{R:()=>o,n:()=>i});var i=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(i||{});const s=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},n=(t,e)=>s(t).priority??e,o={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(s).forEach((t=>{t.type.forEach((e=>this._removeHandlers[e]?.(t)))})),this},add(...t){return t.map(s).forEach((t=>{t.type.forEach((e=>{const r=this._addHandlers,i=this._queue;r[e]?r[e](t):(i[e]=i[e]||[],i[e].push(t))}))})),this},handle(t,e,r){const i=this._addHandlers,s=this._removeHandlers;if(i[t]||s[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,s[t]=r;const n=this._queue;return n[t]&&(n[t].forEach((t=>e(t))),delete n[t]),this},handleByMap(t,e){return this.handle(t,(t=>{e[t.name]=t.ref}),(t=>{delete e[t.name]}))},handleByList(t,e,r=-1){return this.handle(t,(t=>{e.includes(t.ref)||(e.push(t.ref),e.sort(((t,e)=>n(e,r)-n(t,r))))}),(t=>{const r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)}))}}},7627:(t,e,r)=>{"use strict";r.d(e,{ft:()=>S,wA:()=>d,TC:()=>N,iM:()=>E,RB:()=>R,$o:()=>u,S:()=>l,TD:()=>C,yw:()=>c,yR:()=>O});var i=r(6951);const s={build(t){const e=t.points;let r,s,n,o,a,h;if(t.type===i.HS.CIRC){const e=t.shape;r=e.x,s=e.y,a=h=e.radius,n=o=0}else if(t.type===i.HS.ELIP){const e=t.shape;r=e.x,s=e.y,a=e.width,h=e.height,n=o=0}else{const e=t.shape,i=e.width/2,l=e.height/2;r=e.x+i,s=e.y+l,a=h=Math.max(0,Math.min(e.radius,Math.min(i,l))),n=i-a,o=l-h}if(!(a>=0&&h>=0&&n>=0&&o>=0))return void(e.length=0);const l=Math.ceil(2.3*Math.sqrt(a+h)),u=8*l+(n?4:0)+(o?4:0);if(e.length=u,0===u)return;if(0===l)return e.length=8,e[0]=e[6]=r+n,e[1]=e[3]=s+o,e[2]=e[4]=r-n,void(e[5]=e[7]=s-o);let c=0,d=4*l+(n?2:0)+2,f=d,p=u;{const t=n+a,i=o,h=r+t,l=r-t,u=s+i;if(e[c++]=h,e[c++]=u,e[--d]=u,e[--d]=l,o){const t=s-i;e[f++]=l,e[f++]=t,e[--p]=t,e[--p]=h}}for(let t=1;t0||e&&i<=0){const e=r/2;for(let i=e+e%2;i=6){n(r,!1);const t=[];for(let e=0;e=0&&n>=0&&o.push(r,i,r+s,i,r+s,i+n,r,i+n)},triangulate(t,e){const r=t.points,i=e.points;if(0===r.length)return;const s=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(s,s+1,s+2,s+1,s+2,s+3)}},h={build(t){s.build(t)},triangulate(t,e){s.triangulate(t,e)}};var l=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(l||{}),u=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(u||{});const c={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return rthis.maxSegments&&(r=this.maxSegments),r}},d=c;class f{static curveTo(t,e,r,i,s,n){const o=n[n.length-2],a=n[n.length-1]-e,h=o-t,l=i-e,u=r-t,c=Math.abs(a*u-h*l);if(c<1e-8||0===s)return n[n.length-2]===t&&n[n.length-1]===e||n.push(t,e),null;const d=a*a+h*h,f=l*l+u*u,p=a*l+h*u,m=s*Math.sqrt(d)/c,g=s*Math.sqrt(f)/c,y=m*p/d,_=g*p/f,x=m*u+g*h,b=m*l+g*a,v=h*(g+y),T=a*(g+y),E=u*(m+_),w=l*(m+_);return{cx:x+t,cy:b+e,radius:s,startAngle:Math.atan2(T-b,v-x),endAngle:Math.atan2(w-b,E-x),anticlockwise:h*l>u*a}}static arc(t,e,r,s,n,o,a,h,l){const u=a-o,d=c._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/i._b)),f=u/(2*d),p=2*f,m=Math.cos(f),g=Math.sin(f),y=d-1,_=y%1/y;for(let t=0;t<=y;++t){const e=f+o+p*(t+_*t),i=Math.cos(e),a=-Math.sin(e);l.push((m*i+g*a)*n+r,(m*-a+g*i)*n+s)}}}class p{static curveLength(t,e,r,i,s,n,o,a){let h=0,l=0,u=0,c=0,d=0,f=0,p=0,m=0,g=0,y=0,_=0,x=t,b=e;for(let v=1;v<=10;++v)l=v/10,u=l*l,c=u*l,d=1-l,f=d*d,p=f*d,m=p*t+3*f*l*r+3*d*u*s+c*o,g=p*e+3*f*l*i+3*d*u*n+c*a,y=x-m,_=b-g,x=m,b=g,h+=Math.sqrt(y*y+_*_);return h}static curveTo(t,e,r,i,s,n,o){const a=o[o.length-2],h=o[o.length-1];o.length-=2;const l=c._segmentsCount(p.curveLength(a,h,t,e,r,i,s,n));let u=0,d=0,f=0,m=0,g=0;o.push(a,h);for(let c=1,p=0;c<=l;++c)p=c/l,u=1-p,d=u*u,f=d*u,m=p*p,g=m*p,o.push(f*a+3*d*p*t+3*u*m*r+g*s,f*h+3*d*p*e+3*u*m*i+g*n)}}function m(t,e,r,i,s,n,o,a){let h,l;o?(h=i,l=-r):(h=-i,l=r);const u=t-r*s+h,c=e-i*s+l,d=t+r*n+h,f=e+i*n+l;return a.push(u,c,d,f),2}function g(t,e,r,i,s,n,o,a){const h=r-t,l=i-e;let u=Math.atan2(h,l),c=Math.atan2(s-t,n-e);a&&uc&&(c+=2*Math.PI);let d=u;const f=c-u,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=1+(15*p*Math.sqrt(m)/Math.PI>>0),y=f/g;if(d+=y,a){o.push(t,e,r,i);for(let r=1,i=d;r=0&&(o.join===l.ROUND?_+=g(A,I,A-C*D,I-M*D,A-P*D,I-N*D,p,!1)+4:_+=2,p.push(A-P*B,I-N*B,A+P*D,I+N*D));continue}const c=(-C+E)*(-M+I)-(-C+A)*(-M+w),d=(-P+R)*(-N+I)-(-P+A)*(-N+S),f=(e*d-i*c)/h,m=(n*c-r*d)/h,y=(f-A)*(f-A)+(m-I)*(m-I),x=A+(f-A)*D,F=I+(m-I)*D,U=A-(f-A)*B,L=I-(m-I)*B,k=u?D:B,G=y<=Math.min(e*e+r*r,i*i+n*n)+k*k*v;let j=o.join;if(j===l.MITER&&y/v>T&&(j=l.BEVEL),G)switch(j){case l.MITER:p.push(x,F,U,L);break;case l.BEVEL:u?p.push(x,F,A+C*B,I+M*B,x,F,A+P*B,I+N*B):p.push(A-C*D,I-M*D,U,L,A-P*D,I-N*D,U,L),_+=2;break;case l.ROUND:u?(p.push(x,F,A+C*B,I+M*B),_+=g(A,I,A+C*B,I+M*B,A+P*B,I+N*B,p,!0)+4,p.push(x,F,A+P*B,I+N*B)):(p.push(A-C*D,I-M*D,U,L),_+=g(A,I,A-C*D,I-M*D,A-P*D,I-N*D,p,!1)+4,p.push(A-P*D,I-N*D,U,L))}else{switch(p.push(A-C*D,I-M*D,A+C*B,I+M*B),j){case l.MITER:u?p.push(U,L,U,L):p.push(x,F,x,F),_+=2;break;case l.ROUND:_+=u?g(A,I,A+C*B,I+M*B,A+P*B,I+N*B,p,!0)+2:g(A,I,A-C*D,I-M*D,A-P*D,I-N*D,p,!1)+2}p.push(A-P*D,I-N*D,A+P*B,I+N*B),_+=2}}E=s[2*(y-2)],w=s[2*(y-2)+1],A=s[2*(y-1)],I=s[2*(y-1)+1],C=-(w-I),M=E-A,O=Math.sqrt(C*C+M*M),C/=O,M/=O,C*=b,M*=b,p.push(A-C*D,I-M*D,A+C*B,I+M*B),d||(o.cap===u.ROUND?_+=g(A-C*(D-B)*.5,I-M*(D-B)*.5,A-C*D,I-M*D,A+C*B,I+M*B,p,!1)+2:o.cap===u.SQUARE&&(_+=m(A,I,C,M,D,B,!1,p)));const U=e.indices,L=c.epsilon*c.epsilon;for(let t=x;t<_+x-2;++t)E=p[2*t],w=p[2*t+1],A=p[2*(t+1)],I=p[2*(t+1)+1],R=p[2*(t+2)],S=p[2*(t+2)+1],Math.abs(E*(I-S)+A*(S-w)+R*(w-I))0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,i=null){const s=new E(t,e,r,i);return this.graphicsData.push(s),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new E(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t0&&(r=this.batches[this.batches.length-1],s=r.style);for(let n=this.shapeIndex;n65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e)&&t.texture.baseTexture===e.texture.baseTexture&&t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t131070)return!1;const t=this.batches;for(let e=0;e0&&(s=v.pop(),s||(s=new i.a$,s.texArray=new i.Ie),this.drawCalls.push(s)),s.start=u,s.size=0,s.texArray.count=0,s.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=n,m.wrapMode=i.Nt.REPEAT,s.texArray.elements[s.texArray.count++]=m,n++)),s.size+=d.size,u+=d.size,a=m._batchLocation,this.addColors(e,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(r,a,d.attribSize,d.attribStart)}i.VL._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,s=new ArrayBuffer(3*t.length*4),n=new Float32Array(s),o=new Uint32Array(s);let a=0;for(let s=0;s0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new i.mg,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new i.mg,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,i=r[r.length-2],s=r[r.length-1];return i===t&&s===e||r.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,r,i){this._initCurve();const s=this.currentPath.points;return 0===s.length&&this.moveTo(0,0),_.curveTo(t,e,r,i,s),this}bezierCurveTo(t,e,r,i,s,n){return this._initCurve(),p.curveTo(t,e,r,i,s,n,this.currentPath.points),this}arcTo(t,e,r,i,s){this._initCurve(t,e);const n=this.currentPath.points,o=f.curveTo(t,e,r,i,s,n);if(o){const{cx:t,cy:e,radius:r,startAngle:i,endAngle:s,anticlockwise:n}=o;this.arc(t,e,r,i,s,n)}return this}arc(t,e,r,s,n,o=!1){if(s===n)return this;if(!o&&n<=s?n+=i._b:o&&s<=n&&(s+=i._b),0==n-s)return this;const a=t+Math.cos(s)*r,h=e+Math.sin(s)*r,l=this._geometry.closePointEps;let u=this.currentPath?this.currentPath.points:null;if(u){const t=Math.abs(u[u.length-2]-a),e=Math.abs(u[u.length-1]-h);t0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,s){return this.drawShape(new i.Ae(t,e,r,s))}drawRoundedRect(t,e,r,s,n){return this.drawShape(new i.c9(t,e,r,s,n))}drawCircle(t,e,r){return this.drawShape(new i.Cd(t,e,r))}drawEllipse(t,e,r,s){return this.drawShape(new i.Pj(t,e,r,s))}drawPolygon(...t){let e,r=!0;const s=t[0];s.points?(r=s.closeStroke,e=s.points):e=Array.isArray(t[0])?t[0]:t;const n=new i.mg(e);return n.closeStroke=r,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==i.HS.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const 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(let s=0;s{"use strict";r.d(e,{Cd:()=>u,ZX:()=>n,Pj:()=>c,y3:()=>p,AB:()=>E,_b:()=>i,E9:()=>a,mg:()=>d,jl:()=>s,Ae:()=>l,c9:()=>f,HS:()=>o,wx:()=>A,Lv:()=>T});const i=2*Math.PI,s=180/Math.PI,n=Math.PI/180;var o=(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",t))(o||{});class a{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new a(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`}}const h=[new a,new a,new a,new a];class l{constructor(t=0,e=0,r=0,i=0){this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=o.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new l(0,0,0,0)}clone(){return new l(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return!(this.width<=0||this.height<=0)&&t>=this.x&&t=this.y&&et.right?t.right:this.right)<=e)return!1;const r=this.yt.bottom?t.bottom:this.bottom)>r}const r=this.left,i=this.right,s=this.top,n=this.bottom;if(i<=r||n<=s)return!1;const o=h[0].set(t.left,t.top),a=h[1].set(t.left,t.bottom),l=h[2].set(t.right,t.top),u=h[3].set(t.right,t.bottom);if(l.x<=o.x||a.y<=o.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(0===c)return!1;if(e.apply(o,o),e.apply(a,a),e.apply(l,l),e.apply(u,u),Math.max(o.x,a.x,l.x,u.x)<=r||Math.min(o.x,a.x,l.x,u.x)>=i||Math.max(o.y,a.y,l.y,u.y)<=s||Math.min(o.y,a.y,l.y,u.y)>=n)return!1;const d=c*(a.y-o.y),f=c*(o.x-a.x),p=d*r+f*s,m=d*i+f*s,g=d*r+f*n,y=d*i+f*n;if(Math.max(p,m,g,y)<=d*o.x+f*o.y||Math.min(p,m,g,y)>=d*u.x+f*u.y)return!1;const _=c*(o.y-l.y),x=c*(l.x-o.x),b=_*r+x*s,v=_*i+x*s,T=_*r+x*n,E=_*i+x*n;return!(Math.max(b,v,T,E)<=_*o.x+x*o.y||Math.min(b,v,T,E)>=_*u.x+x*u.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const 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),s=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(s-i,0),this}ceil(t=1,e=.001){const 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}enlarge(t){const 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),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=s-i,this}toString(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class u{constructor(t=0,e=0,r=0){this.x=t,this.y=e,this.radius=r,this.type=o.CIRC}clone(){return new u(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let i=this.x-t,s=this.y-e;return i*=i,s*=s,i+s<=r}getBounds(){return new l(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}toString(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class c{constructor(t=0,e=0,r=0,i=0){this.x=t,this.y=e,this.width=r,this.height=i,this.type=o.ELIP}clone(){return new c(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,r+i<=1}getBounds(){return new l(this.x-this.width,this.y-this.height,this.width,this.height)}toString(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}class d{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let r=0,i=e.length;re!=h>e&&t<(e-o)/(h-o)*(a-i)+i&&(r=!r)}return r}toString(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce(((t,e)=>`${t}, ${e}`),"")}]`}}class f{constructor(t=0,e=0,r=0,i=0,s=20){this.x=t,this.y=e,this.width=r,this.height=i,this.radius=s,this.type=o.RREC}clone(){return new f(this.x,this.y,this.width,this.height,this.radius)}contains(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){const 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;let i=t-(this.x+r),s=e-(this.y+r);const n=r*r;if(i*i+s*s<=n)return!0;if(i=t-(this.x+this.width-r),i*i+s*s<=n)return!0;if(s=e-(this.y+this.height-r),i*i+s*s<=n)return!0;if(i=t-(this.x+r),i*i+s*s<=n)return!0}return!1}toString(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}class p{constructor(t=1,e=0,r=0,i=1,s=0,n=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=s,this.ty=n}fromArray(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]}set(t,e,r,i,s,n){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=s,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const 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}apply(t,e){e=e||new a;const 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}applyInverse(t,e){e=e||new a;const r=1/(this.a*this.d+this.c*-this.b),i=t.x,s=t.y;return e.x=this.d*r*i+-this.c*r*s+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*s+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),i=this.a,s=this.c,n=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=s*e-this.d*r,this.d=s*r+this.d*e,this.tx=n*e-this.ty*r,this.ty=n*r+this.ty*e,this}append(t){const e=this.a,r=this.b,i=this.c,s=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*s,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*s,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*s+this.ty,this}setTransform(t,e,r,i,s,n,o,a,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-a)*n,this.d=Math.cos(o-a)*n,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,r=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*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}decompose(t){const e=this.a,r=this.b,s=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-s,n),h=Math.atan2(r,e),l=Math.abs(a+h);return l<1e-5||Math.abs(i-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(s*s+n*n),t.position.x=this.tx+(o.x*e+o.y*s),t.position.y=this.ty+(o.x*r+o.y*n),t}invert(){const t=this.a,e=this.b,r=this.c,i=this.d,s=this.tx,n=t*i-e*r;return this.a=i/n,this.b=-e/n,this.c=-r/n,this.d=t/n,this.tx=(r*this.ty-i*s)/n,this.ty=-(t*this.ty-e*s)/n,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new p;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}copyTo(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}copyFrom(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}toString(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return new p}static get TEMP_MATRIX(){return new p}}const m=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],g=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],y=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],_=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],x=[],b=[],v=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];x.push(e);for(let r=0;r<16;r++){const i=v(m[t]*m[r]+y[t]*g[r]),s=v(g[t]*m[r]+_[t]*g[r]),n=v(m[t]*y[r]+y[t]*_[r]),o=v(g[t]*y[r]+_[t]*_[r]);for(let t=0;t<16;t++)if(m[t]===i&&g[t]===s&&y[t]===n&&_[t]===o){e.push(t);break}}}for(let t=0;t<16;t++){const e=new p;e.set(m[t],g[t],y[t],_[t],0,0),b.push(e)}}();const T={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:t=>m[t],uY:t=>g[t],vX:t=>y[t],vY:t=>_[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>x[t][e],sub:(t,e)=>x[t][T.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?T.S:T.N:2*Math.abs(e)<=Math.abs(t)?t>0?T.E:T.W:e>0?t>0?T.SE:T.SW:t>0?T.NE:T.NW,matrixAppendRotationInv:(t,e,r=0,i=0)=>{const s=b[T.inv(e)];s.tx=r,s.ty=i,t.append(s)}};class E{constructor(t,e,r=0,i=0){this._x=r,this._y=i,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new E(t,e,this._x,this._y)}set(t=0,e=t){return this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=${this.scope}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}const w=class{constructor(){this.worldTransform=new p,this.localTransform=new p,this.position=new E(this.onChange,this,0,0),this.scale=new E(this.onChange,this,1,1),this.pivot=new E(this.onChange,this,0,0),this.skew=new E(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}onChange(){this._localID++}updateSkew(){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++}toString(){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}) ]`}updateLocalTransform(){const 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)}updateTransform(t){const 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){const 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++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};let A=w;A.IDENTITY=new w},5638:(t,e,r)=>{"use strict";r.d(e,{ZT:()=>h,_1:()=>s,Au:()=>n,AL:()=>l,VJ:()=>a,IE:()=>u});var i=r(5117);class s extends i.xc{constructor(t=100,e=100,r=10,i=10){super(),this.segWidth=r,this.segHeight=i,this.width=t,this.height=e,this.build()}build(){const t=this.segWidth*this.segHeight,e=[],r=[],i=[],s=this.segWidth-1,n=this.segHeight-1,o=this.width/s,a=this.height/n;for(let i=0;i0){const r=a.x-t[e].x,i=a.y-t[e].y,s=Math.sqrt(r*r+i*i);a=t[e],o+=s/h}else o=e/(l-1);s[r]=o,s[r+1]=0,s[r+2]=o,s[r+3]=1}let u=0;for(let t=0;t0?this.textureScale*this._width/2:this._width/2;for(let h=0;h1&&(c=1);const d=Math.sqrt(i*i+s*s);d<1e-6?(i=0,s=0):(i/=d,s/=d,i*=a,s*=a),n[u]=l.x+i,n[u+1]=l.y+s,n[u+2]=l.x-i,n[u+3]=l.y-s,r=l}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}var o=r(6951);class a extends i.Kj{constructor(t,e,r){super(new s(t.width,t.height,e,r),new i.rY(o.xE.WHITE)),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:e,height:r}=this.shader.texture;!this.autoResize||t.width===e&&t.height===r||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}class h extends a{constructor(t,e,r,i,s){super(o.xE.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=e??t.defaultBorders?.left??10,this._rightWidth=i??t.defaultBorders?.right??10,this._topHeight=r??t.defaultBorders?.top??10,this._bottomHeight=s??t.defaultBorders?.bottom??10,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const 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}updateVerticalVertices(){const 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}_getMinScale(){const 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)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const 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()}}class l extends i.Kj{constructor(t=o.xE.EMPTY,e,r,s,n){const a=new i.xc(e,r,s);a.getBuffer("aVertexPosition").static=!1,super(a,new i.rY(t),null,n),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}class u extends i.Kj{constructor(t,e,r=0){const s=new n(t.height,e,r),a=new i.rY(t);r>0&&(t.baseTexture.wrapMode=o.Nt.REPEAT),super(s,a),this.autoUpdate=!0}_render(t){const e=this.geometry;(this.autoUpdate||e._width!==this.shader.texture.height)&&(e._width=this.shader.texture.height,e.update()),super._render(t)}}},5117:(t,e,r)=>{"use strict";r.d(e,{Kj:()=>l,wQ:()=>n,xc:()=>u,rY:()=>c});var i=r(6951),s=r(8820);class n{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const 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++}}const o=new i.E9,a=new i.mg,h=class extends s.W2{constructor(t,e,r,s=i.lg.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=r||i.ZM.for2d(),this.drawMode=s,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=i.Xd.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(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)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(t){const e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===i.lg.TRIANGLES&&e.length<2*h.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)}_renderDefault(t){const 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)}_renderToBatch(t){const 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;const i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const s=this.transform.worldTransform,n=s.a,o=s.b,a=s.c,h=s.d,l=s.tx,u=s.ty,c=this.vertexData;for(let t=0;t{"use strict";r.d(e,{ZQ:()=>i,tq:()=>T,Xd:()=>s});const i={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")},s={ADAPTER:i,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var n=/iPhone/i,o=/iPod/i,a=/iPad/i,h=/\biOS-universal(?:.+)Mac\b/i,l=/\bAndroid(?:.+)Mobile\b/i,u=/Android/i,c=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,d=/Silk/i,f=/Windows Phone/i,p=/\bWindows(?:.+)ARM\b/i,m=/BlackBerry/i,g=/BB10/i,y=/Opera Mini/i,_=/\b(CriOS|Chrome)(?:.+)Mobile/i,x=/Mobile(?:.+)Firefox\b/i,b=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function v(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 s=function(t){return function(e){return e.test(t)}}(r),v={apple:{phone:s(n)&&!s(f),ipod:s(o),tablet:!s(n)&&(s(a)||b(e))&&!s(f),universal:s(h),device:(s(n)||s(o)||s(a)||s(h)||b(e))&&!s(f)},amazon:{phone:s(c),tablet:!s(c)&&s(d),device:s(c)||s(d)},android:{phone:!s(f)&&s(c)||!s(f)&&s(l),tablet:!s(f)&&!s(c)&&!s(l)&&(s(d)||s(u)),device:!s(f)&&(s(c)||s(d)||s(l)||s(u))||s(/\bokhttp\b/i)},windows:{phone:s(f),tablet:s(p),device:s(f)||s(p)},other:{blackberry:s(m),blackberry10:s(g),opera:s(y),firefox:s(x),chrome:s(_),device:s(m)||s(g)||s(y)||s(x)||s(_)},any:!1,phone:!1,tablet:!1};return v.any=v.apple.device||v.android.device||v.windows.device||v.other.device,v.phone=v.apple.phone||v.android.phone||v.windows.phone,v.tablet=v.apple.tablet||v.android.tablet||v.windows.tablet,v}const T=(v.default??v)(globalThis.navigator)},2274:(t,e,r)=>{"use strict";r.d(e,{j:()=>a});var i=r(6951),s=r(8820);const n=new i.E9,o=new Uint16Array([0,1,2,0,2,3]);class a extends s.W2{constructor(t){super(),this._anchor=new i.AB(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new i.Il(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=i.T$.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||i.xE.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=o,this.pluginName="batch",this.isSprite=!0,this._roundPixels=i.Xd.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=i.P6.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=i.P6.sign(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const e=this.transform.worldTransform,r=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,h=e.ty,l=this.vertexData,u=t.trim,c=t.orig,d=this._anchor;let f=0,p=0,m=0,g=0;if(u?(p=u.x-d._x*c.width,f=p+u.width,g=u.y-d._y*c.height,m=g+u.height):(p=-d._x*c.width,f=p+c.width,g=-d._y*c.height,m=g+c.height),l[0]=r*p+n*g+a,l[1]=o*g+s*p+h,l[2]=r*f+n*g+a,l[3]=o*g+s*f+h,l[4]=r*f+n*m+a,l[5]=o*m+s*f+h,l[6]=r*p+n*m+a,l[7]=o*m+s*p+h,this._roundPixels){const t=i.Xd.RESOLUTION;for(let e=0;e=i&&n.x=s&&n.y{"use strict";r.d(e,{vB:()=>h,Sb:()=>u,uF:()=>n});var i=r(6075),s=r(7441),n=(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",t))(n||{});class o{constructor(t,e=null,r=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(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);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const a=class{constructor(){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 o(null,null,1/0),this.deltaMS=1/a.targetFPMS,this.elapsedMS=1/a.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=n.NORMAL){return this._addListener(new o(t,e,r))}addOnce(t,e,r=n.NORMAL){return this._addListener(new o(t,e,r,!0))}_addListener(t){let 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}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const e=t-this._lastFrame|0;if(eh.targetFPMS,set(t){(0,s.deprecation)("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),h.targetFPMS=t}}});var l=r(463);class u{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,n.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?h.shared:new h,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}u.extension=l.n.Application,l.R.add(u)},7441:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BaseTextureCache:()=>X,BoundingBox:()=>j,CanvasRenderTarget:()=>z,DATA_URI:()=>S,EventEmitter:()=>s,ProgramCache:()=>H,TextureCache:()=>V,clearTextureCache:()=>W,correctBlendMode:()=>w,createIndicesForQuads:()=>C,decomposeDataUri:()=>Q,deprecation:()=>d,destroyTextureCache:()=>$,determineCrossOrigin:()=>tt,earcut:()=>n,getBufferType:()=>M,getCanvasBoundingBox:()=>K,getResolutionOfUrl:()=>et,hex2rgb:()=>_,hex2string:()=>x,interleaveTypedArrays:()=>N,isMobile:()=>i.tq,isPow2:()=>F,isWebGLSupported:()=>g,log2:()=>D,nextPow2:()=>O,path:()=>u,premultiplyBlendMode:()=>E,premultiplyRgba:()=>A,premultiplyTint:()=>I,premultiplyTintToRgba:()=>R,removeItems:()=>B,rgb2hex:()=>v,sayHello:()=>p,sign:()=>U,skipHello:()=>f,string2hex:()=>b,trimCanvas:()=>Z,uid:()=>k,url:()=>a});var i=r(6075);i.Xd.RETINA_PREFIX=/@([0-9\.]+)x/,i.Xd.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var s=r(6729),n=r(9187),o=r(8575);const a={parse:o.Qc,format:o.WU,resolve:o.DB};function h(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function l(t){return t.split("?")[0].split("#")[0]}const u={toPosix:t=>("\\","/",t.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/")),isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),hasProtocol(t){return/^[^/:]+:\//.test(this.toPosix(t))},getProtocol(t){h(t),t=this.toPosix(t);let e="";const r=/^file:\/\/\//.exec(t),i=/^[^/:]+:\/\//.exec(t),s=/^[^/:]+:\//.exec(t);if(r||i||s){const n=r?.[0]||i?.[0]||s?.[0];e=n,t=t.slice(n.length)}return e},toAbsolute(t,e,r){if(this.isDataUrl(t))return t;const s=l(this.toPosix(e??i.Xd.ADAPTER.getBaseUrl())),n=l(this.toPosix(r??this.rootname(s)));return h(t),(t=this.toPosix(t)).startsWith("/")?u.join(n,t.slice(1)):this.isAbsolute(t)?t:this.join(s,t)},normalize(t){if(h(t=this.toPosix(t)),0===t.length)return".";let e="";const r=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return(t=function(t,e){let r="",i=0,s=-1,n=0,o=-1;for(let e=0;e<=t.length;++e){if(e2){const t=r.lastIndexOf("/");if(t!==r.length-1){-1===t?(r="",i=0):(r=r.slice(0,t),i=r.length-1-r.lastIndexOf("/")),s=e,n=0;continue}}else if(2===r.length||1===r.length){r="",i=0,s=e,n=0;continue}}else r.length>0?r+=`/${t.slice(s+1,e)}`:r=t.slice(s+1,e),i=e-s-1;s=e,n=0}else 46===o&&-1!==n?++n:n=-1}return r}(t)).length>0&&i&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return h(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let r=0;r0)if(void 0===e)e=i;else{const s=t[r-1]??"";this.extname(s)?e+=`/../${i}`:e+=`/${i}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(h(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const r=47===e;let i=-1,s=!0;const n=this.getProtocol(t),o=t;for(let r=(t=t.slice(n.length)).length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!s){i=r;break}}else s=!1;return-1===i?r?"/":this.isUrl(o)?n+t:n:r&&1===i?"//":n+t.slice(0,i)},rootname(t){h(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);e=-1!==r?t.slice(0,r):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){h(t),e&&h(e),t=l(this.toPosix(t));let r,i=0,s=-1,n=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,a=-1;for(r=t.length-1;r>=0;--r){const h=t.charCodeAt(r);if(47===h){if(!n){i=r+1;break}}else-1===a&&(n=!1,a=r+1),o>=0&&(h===e.charCodeAt(o)?-1==--o&&(s=r):(o=-1,s=a))}return i===s?s=a:-1===s&&(s=t.length),t.slice(i,s)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!n){i=r+1;break}}else-1===s&&(n=!1,s=r+1);return-1===s?"":t.slice(i,s)},extname(t){h(t);let e=-1,r=0,i=-1,s=!0,n=0;for(let o=(t=l(this.toPosix(t))).length-1;o>=0;--o){const a=t.charCodeAt(o);if(47!==a)-1===i&&(s=!1,i=o+1),46===a?-1===e?e=o:1!==n&&(n=1):-1!==e&&(n=-1);else if(!s){r=o+1;break}}return-1===e||-1===i||0===n||1===n&&e===i-1&&e===r+1?"":t.slice(e,i)},parse(t){h(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let r=(t=l(this.toPosix(t))).charCodeAt(0);const i=this.isAbsolute(t);let s;e.root=this.rootname(t),s=i||this.hasProtocol(t)?1:0;let n=-1,o=0,a=-1,u=!0,c=t.length-1,d=0;for(;c>=s;--c)if(r=t.charCodeAt(c),47!==r)-1===a&&(u=!1,a=c+1),46===r?-1===n?n=c:1!==d&&(d=1):-1!==n&&(d=-1);else if(!u){o=c+1;break}return-1===n||-1===a||0===d||1===d&&n===a-1&&n===o+1?-1!==a&&(e.base=e.name=0===o&&i?t.slice(1,a):t.slice(o,a)):(0===o&&i?(e.name=t.slice(1,n),e.base=t.slice(1,a)):(e.name=t.slice(o,n),e.base=t.slice(o,a)),e.ext=t.slice(n,a)),e.dir=this.dirname(t),e},sep:"/",delimiter:":"},c={};function d(t,e,r=3){if(c[e])return;let 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))),c[e]=!0}function f(){d("7.0.0","skipHello is deprecated, please use settings.RENDER_OPTIONS.hello")}function p(){d("7.0.0",'sayHello is deprecated, please use Renderer\'s "hello" option')}let m;function g(){return void 0===m&&(m=function(){const t={stencil:!0,failIfMajorPerformanceCaveat:i.Xd.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!i.Xd.ADAPTER.getWebGLRenderingContext())return!1;const e=i.Xd.ADAPTER.createCanvas();let r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const s=!!r?.getContextAttributes()?.stencil;if(r){const t=r.getExtension("WEBGL_lose_context");t&&t.loseContext()}return r=null,s}catch(t){return!1}}()),m}var y=r(7126);function _(t,e=[]){return d("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),y.I.shared.setValue(t).toRgbArray(e)}function x(t){return d("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),y.I.shared.setValue(t).toHex()}function b(t){return d("7.2.0","utils.string2hex is deprecated, use Color#toNumber instead"),y.I.shared.setValue(t).toNumber()}function v(t){return d("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),y.I.shared.setValue(t).toNumber()}var T=r(7361);const E=function(){const t=[],e=[];for(let r=0;r<32;r++)t[r]=r,e[r]=r;t[T.T$.NORMAL_NPM]=T.T$.NORMAL,t[T.T$.ADD_NPM]=T.T$.ADD,t[T.T$.SCREEN_NPM]=T.T$.SCREEN,e[T.T$.NORMAL]=T.T$.NORMAL_NPM,e[T.T$.ADD]=T.T$.ADD_NPM,e[T.T$.SCREEN]=T.T$.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}();function w(t,e){return E[e?1:0][t]}function A(t,e,r,i=!0){return d("7.2.0","utils.premultiplyRgba has moved to Color.premultiply"),y.I.shared.setValue(t).premultiply(e,i).toArray(r??new Float32Array(4))}function I(t,e){return d("7.2.0","utils.premultiplyTint has moved to Color.toPremultiplied"),y.I.shared.setValue(t).toPremultiplied(e)}function R(t,e,r,i=!0){return d("7.2.0","utils.premultiplyTintToRgba has moved to Color.premultiply"),y.I.shared.setValue(t).premultiply(e,i).toArray(r??new Float32Array(4))}const S=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function C(t,e=null){const 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(let t=0,i=0;t>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function F(t){return!(t&t-1||!t)}function D(t){let e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,r=((t>>>=r)>15?1:0)<<2,e|=r,r=((t>>>=r)>3?1:0)<<1,e|=r,e|(t>>>=r)>>1}function B(t,e,r){const i=t.length;let s;if(e>=i||0===r)return;const n=i-(r=e+r>i?i-e:r);for(s=e;s