{"version":3,"file":"pixi.min.js","sources":["../../../../node_modules/promise-polyfill/src/index.js","../../../../node_modules/promise-polyfill/src/finally.js","../../../../node_modules/promise-polyfill/src/allSettled.js","../../../../node_modules/object-assign/index.js","../../../../packages/polyfill/dist/esm/polyfill.min.js","../../../../node_modules/ismobilejs/esm/isMobile.js","../../../../packages/settings/dist/esm/settings.min.js","../../../../node_modules/eventemitter3/index.js","../../../../node_modules/earcut/src/earcut.js","../../../../node_modules/url/node_modules/punycode/punycode.js","../../../../node_modules/url/util.js","../../../../node_modules/querystring/decode.js","../../../../node_modules/querystring/encode.js","../../../../node_modules/querystring/index.js","../../../../node_modules/url/url.js","../../../../packages/constants/dist/esm/constants.min.js","../../../../packages/utils/dist/esm/utils.min.js","../../../../packages/math/dist/esm/math.min.js","../../../../packages/display/dist/esm/display.min.js","../../../../packages/accessibility/dist/esm/accessibility.min.js","../../../../packages/ticker/dist/esm/ticker.min.js","../../../../packages/interaction/dist/esm/interaction.min.js","../../../../packages/runner/dist/esm/runner.min.js","../../../../packages/core/dist/esm/core.min.js","../../../../packages/app/dist/esm/app.min.js","../../../../packages/extract/dist/esm/extract.min.js","../../../../node_modules/parse-uri/index.js","../../../../node_modules/mini-signals/lib/mini-signals.js","../../../../node_modules/resource-loader/dist/resource-loader.esm.js","../../../../packages/loaders/dist/esm/loaders.min.js","../../../../packages/compressed-textures/dist/esm/compressed-textures.min.js","../../../../packages/particles/dist/esm/particles.min.js","../../../../packages/graphics/dist/esm/graphics.min.js","../../../../packages/sprite/dist/esm/sprite.min.js","../../../../packages/text/dist/esm/text.min.js","../../../../packages/prepare/dist/esm/prepare.min.js","../../../../packages/spritesheet/dist/esm/spritesheet.min.js","../../../../packages/sprite-tiling/dist/esm/sprite-tiling.min.js","../../../../packages/mesh/dist/esm/mesh.min.js","../../../../packages/text-bitmap/dist/esm/text-bitmap.min.js","../../../../packages/filters/filter-alpha/dist/esm/filter-alpha.min.js","../../../../packages/filters/filter-blur/dist/esm/filter-blur.min.js","../../../../packages/filters/filter-color-matrix/dist/esm/filter-color-matrix.min.js","../../../../packages/filters/filter-displacement/dist/esm/filter-displacement.min.js","../../../../packages/filters/filter-fxaa/dist/esm/filter-fxaa.min.js","../../../../packages/filters/filter-noise/dist/esm/filter-noise.min.js","../../../../packages/mixin-cache-as-bitmap/dist/esm/mixin-cache-as-bitmap.min.js","../../../../packages/mixin-get-child-by-name/dist/esm/mixin-get-child-by-name.min.js","../../../../packages/mixin-get-global-position/dist/esm/mixin-get-global-position.min.js","../../../../packages/mesh-extras/dist/esm/mesh-extras.min.js","../../../../packages/sprite-animated/dist/esm/sprite-animated.min.js","../../src/index.ts"],"sourcesContent":["import promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/*!\n * @pixi/polyfill - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/polyfill is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport e from\"promise-polyfill\";import r from\"object-assign\";self.Promise||(self.Promise=e),Object.assign||(Object.assign=r);if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!self.performance||!self.performance.now){var n=Date.now();self.performance||(self.performance={}),self.performance.now=function(){return Date.now()-n}}for(var t=Date.now(),a=[\"ms\",\"moz\",\"webkit\",\"o\"],i=0;i0?1:-1}),Number.isInteger||(Number.isInteger=function(e){return\"number\"==typeof e&&isFinite(e)&&Math.floor(e)===e}),self.ArrayBuffer||(self.ArrayBuffer=Array),self.Float32Array||(self.Float32Array=Array),self.Uint32Array||(self.Uint32Array=Array),self.Uint16Array||(self.Uint16Array=Array),self.Uint8Array||(self.Uint8Array=Array),self.Int32Array||(self.Int32Array=Array);\n//# sourceMappingURL=polyfill.min.js.map\n","var appleIphone = /iPhone/i;\nvar appleIpod = /iPod/i;\nvar appleTablet = /iPad/i;\nvar appleUniversal = /\\biOS-universal(?:.+)Mac\\b/i;\nvar androidPhone = /\\bAndroid(?:.+)Mobile\\b/i;\nvar androidTablet = /Android/i;\nvar amazonPhone = /(?:SD4930UR|\\bSilk(?:.+)Mobile\\b)/i;\nvar amazonTablet = /Silk/i;\nvar windowsPhone = /Windows Phone/i;\nvar windowsTablet = /\\bWindows(?:.+)ARM\\b/i;\nvar otherBlackBerry = /BlackBerry/i;\nvar otherBlackBerry10 = /BB10/i;\nvar otherOpera = /Opera Mini/i;\nvar otherChrome = /\\b(CriOS|Chrome)(?:.+)Mobile/i;\nvar otherFirefox = /Mobile(?:.+)Firefox\\b/i;\nvar isAppleTabletOnIos13 = function (navigator) {\n return (typeof navigator !== 'undefined' &&\n navigator.platform === 'MacIntel' &&\n typeof navigator.maxTouchPoints === 'number' &&\n navigator.maxTouchPoints > 1 &&\n typeof MSStream === 'undefined');\n};\nfunction createMatch(userAgent) {\n return function (regex) { return regex.test(userAgent); };\n}\nexport default function isMobile(param) {\n var nav = {\n userAgent: '',\n platform: '',\n maxTouchPoints: 0\n };\n if (!param && typeof navigator !== 'undefined') {\n nav = {\n userAgent: navigator.userAgent,\n platform: navigator.platform,\n maxTouchPoints: navigator.maxTouchPoints || 0\n };\n }\n else if (typeof param === 'string') {\n nav.userAgent = param;\n }\n else if (param && param.userAgent) {\n nav = {\n userAgent: param.userAgent,\n platform: param.platform,\n maxTouchPoints: param.maxTouchPoints || 0\n };\n }\n var userAgent = nav.userAgent;\n var tmp = userAgent.split('[FBAN');\n if (typeof tmp[1] !== 'undefined') {\n userAgent = tmp[0];\n }\n tmp = userAgent.split('Twitter');\n if (typeof tmp[1] !== 'undefined') {\n userAgent = tmp[0];\n }\n var match = createMatch(userAgent);\n var result = {\n apple: {\n phone: match(appleIphone) && !match(windowsPhone),\n ipod: match(appleIpod),\n tablet: !match(appleIphone) &&\n (match(appleTablet) || isAppleTabletOnIos13(nav)) &&\n !match(windowsPhone),\n universal: match(appleUniversal),\n device: (match(appleIphone) ||\n match(appleIpod) ||\n match(appleTablet) ||\n match(appleUniversal) ||\n isAppleTabletOnIos13(nav)) &&\n !match(windowsPhone)\n },\n amazon: {\n phone: match(amazonPhone),\n tablet: !match(amazonPhone) && match(amazonTablet),\n device: match(amazonPhone) || match(amazonTablet)\n },\n android: {\n phone: (!match(windowsPhone) && match(amazonPhone)) ||\n (!match(windowsPhone) && match(androidPhone)),\n tablet: !match(windowsPhone) &&\n !match(amazonPhone) &&\n !match(androidPhone) &&\n (match(amazonTablet) || match(androidTablet)),\n device: (!match(windowsPhone) &&\n (match(amazonPhone) ||\n match(amazonTablet) ||\n match(androidPhone) ||\n match(androidTablet))) ||\n match(/\\bokhttp\\b/i)\n },\n windows: {\n phone: match(windowsPhone),\n tablet: match(windowsTablet),\n device: match(windowsPhone) || match(windowsTablet)\n },\n other: {\n blackberry: match(otherBlackBerry),\n blackberry10: match(otherBlackBerry10),\n opera: match(otherOpera),\n firefox: match(otherFirefox),\n chrome: match(otherChrome),\n device: match(otherBlackBerry) ||\n match(otherBlackBerry10) ||\n match(otherOpera) ||\n match(otherFirefox) ||\n match(otherChrome)\n },\n any: false,\n phone: false,\n tablet: false\n };\n result.any =\n result.apple.device ||\n result.android.device ||\n result.windows.device ||\n result.other.device;\n result.phone =\n result.apple.phone || result.android.phone || result.windows.phone;\n result.tablet =\n result.apple.tablet || result.android.tablet || result.windows.tablet;\n return result;\n}\n//# sourceMappingURL=isMobile.js.map","/*!\n * @pixi/settings - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/settings is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport e from\"ismobilejs\";var E=e(self.navigator);var a={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(e){var a=!0;if(E.tablet||E.phone){var r;E.apple.device&&(r=navigator.userAgent.match(/OS (\\d+)_(\\d+)?/))&&parseInt(r[1],10)<11&&(a=!1),E.android.device&&(r=navigator.userAgent.match(/Android\\s([0-9.]*)/))&&parseInt(r[1],10)<7&&(a=!1)}return a?e:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:\"highp\",PRECISION_FRAGMENT:E.apple.device?\"highp\":\"mediump\",CAN_UPLOAD_SAME_BUFFER:!E.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};export{E as isMobile,a as settings};\n//# sourceMappingURL=settings.min.js.map\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 1 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim);\n triangles.push(ear.i / dim);\n triangles.push(next.i / dim);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var p = ear.next.next;\n\n while (p !== ear.prev) {\n if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // triangle bbox; min & max are calculated like this for speed\n var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\n minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\n maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\n maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(minTX, minTY, minX, minY, invSize),\n maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p !== ear.prev && p !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n !== ear.prev && n !== ear.next &&\n pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&\n area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim);\n triangles.push(p.i / dim);\n triangles.push(b.i / dim);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize);\n earcutLinked(c, triangles, dim, minX, minY, invSize);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n eliminateHole(queue[i], outerNode);\n outerNode = filterPoints(outerNode, outerNode.next);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n outerNode = findHoleBridge(hole, outerNode);\n if (outerNode) {\n var b = splitPolygon(outerNode, hole);\n\n // filter collinear points around the cuts\n filterPoints(outerNode, outerNode.next);\n filterPoints(b, b.next);\n }\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n if (x === hx) {\n if (hy === p.y) return p;\n if (hy === p.next.y) return p.next;\n }\n m = p.x < p.next.x ? p : p.next;\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = 32767 * (x - minX) * invSize;\n y = 32767 * (y - minY) * invSize;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = null;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n","/*! https://mths.be/punycode v1.3.2 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.3.2',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (Array.isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return Object.keys(obj).map(function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (Array.isArray(obj[k])) {\n return obj[k].map(function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n","/*!\n * @pixi/constants - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/constants is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nvar E,_,T,N,A,R,O,L,I,U,P,S,C,M,D,G,H;!function(E){E[E.WEBGL_LEGACY=0]=\"WEBGL_LEGACY\",E[E.WEBGL=1]=\"WEBGL\",E[E.WEBGL2=2]=\"WEBGL2\"}(E||(E={})),function(E){E[E.UNKNOWN=0]=\"UNKNOWN\",E[E.WEBGL=1]=\"WEBGL\",E[E.CANVAS=2]=\"CANVAS\"}(_||(_={})),function(E){E[E.COLOR=16384]=\"COLOR\",E[E.DEPTH=256]=\"DEPTH\",E[E.STENCIL=1024]=\"STENCIL\"}(T||(T={})),function(E){E[E.NORMAL=0]=\"NORMAL\",E[E.ADD=1]=\"ADD\",E[E.MULTIPLY=2]=\"MULTIPLY\",E[E.SCREEN=3]=\"SCREEN\",E[E.OVERLAY=4]=\"OVERLAY\",E[E.DARKEN=5]=\"DARKEN\",E[E.LIGHTEN=6]=\"LIGHTEN\",E[E.COLOR_DODGE=7]=\"COLOR_DODGE\",E[E.COLOR_BURN=8]=\"COLOR_BURN\",E[E.HARD_LIGHT=9]=\"HARD_LIGHT\",E[E.SOFT_LIGHT=10]=\"SOFT_LIGHT\",E[E.DIFFERENCE=11]=\"DIFFERENCE\",E[E.EXCLUSION=12]=\"EXCLUSION\",E[E.HUE=13]=\"HUE\",E[E.SATURATION=14]=\"SATURATION\",E[E.COLOR=15]=\"COLOR\",E[E.LUMINOSITY=16]=\"LUMINOSITY\",E[E.NORMAL_NPM=17]=\"NORMAL_NPM\",E[E.ADD_NPM=18]=\"ADD_NPM\",E[E.SCREEN_NPM=19]=\"SCREEN_NPM\",E[E.NONE=20]=\"NONE\",E[E.SRC_OVER=0]=\"SRC_OVER\",E[E.SRC_IN=21]=\"SRC_IN\",E[E.SRC_OUT=22]=\"SRC_OUT\",E[E.SRC_ATOP=23]=\"SRC_ATOP\",E[E.DST_OVER=24]=\"DST_OVER\",E[E.DST_IN=25]=\"DST_IN\",E[E.DST_OUT=26]=\"DST_OUT\",E[E.DST_ATOP=27]=\"DST_ATOP\",E[E.ERASE=26]=\"ERASE\",E[E.SUBTRACT=28]=\"SUBTRACT\",E[E.XOR=29]=\"XOR\"}(N||(N={})),function(E){E[E.POINTS=0]=\"POINTS\",E[E.LINES=1]=\"LINES\",E[E.LINE_LOOP=2]=\"LINE_LOOP\",E[E.LINE_STRIP=3]=\"LINE_STRIP\",E[E.TRIANGLES=4]=\"TRIANGLES\",E[E.TRIANGLE_STRIP=5]=\"TRIANGLE_STRIP\",E[E.TRIANGLE_FAN=6]=\"TRIANGLE_FAN\"}(A||(A={})),function(E){E[E.RGBA=6408]=\"RGBA\",E[E.RGB=6407]=\"RGB\",E[E.ALPHA=6406]=\"ALPHA\",E[E.LUMINANCE=6409]=\"LUMINANCE\",E[E.LUMINANCE_ALPHA=6410]=\"LUMINANCE_ALPHA\",E[E.DEPTH_COMPONENT=6402]=\"DEPTH_COMPONENT\",E[E.DEPTH_STENCIL=34041]=\"DEPTH_STENCIL\"}(R||(R={})),function(E){E[E.TEXTURE_2D=3553]=\"TEXTURE_2D\",E[E.TEXTURE_CUBE_MAP=34067]=\"TEXTURE_CUBE_MAP\",E[E.TEXTURE_2D_ARRAY=35866]=\"TEXTURE_2D_ARRAY\",E[E.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=\"TEXTURE_CUBE_MAP_POSITIVE_X\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=\"TEXTURE_CUBE_MAP_NEGATIVE_X\",E[E.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=\"TEXTURE_CUBE_MAP_POSITIVE_Y\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=\"TEXTURE_CUBE_MAP_NEGATIVE_Y\",E[E.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=\"TEXTURE_CUBE_MAP_POSITIVE_Z\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"}(O||(O={})),function(E){E[E.UNSIGNED_BYTE=5121]=\"UNSIGNED_BYTE\",E[E.UNSIGNED_SHORT=5123]=\"UNSIGNED_SHORT\",E[E.UNSIGNED_SHORT_5_6_5=33635]=\"UNSIGNED_SHORT_5_6_5\",E[E.UNSIGNED_SHORT_4_4_4_4=32819]=\"UNSIGNED_SHORT_4_4_4_4\",E[E.UNSIGNED_SHORT_5_5_5_1=32820]=\"UNSIGNED_SHORT_5_5_5_1\",E[E.FLOAT=5126]=\"FLOAT\",E[E.HALF_FLOAT=36193]=\"HALF_FLOAT\"}(L||(L={})),function(E){E[E.NEAREST=0]=\"NEAREST\",E[E.LINEAR=1]=\"LINEAR\"}(I||(I={})),function(E){E[E.CLAMP=33071]=\"CLAMP\",E[E.REPEAT=10497]=\"REPEAT\",E[E.MIRRORED_REPEAT=33648]=\"MIRRORED_REPEAT\"}(U||(U={})),function(E){E[E.OFF=0]=\"OFF\",E[E.POW2=1]=\"POW2\",E[E.ON=2]=\"ON\",E[E.ON_MANUAL=3]=\"ON_MANUAL\"}(P||(P={})),function(E){E[E.NPM=0]=\"NPM\",E[E.UNPACK=1]=\"UNPACK\",E[E.PMA=2]=\"PMA\",E[E.NO_PREMULTIPLIED_ALPHA=0]=\"NO_PREMULTIPLIED_ALPHA\",E[E.PREMULTIPLY_ON_UPLOAD=1]=\"PREMULTIPLY_ON_UPLOAD\",E[E.PREMULTIPLY_ALPHA=2]=\"PREMULTIPLY_ALPHA\"}(S||(S={})),function(E){E[E.NO=0]=\"NO\",E[E.YES=1]=\"YES\",E[E.AUTO=2]=\"AUTO\",E[E.BLEND=0]=\"BLEND\",E[E.CLEAR=1]=\"CLEAR\",E[E.BLIT=2]=\"BLIT\"}(C||(C={})),function(E){E[E.AUTO=0]=\"AUTO\",E[E.MANUAL=1]=\"MANUAL\"}(M||(M={})),function(E){E.LOW=\"lowp\",E.MEDIUM=\"mediump\",E.HIGH=\"highp\"}(D||(D={})),function(E){E[E.NONE=0]=\"NONE\",E[E.SCISSOR=1]=\"SCISSOR\",E[E.STENCIL=2]=\"STENCIL\",E[E.SPRITE=3]=\"SPRITE\"}(G||(G={})),function(E){E[E.NONE=0]=\"NONE\",E[E.LOW=2]=\"LOW\",E[E.MEDIUM=4]=\"MEDIUM\",E[E.HIGH=8]=\"HIGH\"}(H||(H={}));export{S as ALPHA_MODES,N as BLEND_MODES,T as BUFFER_BITS,C as CLEAR_MODES,A as DRAW_MODES,E as ENV,R as FORMATS,M as GC_MODES,G as MASK_TYPES,P as MIPMAP_MODES,H as MSAA_QUALITY,D as PRECISION,_ as RENDERER_TYPE,I as SCALE_MODES,O as TARGETS,L as TYPES,U as WRAP_MODES};\n//# sourceMappingURL=constants.min.js.map\n","/*!\n * @pixi/utils - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/utils is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{settings as e}from\"@pixi/settings\";export{isMobile}from\"@pixi/settings\";export{default as EventEmitter}from\"eventemitter3\";export{default as earcut}from\"earcut\";import{parse as r,format as t,resolve as n}from\"url\";import{BLEND_MODES as a}from\"@pixi/constants\";var f={parse:r,format:t,resolve:n};e.RETINA_PREFIX=/@([0-9\\.]+)x/,e.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var o,i=!1,l=\"6.0.2\";function c(){i=!0}function d(e){var r;if(!i){if(navigator.userAgent.toLowerCase().indexOf(\"chrome\")>-1){var t=[\"\\n %c %c %c PixiJS \"+l+\" - ✰ \"+e+\" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \\n\\n\",\"background: #ff66a5; padding:5px 0;\",\"background: #ff66a5; padding:5px 0;\",\"color: #ff66a5; background: #030307; padding:5px 0;\",\"background: #ff66a5; padding:5px 0;\",\"background: #ffc3dc; padding:5px 0;\",\"background: #ff66a5; padding:5px 0;\",\"color: #ff2424; background: #fff; padding:5px 0;\",\"color: #ff2424; background: #fff; padding:5px 0;\",\"color: #ff2424; background: #fff; padding:5px 0;\"];(r=self.console).log.apply(r,t)}else self.console&&self.console.log(\"PixiJS \"+l+\" - \"+e+\" - http://www.pixijs.com/\");i=!0}}function u(){return void 0===o&&(o=function(){var r={stencil:!0,failIfMajorPerformanceCaveat:e.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!self.WebGLRenderingContext)return!1;var t=document.createElement(\"canvas\"),n=t.getContext(\"webgl\",r)||t.getContext(\"experimental-webgl\",r),a=!(!n||!n.getContextAttributes().stencil);if(n){var f=n.getExtension(\"WEBGL_lose_context\");f&&f.loseContext()}return n=null,a}catch(e){return!1}}()),o}var s={aliceblue:\"#f0f8ff\",antiquewhite:\"#faebd7\",aqua:\"#00ffff\",aquamarine:\"#7fffd4\",azure:\"#f0ffff\",beige:\"#f5f5dc\",bisque:\"#ffe4c4\",black:\"#000000\",blanchedalmond:\"#ffebcd\",blue:\"#0000ff\",blueviolet:\"#8a2be2\",brown:\"#a52a2a\",burlywood:\"#deb887\",cadetblue:\"#5f9ea0\",chartreuse:\"#7fff00\",chocolate:\"#d2691e\",coral:\"#ff7f50\",cornflowerblue:\"#6495ed\",cornsilk:\"#fff8dc\",crimson:\"#dc143c\",cyan:\"#00ffff\",darkblue:\"#00008b\",darkcyan:\"#008b8b\",darkgoldenrod:\"#b8860b\",darkgray:\"#a9a9a9\",darkgreen:\"#006400\",darkgrey:\"#a9a9a9\",darkkhaki:\"#bdb76b\",darkmagenta:\"#8b008b\",darkolivegreen:\"#556b2f\",darkorange:\"#ff8c00\",darkorchid:\"#9932cc\",darkred:\"#8b0000\",darksalmon:\"#e9967a\",darkseagreen:\"#8fbc8f\",darkslateblue:\"#483d8b\",darkslategray:\"#2f4f4f\",darkslategrey:\"#2f4f4f\",darkturquoise:\"#00ced1\",darkviolet:\"#9400d3\",deeppink:\"#ff1493\",deepskyblue:\"#00bfff\",dimgray:\"#696969\",dimgrey:\"#696969\",dodgerblue:\"#1e90ff\",firebrick:\"#b22222\",floralwhite:\"#fffaf0\",forestgreen:\"#228b22\",fuchsia:\"#ff00ff\",gainsboro:\"#dcdcdc\",ghostwhite:\"#f8f8ff\",goldenrod:\"#daa520\",gold:\"#ffd700\",gray:\"#808080\",green:\"#008000\",greenyellow:\"#adff2f\",grey:\"#808080\",honeydew:\"#f0fff0\",hotpink:\"#ff69b4\",indianred:\"#cd5c5c\",indigo:\"#4b0082\",ivory:\"#fffff0\",khaki:\"#f0e68c\",lavenderblush:\"#fff0f5\",lavender:\"#e6e6fa\",lawngreen:\"#7cfc00\",lemonchiffon:\"#fffacd\",lightblue:\"#add8e6\",lightcoral:\"#f08080\",lightcyan:\"#e0ffff\",lightgoldenrodyellow:\"#fafad2\",lightgray:\"#d3d3d3\",lightgreen:\"#90ee90\",lightgrey:\"#d3d3d3\",lightpink:\"#ffb6c1\",lightsalmon:\"#ffa07a\",lightseagreen:\"#20b2aa\",lightskyblue:\"#87cefa\",lightslategray:\"#778899\",lightslategrey:\"#778899\",lightsteelblue:\"#b0c4de\",lightyellow:\"#ffffe0\",lime:\"#00ff00\",limegreen:\"#32cd32\",linen:\"#faf0e6\",magenta:\"#ff00ff\",maroon:\"#800000\",mediumaquamarine:\"#66cdaa\",mediumblue:\"#0000cd\",mediumorchid:\"#ba55d3\",mediumpurple:\"#9370db\",mediumseagreen:\"#3cb371\",mediumslateblue:\"#7b68ee\",mediumspringgreen:\"#00fa9a\",mediumturquoise:\"#48d1cc\",mediumvioletred:\"#c71585\",midnightblue:\"#191970\",mintcream:\"#f5fffa\",mistyrose:\"#ffe4e1\",moccasin:\"#ffe4b5\",navajowhite:\"#ffdead\",navy:\"#000080\",oldlace:\"#fdf5e6\",olive:\"#808000\",olivedrab:\"#6b8e23\",orange:\"#ffa500\",orangered:\"#ff4500\",orchid:\"#da70d6\",palegoldenrod:\"#eee8aa\",palegreen:\"#98fb98\",paleturquoise:\"#afeeee\",palevioletred:\"#db7093\",papayawhip:\"#ffefd5\",peachpuff:\"#ffdab9\",peru:\"#cd853f\",pink:\"#ffc0cb\",plum:\"#dda0dd\",powderblue:\"#b0e0e6\",purple:\"#800080\",rebeccapurple:\"#663399\",red:\"#ff0000\",rosybrown:\"#bc8f8f\",royalblue:\"#4169e1\",saddlebrown:\"#8b4513\",salmon:\"#fa8072\",sandybrown:\"#f4a460\",seagreen:\"#2e8b57\",seashell:\"#fff5ee\",sienna:\"#a0522d\",silver:\"#c0c0c0\",skyblue:\"#87ceeb\",slateblue:\"#6a5acd\",slategray:\"#708090\",slategrey:\"#708090\",snow:\"#fffafa\",springgreen:\"#00ff7f\",steelblue:\"#4682b4\",tan:\"#d2b48c\",teal:\"#008080\",thistle:\"#d8bfd8\",tomato:\"#ff6347\",turquoise:\"#40e0d0\",violet:\"#ee82ee\",wheat:\"#f5deb3\",white:\"#ffffff\",whitesmoke:\"#f5f5f5\",yellow:\"#ffff00\",yellowgreen:\"#9acd32\"};function g(e,r){return void 0===r&&(r=[]),r[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,r}function b(e){var r=e.toString(16);return\"#\"+(r=\"000000\".substr(0,6-r.length)+r)}function h(e){return\"string\"==typeof e&&\"#\"===(e=s[e.toLowerCase()]||e)[0]&&(e=e.substr(1)),parseInt(e,16)}function p(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)}var v=function(){for(var e=[],r=[],t=0;t<32;t++)e[t]=t,r[t]=t;e[a.NORMAL_NPM]=a.NORMAL,e[a.ADD_NPM]=a.ADD,e[a.SCREEN_NPM]=a.SCREEN,r[a.NORMAL]=a.NORMAL_NPM,r[a.ADD]=a.ADD_NPM,r[a.SCREEN]=a.SCREEN_NPM;var n=[];return n.push(r),n.push(e),n}();function m(e,r){return v[r?1:0][e]}function y(e,r,t,n){return t=t||new Float32Array(4),n||void 0===n?(t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r):(t[0]=e[0],t[1]=e[1],t[2]=e[2]),t[3]=r,t}function w(e,r){if(1===r)return(255*r<<24)+e;if(0===r)return 0;var t=e>>16&255,n=e>>8&255,a=255&e;return(255*r<<24)+((t=t*r+.5|0)<<16)+((n=n*r+.5|0)<<8)+(a=a*r+.5|0)}function k(e,r,t,n){return(t=t||new Float32Array(4))[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,(n||void 0===n)&&(t[0]*=r,t[1]*=r,t[2]*=r),t[3]=r,t}function A(e,r){void 0===r&&(r=null);var t=6*e;if((r=r||new Uint16Array(t)).length!==t)throw new Error(\"Out buffer length is incorrect, got \"+r.length+\" and expected \"+t);for(var n=0,a=0;n>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1}function _(e){return!(e&e-1||!e)}function N(e){var r=(e>65535?1:0)<<4,t=((e>>>=r)>255?1:0)<<3;return r|=t,r|=t=((e>>>=t)>15?1:0)<<2,(r|=t=((e>>>=t)>3?1:0)<<1)|(e>>>=t)>>1}function P(e,r,t){var n,a=e.length;if(!(r>=a||0===t)){var f=a-(t=r+t>a?a-r:t);for(n=r;n=this.x&&t=this.y&&ii!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),a=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){if(i>=this.y+this.radius&&i<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var h=t-(this.x+this.radius),s=i-(this.y+this.radius),o=this.radius*this.radius;if(h*h+s*s<=o)return!0;if((h=t-(this.x+this.width-this.radius))*h+s*s<=o)return!0;if(h*h+(s=i-(this.y+this.height-this.radius))*s<=o)return!0;if((h=t-(this.x+this.radius))*h+s*s<=o)return!0}return!1},i}(),c=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),u=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,\"x\",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"y\",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),y=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new c;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new c;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,o=t.y;return i.x=this.d*h*s+-this.c*h*o+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*o+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var h=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,h),c=Math.abs(e+a);return c<1e-5||Math.abs(i-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(h*h+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*h+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,\"IDENTITY\",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,\"TEMP_MATRIX\",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),p=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],d=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],f=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],x=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],l=[],b=[],v=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];l.push(i);for(var h=0;h<16;h++)for(var s=v(p[t]*p[h]+f[t]*d[h]),o=v(d[t]*p[h]+x[t]*d[h]),n=v(p[t]*f[h]+f[t]*x[h]),r=v(d[t]*f[h]+x[t]*x[h]),e=0;e<16;e++)if(p[e]===s&&d[e]===o&&f[e]===n&&x[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new y;a.set(p[t],d[t],f[t],x[t],0,0),b.push(a)}}();var w={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return p[t]},uY:function(t){return d[t]},vX:function(t){return f[t]},vY:function(t){return x[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return l[t][i]},sub:function(t,i){return l[t][w.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?w.S:w.N:2*Math.abs(i)<=Math.abs(t)?t>0?w.E:w.W:i>0?t>0?w.SE:w.SW:t>0?w.NE:w.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=b[w.inv(i)];o.tx=h,o.ty=s,t.append(o)}},_=function(){function t(){this.worldTransform=new y,this.localTransform=new y,this.position=new u(this.onChange,this,0,0),this.scale=new u(this.onChange,this,1,1),this.pivot=new u(this.onChange,this,0,0),this.skew=new u(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,\"rotation\",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();export{n as Circle,s as DEG_TO_RAD,r as Ellipse,y as Matrix,u as ObservablePoint,i as PI_2,c as Point,e as Polygon,h as RAD_TO_DEG,o as Rectangle,a as RoundedRectangle,t as SHAPES,_ as Transform,w as groupD8};\n//# sourceMappingURL=math.min.js.map\n","/*!\n * @pixi/display - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/display is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{settings as t}from\"@pixi/settings\";import{Rectangle as i,RAD_TO_DEG as e,DEG_TO_RAD as n,Transform as r}from\"@pixi/math\";import{EventEmitter as s,removeItems as o}from\"@pixi/utils\";t.SORTABLE_CHILDREN=!1;var h=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?i.EMPTY:((t=t||new i(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,i){var e=t.a,n=t.b,r=t.c,s=t.d,o=t.tx,h=t.ty,a=e*i.x+r*i.y+o,l=n*i.x+s*i.y+h;this.minX=Math.min(this.minX,a),this.maxX=Math.max(this.maxX,a),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},t.prototype.addQuad=function(t){var i=this.minX,e=this.minY,n=this.maxX,r=this.maxY,s=t[0],o=t[1];i=sn?s:n,r=o>r?o:r,i=(s=t[2])n?s:n,r=o>r?o:r,i=(s=t[4])n?s:n,r=o>r?o:r,i=(s=t[6])n?s:n,r=o>r?o:r,this.minX=i,this.minY=e,this.maxX=n,this.maxY=r},t.prototype.addFrame=function(t,i,e,n,r){this.addFrameMatrix(t.worldTransform,i,e,n,r)},t.prototype.addFrameMatrix=function(t,i,e,n,r){var s=t.a,o=t.b,h=t.c,a=t.d,l=t.tx,d=t.ty,p=this.minX,m=this.minY,u=this.maxX,c=this.maxY,f=s*i+h*e+l,y=o*i+a*e+d;p=fu?f:u,c=y>c?y:c,p=(f=s*n+h*e+l)u?f:u,c=y>c?y:c,p=(f=s*i+h*r+l)u?f:u,c=y>c?y:c,p=(f=s*n+h*r+l)u?f:u,c=y>c?y:c,this.minX=p,this.minY=m,this.maxX=u,this.maxY=c},t.prototype.addVertexData=function(t,i,e){for(var n=this.minX,r=this.minY,s=this.maxX,o=this.maxY,h=i;hs?a:s,o=l>o?l:o}this.minX=n,this.minY=r,this.maxX=s,this.maxY=o},t.prototype.addVertices=function(t,i,e,n){this.addVerticesMatrix(t.worldTransform,i,e,n)},t.prototype.addVerticesMatrix=function(t,i,e,n,r,s){void 0===r&&(r=0),void 0===s&&(s=r);for(var o=t.a,h=t.b,a=t.c,l=t.d,d=t.tx,p=t.ty,m=this.minX,u=this.minY,c=this.maxX,f=this.maxY,y=e;yn?t.maxX:n,this.maxY=t.maxY>r?t.maxY:r},t.prototype.addBoundsMask=function(t,i){var e=t.minX>i.minX?t.minX:i.minX,n=t.minY>i.minY?t.minY:i.minY,r=t.maxXa?r:a,this.maxY=s>l?s:l}},t.prototype.addBoundsMatrix=function(t,i){this.addFrameMatrix(i,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,i){var e=t.minX>i.x?t.minX:i.x,n=t.minY>i.y?t.minY:i.y,r=t.maxXa?r:a,this.maxY=s>l?s:l}},t.prototype.pad=function(t,i){void 0===t&&(t=0),void 0===i&&(i=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i)},t.prototype.addFramePad=function(t,i,e,n,r,s){t-=r,i-=s,e+=r,n+=s,this.minX=this.minXe?this.maxX:e,this.minY=this.minYn?this.maxY:n},t}(),a=function(t,i){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(t,i)};function l(t,i){function e(){this.constructor=t}a(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}var d=function(t){function s(){var i=t.call(this)||this;return i.tempDisplayObjectParent=null,i.transform=new r,i.alpha=1,i.visible=!0,i.renderable=!0,i.parent=null,i.worldAlpha=1,i._lastSortedIndex=0,i._zIndex=0,i.filterArea=null,i.filters=null,i._enabledFilters=null,i._bounds=new h,i._localBounds=null,i._boundsID=0,i._boundsRect=null,i._localBoundsRect=null,i._mask=null,i._destroyed=!1,i.isSprite=!1,i.isMask=!1,i}return l(s,t),s.mixin=function(t){for(var i=Object.keys(t),e=0;e1)for(var n=0;nthis.children.length)throw new Error(t+\"addChildAt: The index \"+i+\" 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(i,0,t),this._boundsID++,this.onChildrenChange(i),t.emit(\"added\",this),this.emit(\"childAdded\",t,this,i),t},e.prototype.swapChildren=function(t,i){if(t!==i){var e=this.getChildIndex(t),n=this.getChildIndex(i);this.children[e]=i,this.children[n]=t,this.onChildrenChange(e=this.children.length)throw new Error(\"The index \"+i+\" supplied is out of bounds \"+this.children.length);var e=this.getChildIndex(t);o(this.children,e,1),this.children.splice(i,0,t),this.onChildrenChange(i)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error(\"getChildAt: Index (\"+t+\") does not exist.\");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,i=[],e=0;e1)for(var n=0;n0&&r<=i){e=this.children.splice(n,r);for(var s=0;s1&&this.children.sort(m),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,i=this.children.length;t title : \"+e.title+\"
tabIndex: \"+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,s=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>s&&(e.height=s-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement(\"button\")).style.width=n+\"px\",t.style.height=n+\"px\",t.style.backgroundColor=this.debug?\"rgba(255,255,255,0.5)\":\"transparent\",t.style.position=\"absolute\",t.style.zIndex=l.toString(),t.style.borderStyle=\"none\",navigator.userAgent.toLowerCase().indexOf(\"chrome\")>-1?t.setAttribute(\"aria-live\",\"off\"):t.setAttribute(\"aria-live\",\"polite\"),navigator.userAgent.match(/rv:.*Gecko\\//)?t.setAttribute(\"aria-relevant\",\"additions\"):t.setAttribute(\"aria-relevant\",\"text\"),t.addEventListener(\"click\",this._onClick.bind(this)),t.addEventListener(\"focus\",this._onFocus.bind(this)),t.addEventListener(\"focusout\",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title=\"displayObject \"+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute(\"aria-label\",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,\"click\",s),t.dispatchEvent(i,\"pointertap\",s),t.dispatchEvent(i,\"tap\",s)},e.prototype._onFocus=function(e){e.target.getAttribute(\"aria-live\")||e.target.setAttribute(\"aria-live\",\"assertive\");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,\"mouseover\",s)},e.prototype._onFocusOut=function(e){e.target.getAttribute(\"aria-live\")||e.target.setAttribute(\"aria-live\",\"polite\");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,\"mouseout\",s)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,self.document.removeEventListener(\"mousemove\",this._onMouseMove,!0),self.removeEventListener(\"keydown\",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e}();export{a as AccessibilityManager,s as accessibleTarget};\n//# sourceMappingURL=accessibility.min.js.map\n","/*!\n * @pixi/ticker - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/ticker is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{settings as t}from\"@pixi/settings\";var e;t.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]=\"INTERACTION\",t[t.HIGH=25]=\"HIGH\",t[t.NORMAL=0]=\"NORMAL\",t[t.LOW=-25]=\"LOW\",t[t.UTILITY=-50]=\"UTILITY\"}(e||(e={}));var i=function(){function t(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=0),void 0===s&&(s=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=s}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),s=function(){function s(){var e=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new i(null,null,1/0),this.deltaMS=1/t.TARGET_FPMS,this.elapsedMS=1/t.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&null===e._requestId&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return s.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},s.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},s.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},s.prototype.add=function(t,s,n){return void 0===n&&(n=e.NORMAL),this._addListener(new i(t,s,n))},s.prototype.addOnce=function(t,s,n){return void 0===n&&(n=e.NORMAL),this._addListener(new i(t,s,n,!0))},s.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},s.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(s.prototype,\"count\",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),s.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},s.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},s.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},s.prototype.update=function(e){var i;if(void 0===e&&(e=performance.now()),e>this.lastTime){if((i=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS){var s=e-this._lastFrame|0;if(s=0;p--){var u=c[p],l=this.recursiveFindHit(t,u,i,n,a);if(l){if(!u.parent)continue;a=!1,l&&(t.target&&(n=!1),s=!0)}}return o&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(r)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},e.prototype.findHit=function(t,e,i,n){this.recursiveFindHit(t,e,i,n,!1)},e}(),u={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return\"pointer\"===this.cursor},set buttonMode(t){t?this.cursor=\"pointer\":\"pointer\"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};n.mixin(u);var l=1,d={target:null,data:{global:null}},v=function(t){function n(e,i){var n=t.call(this)||this;return i=i||{},n.renderer=e,n.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new s,n.mouse.identifier=l,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[l]=n.mouse,n.interactionDataPool=[],n.eventData=new h,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!(\"PointerEvent\"in self),n.supportsTouchEvents=\"ontouchstart\"in self,n.supportsPointerEvents=!!self.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:\"inherit\",pointer:\"pointer\"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new p,n._tempDisplayObject=new o,n._useSystemTicker=void 0===i.useSystemTicker||i.useSystemTicker,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return function(t,e){function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(n,t),Object.defineProperty(n.prototype,\"useSystemTicker\",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"lastObjectRendered\",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),n.prototype.hitTest=function(t,e){return d.target=null,d.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(d,e,null,!0),d.target},n.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},n.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(e.system.add(this.tickerUpdate,this,i.INTERACTION),this.tickerAdded=!0)},n.prototype.removeTickerListener=function(){this.tickerAdded&&(e.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},n.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;self.navigator.msPointerEnabled?(t.msContentZooming=\"none\",t.msTouchAction=\"none\"):this.supportsPointerEvents&&(t.touchAction=\"none\"),this.supportsPointerEvents?(self.document.addEventListener(\"pointermove\",this.onPointerMove,!0),this.interactionDOMElement.addEventListener(\"pointerdown\",this.onPointerDown,!0),this.interactionDOMElement.addEventListener(\"pointerleave\",this.onPointerOut,!0),this.interactionDOMElement.addEventListener(\"pointerover\",this.onPointerOver,!0),self.addEventListener(\"pointercancel\",this.onPointerCancel,!0),self.addEventListener(\"pointerup\",this.onPointerUp,!0)):(self.document.addEventListener(\"mousemove\",this.onPointerMove,!0),this.interactionDOMElement.addEventListener(\"mousedown\",this.onPointerDown,!0),this.interactionDOMElement.addEventListener(\"mouseout\",this.onPointerOut,!0),this.interactionDOMElement.addEventListener(\"mouseover\",this.onPointerOver,!0),self.addEventListener(\"mouseup\",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener(\"touchstart\",this.onPointerDown,!0),this.interactionDOMElement.addEventListener(\"touchcancel\",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener(\"touchend\",this.onPointerUp,!0),this.interactionDOMElement.addEventListener(\"touchmove\",this.onPointerMove,!0)),this.eventsAdded=!0}},n.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;self.navigator.msPointerEnabled?(t.msContentZooming=\"\",t.msTouchAction=\"\"):this.supportsPointerEvents&&(t.touchAction=\"\"),this.supportsPointerEvents?(self.document.removeEventListener(\"pointermove\",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener(\"pointerdown\",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener(\"pointerleave\",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener(\"pointerover\",this.onPointerOver,!0),self.removeEventListener(\"pointercancel\",this.onPointerCancel,!0),self.removeEventListener(\"pointerup\",this.onPointerUp,!0)):(self.document.removeEventListener(\"mousemove\",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener(\"mousedown\",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener(\"mouseout\",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener(\"mouseover\",this.onPointerOver,!0),self.removeEventListener(\"mouseup\",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener(\"touchstart\",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener(\"touchcancel\",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener(\"touchend\",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener(\"touchmove\",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1}},n.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime8)throw new Error(\"max arguments reached\");var u=this.name,a=this.items;this._aliasCount++;for(var m=0,p=a.length;m0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,\"empty\",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"name\",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(t.prototype,{dispatch:{value:t.prototype.emit},run:{value:t.prototype.emit}});export{t as Runner};\n//# sourceMappingURL=runner.min.js.map\n","/*!\n * @pixi/core - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/core is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{settings as e}from\"@pixi/settings\";import{ENV as t,ALPHA_MODES as r,SCALE_MODES as i,FORMATS as n,TYPES as o,TARGETS as s,MIPMAP_MODES as a,MSAA_QUALITY as u,CLEAR_MODES as h,DRAW_MODES as l,BUFFER_BITS as d,MASK_TYPES as c,PRECISION as f,BLEND_MODES as p,GC_MODES as m,WRAP_MODES as v,RENDERER_TYPE as g}from\"@pixi/constants\";import{isMobile as y,isPow2 as _,BaseTextureCache as x,TextureCache as b,uid as T,EventEmitter as E,determineCrossOrigin as w,getResolutionOfUrl as S,nextPow2 as A,ProgramCache as C,removeItems as I,hex2string as R,hex2rgb as F,sayHello as O,isWebGLSupported as P,premultiplyBlendMode as M,log2 as N,premultiplyTint as U}from\"@pixi/utils\";import{Runner as L}from\"@pixi/runner\";import{Ticker as B}from\"@pixi/ticker\";import{groupD8 as D,Rectangle as k,Point as G,Matrix as V}from\"@pixi/math\";e.PREFER_ENV=y.any?t.WEBGL:t.WEBGL2,e.STRICT_TEXTURE_CACHE=!1;var j=[];function H(e,t){if(!e)return null;var r=\"\";if(\"string\"==typeof e){var i=/\\.(\\w{3,4})(?:$|\\?|#)/i.exec(e);i&&(r=i[1].toLowerCase())}for(var n=j.length-1;n>=0;--n){var o=j[n];if(o.test&&o.test(e,r))return new o(e,t)}throw new Error(\"Unrecognized source type to auto-detect Resource\")}var X=function(e,t){return(X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function z(e,t){function r(){this.constructor=e}X(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var W=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new L(\"setRealSize\"),this.onUpdate=new L(\"update\"),this.onError=new L(\"onError\")}return e.prototype.bind=function(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},e.prototype.unbind=function(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)},e.prototype.resize=function(e,t){e===this._width&&t===this._height||(this._width=e,this._height=t,this.onResize.emit(e,t))},Object.defineProperty(e.prototype,\"valid\",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),e.prototype.update=function(){this.destroyed||this.onUpdate.emit()},e.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(e.prototype,\"width\",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"height\",{get:function(){return this._height},enumerable:!1,configurable:!0}),e.prototype.style=function(e,t,r){return!1},e.prototype.dispose=function(){},e.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},e.test=function(e,t){return!1},e}(),Y=function(e){function t(t,r){var i=this,n=r||{},o=n.width,s=n.height;if(!o||!s)throw new Error(\"BufferResource width or height invalid\");return(i=e.call(this,o,s)||this).data=t,i}return z(t,e),t.prototype.upload=function(e,t,i){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===r.UNPACK);var o=t.realWidth,s=t.realHeight;return i.width===o&&i.height===s?n.texSubImage2D(t.target,0,0,0,o,s,t.format,t.type,this.data):(i.width=o,i.height=s,n.texImage2D(t.target,0,i.internalFormat,o,s,0,t.format,i.type,this.data)),!0},t.prototype.dispose=function(){this.data=null},t.test=function(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array},t}(W),K={scaleMode:i.NEAREST,format:n.RGBA,alphaMode:r.NPM},q=function(t){function i(i,a){void 0===i&&(i=null),void 0===a&&(a=null);var u=t.call(this)||this,h=(a=a||{}).alphaMode,l=a.mipmap,d=a.anisotropicLevel,c=a.scaleMode,f=a.width,p=a.height,m=a.wrapMode,v=a.format,g=a.type,y=a.target,_=a.resolution,x=a.resourceOptions;return!i||i instanceof W||((i=H(i,x)).internal=!0),u.width=f||0,u.height=p||0,u.resolution=_||e.RESOLUTION,u.mipmap=void 0!==l?l:e.MIPMAP_TEXTURES,u.anisotropicLevel=void 0!==d?d:e.ANISOTROPIC_LEVEL,u.wrapMode=m||e.WRAP_MODE,u.scaleMode=void 0!==c?c:e.SCALE_MODE,u.format=v||n.RGBA,u.type=g||o.UNSIGNED_BYTE,u.target=y||s.TEXTURE_2D,u.alphaMode=void 0!==h?h:r.UNPACK,u.uid=T(),u.touched=0,u.isPowerOfTwo=!1,u._refreshPOT(),u._glTextures={},u.dirtyId=0,u.dirtyStyleId=0,u.cacheId=null,u.valid=f>0&&p>0,u.textureCacheIds=[],u.destroyed=!1,u.resource=null,u._batchEnabled=0,u._batchLocation=0,u.parentTextureArray=null,u.setResource(i),u}return z(i,t),Object.defineProperty(i.prototype,\"realWidth\",{get:function(){return Math.ceil(this.width*this.resolution-1e-4)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"realHeight\",{get:function(){return Math.ceil(this.height*this.resolution-1e-4)},enumerable:!1,configurable:!0}),i.prototype.setStyle=function(e,t){var r;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this},i.prototype.setSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=e,this.height=t,this._refreshPOT(),this.update(),this},i.prototype.setRealSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=e/this.resolution,this.height=t/this.resolution,this._refreshPOT(),this.update(),this},i.prototype._refreshPOT=function(){this.isPowerOfTwo=_(this.realWidth)&&_(this.realHeight)},i.prototype.setResolution=function(e){var t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=this.width*t/e,this.height=this.height*t/e,this.emit(\"update\",this)),this._refreshPOT(),this)},i.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error(\"Resource can be set only once\");return e.bind(this),this.resource=e,this},i.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit(\"update\",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit(\"loaded\",this),this.emit(\"update\",this))},i.prototype.onError=function(e){this.emit(\"error\",this,e)},i.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete x[this.cacheId],delete b[this.cacheId],this.cacheId=null),this.dispose(),i.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},i.prototype.dispose=function(){this.emit(\"dispose\",this)},i.prototype.castToBaseTexture=function(){return this},i.from=function(t,r,n){void 0===n&&(n=e.STRICT_TEXTURE_CACHE);var o=\"string\"==typeof t,s=null;if(o)s=t;else{if(!t._pixiId){var a=r&&r.pixiIdPrefix||\"pixiid\";t._pixiId=a+\"_\"+T()}s=t._pixiId}var u=x[s];if(o&&n&&!u)throw new Error('The cacheId \"'+s+'\" does not exist in BaseTextureCache.');return u||((u=new i(t,r)).cacheId=s,i.addToCache(u,s)),u},i.fromBuffer=function(e,t,r,n){e=e||new Float32Array(t*r*4);var s=new Y(e,{width:t,height:r}),a=e instanceof Float32Array?o.FLOAT:o.UNSIGNED_BYTE;return new i(s,Object.assign(K,n||{width:t,height:r,type:a}))},i.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),x[t]&&console.warn(\"BaseTexture added to the cache with an id [\"+t+\"] that already had an entry\"),x[t]=e)},i.removeFromCache=function(e){if(\"string\"==typeof e){var t=x[e];if(t){var r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete x[e],t}}else if(e&&e.textureCacheIds){for(var i=0;i0){if(!e.resource)throw new Error(\"CubeResource does not support copying of renderTexture.\");this.addResourceAt(e.resource,t)}else e.target=s.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,r,i){for(var n=this.itemDirtyIds,o=0;o]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*>/i,t}(Q),ie=function(e){function t(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement(\"video\");o.setAttribute(\"preload\",\"auto\"),o.setAttribute(\"webkit-playsinline\",\"\"),o.setAttribute(\"playsinline\",\"\"),\"string\"==typeof r&&(r=[r]);var s=r[0].src||r[0];Q.crossOrigin(o,s,i.crossorigin);for(var a=0;a0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(B.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(B.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener(\"canplay\",this._onCanPlay),e.removeEventListener(\"canplaythrough\",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&B.shared.remove(this.update,this);var t=this.source;t&&(t.removeEventListener(\"error\",this._onError,!0),t.pause(),t.src=\"\",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,\"autoUpdate\",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(B.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(B.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"updateFPS\",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,r){return self.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(r)>-1},t.TYPES=[\"mp4\",\"m4v\",\"webm\",\"ogg\",\"ogv\",\"h264\",\"avi\",\"mov\"],t.MIME_TYPES={ogv:\"video/ogg\",mov:\"video/quicktime\",m4v:\"video/mp4\"},t}(Q),ne=function(e){function t(t){return e.call(this,t)||this}return z(t,e),t.test=function(e){return!!self.createImageBitmap&&e instanceof ImageBitmap},t}(Q);j.push(te,ne,J,ie,re,Y,ee,$);var oe={__proto__:null,Resource:W,BaseImageResource:Q,INSTALLED:j,autoDetectResource:H,AbstractMultiResource:Z,ArrayResource:$,BufferResource:Y,CanvasResource:J,CubeResource:ee,ImageResource:te,SVGResource:re,VideoResource:ie,ImageBitmapResource:ne},se=function(){function e(e){this.renderer=e}return e.prototype.destroy=function(){this.renderer=null},e}(),ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return z(t,e),t.prototype.upload=function(e,t,i){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===r.UNPACK);var o=t.realWidth,s=t.realHeight;return i.width===o&&i.height===s?n.texSubImage2D(t.target,0,0,0,o,s,t.format,t.type,this.data):(i.width=o,i.height=s,n.texImage2D(t.target,0,1===e.context.webGLVersion?n.DEPTH_COMPONENT:n.DEPTH_COMPONENT16,o,s,0,t.format,t.type,this.data)),!0},t}(Y),ue=function(){function e(e,t){this.width=Math.ceil(e||100),this.height=Math.ceil(t||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 L(\"disposeFramebuffer\"),this.multisample=u.NONE}return Object.defineProperty(e.prototype,\"colorTexture\",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new q(null,{scaleMode:i.NEAREST,resolution:1,mipmap:a.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new q(new ae(null,{width:this.width,height:this.height}),{scaleMode:i.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:a.OFF,format:n.DEPTH_COMPONENT,type:o.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.ceil(e),t=Math.ceil(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&t.textureCacheIds.splice(r,1),delete b[e],t}}else if(e&&e.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?\"and\":\"or\",u=\"X: \"+t+\" + \"+i+\" = \"+(t+i)+\" > \"+this.baseTexture.width,h=\"Y: \"+r+\" + \"+n+\" = \"+(r+n)+\" > \"+this.baseTexture.height;throw new Error(\"Texture Error: frame does not fit inside the base Texture dimensions: \"+u+\" \"+a+\" \"+h)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"rotate\",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"width\",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"height\",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),r.prototype.castToBaseTexture=function(){return this.baseTexture},r}(E);function fe(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}ce.EMPTY=new ce(new q),fe(ce.EMPTY),fe(ce.EMPTY.baseTexture),ce.WHITE=function(){var e=document.createElement(\"canvas\");e.width=16,e.height=16;var t=e.getContext(\"2d\");return t.fillStyle=\"white\",t.fillRect(0,0,16,16),new ce(new q(new J(e)))}(),fe(ce.WHITE),fe(ce.WHITE.baseTexture);var pe=function(e){function t(t,r){var i=e.call(this,t,r)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return z(t,e),Object.defineProperty(t.prototype,\"framebuffer\",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,r){void 0===r&&(r=!0),e=Math.ceil(e),t=Math.ceil(t),this.valid=e>0&&t>0,this._frame.width=this.orig.width=e,this._frame.height=this.orig.height=t,r&&this.baseTexture.resize(e,t),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var r=arguments,i=[],n=1;n0&&t.height>0,i)for(var n=0;n1){for(var h=0;h1&&this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,t.renderTexture,u.renderTexture,h.BLEND,t),this.returnFilterTexture(t.renderTexture);else{var l=t.renderTexture,d=this.getOptimalFilterTexture(l.width,l.height,t.resolution);d.filterFrame=l.filterFrame;var c=0;for(c=0;c=0;--i)e[i]=r[i]||null,e[i]&&(e[i]._batchLocation=i)},t.prototype.boundArray=function(e,t,r,i){for(var n=e.elements,o=e.ids,s=e.count,a=0,u=0;u=0&&l=t.WEBGL2&&(n=r.getContext(\"webgl2\",i)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=r.getContext(\"webgl\",i)||r.getContext(\"experimental-webgl\",i)))throw new Error(\"This browser does not support WebGL. Try using the canvas renderer\");return this.gl=n,this.getExtensions(),this.gl},i.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension(\"EXT_texture_filter_anisotropic\"),floatTextureLinear:e.getExtension(\"OES_texture_float_linear\"),s3tc:e.getExtension(\"WEBGL_compressed_texture_s3tc\"),s3tc_sRGB:e.getExtension(\"WEBGL_compressed_texture_s3tc_srgb\"),etc:e.getExtension(\"WEBGL_compressed_texture_etc\"),etc1:e.getExtension(\"WEBGL_compressed_texture_etc1\"),pvrtc:e.getExtension(\"WEBGL_compressed_texture_pvrtc\")||e.getExtension(\"WEBKIT_WEBGL_compressed_texture_pvrtc\"),atc:e.getExtension(\"WEBGL_compressed_texture_atc\"),astc:e.getExtension(\"WEBGL_compressed_texture_astc\")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension(\"WEBGL_draw_buffers\"),depthTexture:e.getExtension(\"WEBGL_depth_texture\"),loseContext:e.getExtension(\"WEBGL_lose_context\"),vertexArrayObject:e.getExtension(\"OES_vertex_array_object\")||e.getExtension(\"MOZ_OES_vertex_array_object\")||e.getExtension(\"WEBKIT_OES_vertex_array_object\"),uint32ElementIndex:e.getExtension(\"OES_element_index_uint\"),floatTexture:e.getExtension(\"OES_texture_float\"),floatTextureLinear:e.getExtension(\"OES_texture_float_linear\"),textureHalfFloat:e.getExtension(\"OES_texture_half_float\"),textureHalfFloatLinear:e.getExtension(\"OES_texture_half_float_linear\")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension(\"EXT_color_buffer_float\")})},i.prototype.handleContextLost=function(e){e.preventDefault()},i.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},i.prototype.destroy=function(){var e=this.renderer.view;e.removeEventListener(\"webglcontextlost\",this.handleContextLost),e.removeEventListener(\"webglcontextrestored\",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},i.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},i.prototype.validateContext=function(e){var t=e.getContextAttributes(),r=\"WebGL2RenderingContext\"in self&&e instanceof self.WebGL2RenderingContext;r&&(this.webGLVersion=2),t.stencil||console.warn(\"Provided WebGL context does not have a stencil buffer, masks may not render correctly\");var i=r||!!e.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\")},i}(se),Be=function(){return function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.multisample=u.NONE,this.msaaBuffer=null,this.blitFramebuffer=null}}(),De=new k,ke=function(r){function i(e){var t=r.call(this,e)||this;return t.managedFramebuffers=[],t.unknownFramebuffer=new ue(10,10),t.msaaSamples=null,t}return z(i,r),i.prototype.contextChange=function(){var r=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new k,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var i=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;e.PREFER_ENV===t.WEBGL_LEGACY&&(i=null,n=null),i?r.drawBuffers=function(e){return i.drawBuffersWEBGL(e)}:(this.hasMRT=!1,r.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=r.getInternalformatParameter(r.RENDERBUFFER,r.RGBA8,r.SAMPLES)},i.prototype.bind=function(e,t){var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,this.updateFramebuffer(e)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var n=0;n1&&(r.msaaBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,r.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.RGBA8,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,r.msaaBuffer));for(var n=[],o=0;o1)){var s=e.colorTextures[o],a=s.parentTextureArray||s;this.renderer.texture.bind(a,0),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+o,s.target,a._glTextures[this.CONTEXT_UID].texture,0),n.push(t.COLOR_ATTACHMENT0+o)}if((n.length>1&&t.drawBuffers(n),e.depthTexture)&&this.writeDepthTexture){var u=e.depthTexture;this.renderer.texture.bind(u,0),t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,u._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!e.stencil&&!e.depth||(r.stencil=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,r.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height),e.depthTexture||t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,r.stencil))},i.prototype.detectSamples=function(e){var t=this.msaaSamples,r=u.NONE;if(e<=1||null===t)return r;for(var i=0;i=0&&this.managedFramebuffers.splice(n,1),e.disposeRunner.remove(this),t||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},i.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)t.bufferSubData(o,0,i.data);else{var s=i.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,t.bufferData(o,i.data,s)}}}},i.prototype.checkCompatibility=function(e,t){var r=e.attributes,i=t.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the \"'+n+'\" attribute')},i.prototype.getSignature=function(e,t){var r=e.attributes,i=t.attributeData,n=[\"g\",e.id];for(var o in r)i[o]&&n.push(o);return n.join(\"-\")},i.prototype.initGeometryVao=function(e,t,r){void 0===r&&(r=!0),this.checkCompatibility(e,t);var i=this.gl,n=this.CONTEXT_UID,o=this.getSignature(e,t),s=e.glVertexArrayObjects[this.CONTEXT_UID],a=s[o];if(a)return s[t.id]=a,a;var u=e.buffers,h=e.attributes,l={},d={};for(var c in u)l[c]=0,d[c]=0;for(var c in h)!h[c].size&&t.attributeData[c]?h[c].size=t.attributeData[c].size:h[c].size||console.warn(\"PIXI Geometry attribute '\"+c+\"' size cannot be determined (likely the bound shader does not have the attribute)\"),l[h[c].buffer]+=h[c].size*Ve[h[c].type];for(var c in h){var f=h[c],p=f.size;void 0===f.stride&&(l[f.buffer]===p*Ve[f.type]?f.stride=0:f.stride=l[f.buffer]),void 0===f.start&&(f.start=d[f.buffer],d[f.buffer]+=p*Ve[f.type])}a=i.createVertexArray(),i.bindVertexArray(a);for(var m=0;m=t.WEBGL2&&(i=r.getContext(\"webgl2\",{})),i||((i=r.getContext(\"webgl\",{})||r.getContext(\"experimental-webgl\",{}))?i.getExtension(\"WEBGL_draw_buffers\"):i=null),Ze=i}return Ze}function Qe(e,t,r){if(\"precision\"!==e.substring(0,9)){var i=t;return t===f.HIGH&&r!==f.HIGH&&(i=f.MEDIUM),\"precision \"+i+\" float;\\n\"+e}return r!==f.HIGH&&\"precision highp\"===e.substring(0,15)?e.replace(\"precision highp\",\"precision mediump\"):e}var Je={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 et(e){return Je[e]}var tt=null,rt={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 it(e,t){if(!tt){var r=Object.keys(rt);tt={};for(var i=0;i0&&(t+=\"\\nelse \"),rt.name?1:-1});for(o=0;o0?this._useCurrent():e.disable(e.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,t=this.renderer.renderTexture.current,r=this.renderer.projection,i=r.transform,n=r.sourceFrame,o=r.destinationFrame,s=t?t.resolution:this.renderer.resolution,a=o.width/n.width,u=o.height/n.height,h=((e.x-n.x)*a+o.x)*s,l=((e.y-n.y)*u+o.y)*s,d=e.width*a*s,c=e.height*u*s;i&&(h+=i.tx*s,l+=i.ty*s),t||(l=this.renderer.height-c-l),this.renderer.gl.scissor(h,l,d,c)},t}(Et),St=function(e){function t(t){var r=e.call(this,t)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return z(t,e),t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,r=this.renderer.gl,i=e._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.enable(r.STENCIL_TEST)),e._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,this._getBitwiseMask()),r.stencilOp(r.KEEP,r.KEEP,r.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),this.renderer.framebuffer.blit(),t.renderable=!1,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;0===this.getStackLength()?(t.disable(t.STENCIL_TEST),t.clear(t.STENCIL_BUFFER_BIT),t.clearStencil(0)):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.getStackLength(),this._getBitwiseMask()),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t.prototype._getBitwiseMask=function(){return(1<>=1,r++;this.stateId=e.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,r=!1,i=0;ithis.maxIdle&&(e.destroyTexture(n,!0),t[i]=null,r=!0)}if(r){var o=0;for(i=0;i=0;i--)this.unload(e.children[i])},r}(se),Ht=function(){return function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=6408,this.internalFormat=5121}}(),Xt=function(e){function t(t){var r=e.call(this,t)||this;return r.boundTextures=[],r.currentLocation=-1,r.managedTextures=[],r._unknownBoundTextures=!1,r.unknownTexture=new q,r}return z(t,e),t.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var r=0;r=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=v.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},t.prototype.setStyle=function(e,t){var r=this.gl;if(t.mipmap&&e.mipmap!==a.ON_MANUAL&&r.generateMipmap(e.target),r.texParameteri(e.target,r.TEXTURE_WRAP_S,t.wrapMode),r.texParameteri(e.target,r.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===i.LINEAR){var o=Math.min(e.anisotropicLevel,r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(e.target,r.TEXTURE_MAG_FILTER,e.scaleMode===i.LINEAR?r.LINEAR:r.NEAREST)},t}(se),zt={__proto__:null,FilterSystem:Pe,BatchSystem:Ne,ContextSystem:Le,FramebufferSystem:ke,GeometrySystem:je,MaskSystem:Tt,ScissorSystem:wt,StencilSystem:St,ProjectionSystem:At,RenderTextureSystem:Rt,ShaderSystem:Nt,StateSystem:Vt,TextureGCSystem:jt,TextureSystem:Xt},Wt=new V,Yt=function(t){function r(r,i){void 0===r&&(r=g.UNKNOWN);var n=t.call(this)||this;return i=Object.assign({},e.RENDER_OPTIONS,i),n.options=i,n.type=r,n.screen=new k(0,0,i.width,i.height),n.view=i.view||document.createElement(\"canvas\"),n.resolution=i.resolution||e.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString=\"#000000\",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,void 0!==i.transparent&&(n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return z(r,t),r.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(r.prototype,\"width\",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"height\",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),r.prototype.resize=function(e,t){this.screen.width=e,this.screen.height=t,this.view.width=e*this.resolution,this.view.height=t*this.resolution,this.autoDensity&&(this.view.style.width=e+\"px\",this.view.style.height=t+\"px\"),this.emit(\"resize\",e,t)},r.prototype.generateTexture=function(e,t,r,i){0===(i=i||e.getLocalBounds(null,!0)).width&&(i.width=1),0===i.height&&(i.height=1);var n=pe.create({width:0|i.width,height:0|i.height,scaleMode:t,resolution:r});return Wt.tx=-i.x,Wt.ty=-i.y,this.render(e,{renderTexture:n,clear:!1,transform:Wt,skipUpdateTransform:!!e.parent}),n},r.prototype.destroy=function(e){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);this.plugins=null,this.type=g.UNKNOWN,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(r.prototype,\"backgroundColor\",{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=R(e),F(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"backgroundAlpha\",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),r}(E),Kt=function(e){function t(r){var i=e.call(this,g.WEBGL,r)||this;return r=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new L(\"destroy\"),contextChange:new L(\"contextChange\"),reset:new L(\"reset\"),update:new L(\"update\"),postrender:new L(\"postrender\"),prerender:new L(\"prerender\"),resize:new L(\"resize\")},i.globalUniforms=new Ie({projectionMatrix:new V},!0),i.addSystem(Tt,\"mask\").addSystem(Le,\"context\").addSystem(Vt,\"state\").addSystem(Nt,\"shader\").addSystem(Xt,\"texture\").addSystem(je,\"geometry\").addSystem(ke,\"framebuffer\").addSystem(wt,\"scissor\").addSystem(St,\"stencil\").addSystem(At,\"projection\").addSystem(jt,\"textureGC\").addSystem(Pe,\"filter\").addSystem(Rt,\"renderTexture\").addSystem(Ne,\"batch\"),i.initPlugins(t.__plugins),r.context?i.context.initFromContext(r.context):i.context.initFromOptions({alpha:!!i.useContextAlpha,antialias:r.antialias,premultipliedAlpha:i.useContextAlpha&&\"notMultiplied\"!==i.useContextAlpha,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,O(2===i.context.webGLVersion?\"WebGL 2\":\"WebGL 1\"),i.resize(i.options.width,i.options.height),i}return z(t,e),t.create=function(e){if(P())return new t(e);throw new Error('WebGL unsupported in this browser, use \"pixi.js-legacy\" for fallback canvas2d support.')},t.prototype.addSystem=function(e,t){t||(t=e.name);var r=new e(this);if(this[t])throw new Error('Whoops! The name \"'+t+'\" is already in use');for(var i in this[t]=r,this.runners)this.runners[i].add(r);return this},t.prototype.render=function(e,t){var r,i,n,o;if(t&&(t instanceof pe?(r=t,i=arguments[2],n=arguments[3],o=arguments[4]):(r=t.renderTexture,i=t.clear,n=t.transform,o=t.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit(\"prerender\"),this.projection.transform=n,!this.context.isLost){if(r||(this._lastObjectRendered=e),!o){var s=e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit(\"postrender\")}},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(t,r)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,\"extract\",{get:function(){return this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,r){t.__plugins=t.__plugins||{},t.__plugins[e]=r},t}(Yt);function qt(e){return Kt.create(e)}var Zt=\"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}\",$t=\"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\",Qt=function(){return function(){this.texArray=null,this.blend=0,this.type=l.TRIANGLES,this.start=0,this.size=0,this.data=null}}(),Jt=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},i.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,t=this.MAX_TEXTURES,r=i._textureArrayPool,n=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++q._globalBatch,u=0,h=r[0],l=0;n.copyBoundTextures(o,t);for(var d=0;d=t&&(n.boundArray(h,o,a,t),this.buildDrawCalls(h,l,d),l=d,h=r[++u],++a),c._batchEnabled=a,c.touched=s,h.elements[h.count++]=c)}h.count>0&&(n.boundArray(h,o,a,t),this.buildDrawCalls(h,l,this._bufferSize),++u,++a);for(d=0;d0&&(t+=\"\\nelse \"),r} array - Array to iterate.\n * @param {function} iterator - Function to call for each element.\n * @param {function} callback - Function to call when done, or on error.\n * @param {boolean} [deferNext=false] - Break synchronous each loop by calling next with a setTimeout of 1.\n */\n\n\nfunction eachSeries(array, iterator, callback, deferNext) {\n var i = 0;\n var len = array.length;\n\n (function next(err) {\n if (err || i === len) {\n if (callback) {\n callback(err);\n }\n\n return;\n }\n\n if (deferNext) {\n setTimeout(function () {\n iterator(array[i++], next);\n }, 1);\n } else {\n iterator(array[i++], next);\n }\n })();\n}\n/**\n * Ensures a function is only called once.\n *\n * @ignore\n * @memberof async\n * @param {function} fn - The function to wrap.\n * @return {function} The wrapping function.\n */\n\nfunction onlyOnce(fn) {\n return function onceWrapper() {\n if (fn === null) {\n throw new Error('Callback was already called.');\n }\n\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n/**\n * Async queue implementation,\n *\n * @memberof async\n * @function queue\n * @param {function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @return {*} The async queue object.\n */\n\n\nfunction queue(worker, concurrency) {\n if (concurrency == null) {\n // eslint-disable-line no-eq-null,eqeqeq\n concurrency = 1;\n } else if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var workers = 0;\n var q = {\n _tasks: [],\n concurrency: concurrency,\n saturated: _noop,\n unsaturated: _noop,\n buffer: concurrency / 4,\n empty: _noop,\n drain: _noop,\n error: _noop,\n started: false,\n paused: false,\n push: function push(data, callback) {\n _insert(data, false, callback);\n },\n kill: function kill() {\n workers = 0;\n q.drain = _noop;\n q.started = false;\n q._tasks = [];\n },\n unshift: function unshift(data, callback) {\n _insert(data, true, callback);\n },\n process: function process() {\n while (!q.paused && workers < q.concurrency && q._tasks.length) {\n var task = q._tasks.shift();\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n workers += 1;\n\n if (workers === q.concurrency) {\n q.saturated();\n }\n\n worker(task.data, onlyOnce(_next(task)));\n }\n },\n length: function length() {\n return q._tasks.length;\n },\n running: function running() {\n return workers;\n },\n idle: function idle() {\n return q._tasks.length + workers === 0;\n },\n pause: function pause() {\n if (q.paused === true) {\n return;\n }\n\n q.paused = true;\n },\n resume: function resume() {\n if (q.paused === false) {\n return;\n }\n\n q.paused = false; // Need to call q.process once per concurrent\n // worker to preserve full concurrency after pause\n\n for (var w = 1; w <= q.concurrency; w++) {\n q.process();\n }\n }\n };\n\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n // eslint-disable-line no-eq-null,eqeqeq\n throw new Error('task callback must be a function');\n }\n\n q.started = true;\n\n if (data == null && q.idle()) {\n // eslint-disable-line no-eq-null,eqeqeq\n // call drain immediately if there are no tasks\n setTimeout(function () {\n return q.drain();\n }, 1);\n return;\n }\n\n var item = {\n data: data,\n callback: typeof callback === 'function' ? callback : _noop\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n setTimeout(function () {\n return q.process();\n }, 1);\n }\n\n function _next(task) {\n return function next() {\n workers -= 1;\n task.callback.apply(task, arguments);\n\n if (arguments[0] != null) {\n // eslint-disable-line no-eq-null,eqeqeq\n q.error(arguments[0], task.data);\n }\n\n if (workers <= q.concurrency - q.buffer) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n\n q.process();\n };\n }\n\n return q;\n}\n\nvar async = ({\n eachSeries: eachSeries,\n queue: queue\n});\n\n// a simple in-memory cache for resources\nvar cache = {};\n/**\n * A simple in-memory cache for resource.\n *\n * @memberof middleware\n * @function caching\n * @example\n * import { Loader, middleware } from 'resource-loader';\n * const loader = new Loader();\n * loader.use(middleware.caching);\n * @param {Resource} resource - Current Resource\n * @param {function} next - Callback when complete\n */\n\nfunction caching(resource, next) {\n var _this = this;\n\n // if cached, then set data and complete the resource\n if (cache[resource.url]) {\n resource.data = cache[resource.url];\n resource.complete(); // marks resource load complete and stops processing before middlewares\n } // if not cached, wait for complete and store it in the cache.\n else {\n resource.onComplete.once(function () {\n return cache[_this.url] = _this.data;\n });\n }\n\n next();\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nvar useXdr = !!(window.XDomainRequest && !('withCredentials' in new XMLHttpRequest()));\nvar tempAnchor = null; // some status constants\n\nvar STATUS_NONE = 0;\nvar STATUS_OK = 200;\nvar STATUS_EMPTY = 204;\nvar STATUS_IE_BUG_EMPTY = 1223;\nvar STATUS_TYPE_OK = 2; // noop\n\nfunction _noop$1() {}\n/* empty */\n\n/**\n * Manages the state and loading of a resource and all child resources.\n *\n * @class\n */\n\n\nvar Resource =\n/*#__PURE__*/\nfunction () {\n /**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.LOAD_TYPE} loadType - The load type to set it to.\n */\n Resource.setExtensionLoadType = function setExtensionLoadType(extname, loadType) {\n setExtMap(Resource._loadTypeMap, extname, loadType);\n }\n /**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.XHR_RESPONSE_TYPE} xhrType - The xhr type to set it to.\n */\n ;\n\n Resource.setExtensionXhrType = function setExtensionXhrType(extname, xhrType) {\n setExtMap(Resource._xhrTypeMap, extname, xhrType);\n }\n /**\n * @param {string} name - The name of the resource to load.\n * @param {string|string[]} url - The url for this resource, for audio/video loads you can pass\n * an array of sources.\n * @param {object} [options] - The options for the load.\n * @param {string|boolean} [options.crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @param {number} [options.timeout=0] - A timeout in milliseconds for the load. If the load takes\n * longer than this time it is cancelled and the load is considered a failure. If this value is\n * set to `0` then there is no explicit timeout.\n * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @param {Resource.IMetadata} [options.metadata] - Extra configuration for middleware and the Resource object.\n */\n ;\n\n function Resource(name, url, options) {\n if (typeof name !== 'string' || typeof url !== 'string') {\n throw new Error('Both name and url are required for constructing a resource.');\n }\n\n options = options || {};\n /**\n * The state flags of this resource.\n *\n * @private\n * @member {number}\n */\n\n this._flags = 0; // set data url flag, needs to be set early for some _determineX checks to work.\n\n this._setFlag(Resource.STATUS_FLAGS.DATA_URL, url.indexOf('data:') === 0);\n /**\n * The name of this resource.\n *\n * @readonly\n * @member {string}\n */\n\n\n this.name = name;\n /**\n * The url used to load this resource.\n *\n * @readonly\n * @member {string}\n */\n\n this.url = url;\n /**\n * The extension used to load this resource.\n *\n * @readonly\n * @member {string}\n */\n\n this.extension = this._getExtension();\n /**\n * The data that was loaded by the resource.\n *\n * @member {any}\n */\n\n this.data = null;\n /**\n * Is this request cross-origin? If unset, determined automatically.\n *\n * @member {string}\n */\n\n this.crossOrigin = options.crossOrigin === true ? 'anonymous' : options.crossOrigin;\n /**\n * A timeout in milliseconds for the load. If the load takes longer than this time\n * it is cancelled and the load is considered a failure. If this value is set to `0`\n * then there is no explicit timeout.\n *\n * @member {number}\n */\n\n this.timeout = options.timeout || 0;\n /**\n * The method of loading to use for this resource.\n *\n * @member {Resource.LOAD_TYPE}\n */\n\n this.loadType = options.loadType || this._determineLoadType();\n /**\n * The type used to load the resource via XHR. If unset, determined automatically.\n *\n * @member {string}\n */\n\n this.xhrType = options.xhrType;\n /**\n * Extra info for middleware, and controlling specifics about how the resource loads.\n *\n * Note that if you pass in a `loadElement`, the Resource class takes ownership of it.\n * Meaning it will modify it as it sees fit.\n *\n * @member {Resource.IMetadata}\n */\n\n this.metadata = options.metadata || {};\n /**\n * The error that occurred while loading (if any).\n *\n * @readonly\n * @member {Error}\n */\n\n this.error = null;\n /**\n * The XHR object that was used to load this resource. This is only set\n * when `loadType` is `Resource.LOAD_TYPE.XHR`.\n *\n * @readonly\n * @member {XMLHttpRequest}\n */\n\n this.xhr = null;\n /**\n * The child resources this resource owns.\n *\n * @readonly\n * @member {Resource[]}\n */\n\n this.children = [];\n /**\n * The resource type.\n *\n * @readonly\n * @member {Resource.TYPE}\n */\n\n this.type = Resource.TYPE.UNKNOWN;\n /**\n * The progress chunk owned by this resource.\n *\n * @readonly\n * @member {number}\n */\n\n this.progressChunk = 0;\n /**\n * The `dequeue` method that will be used a storage place for the async queue dequeue method\n * used privately by the loader.\n *\n * @private\n * @member {function}\n */\n\n this._dequeue = _noop$1;\n /**\n * Used a storage place for the on load binding used privately by the loader.\n *\n * @private\n * @member {function}\n */\n\n this._onLoadBinding = null;\n /**\n * The timer for element loads to check if they timeout.\n *\n * @private\n * @member {number}\n */\n\n this._elementTimer = 0;\n /**\n * The `complete` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundComplete = this.complete.bind(this);\n /**\n * The `_onError` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnError = this._onError.bind(this);\n /**\n * The `_onProgress` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnProgress = this._onProgress.bind(this);\n /**\n * The `_onTimeout` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnTimeout = this._onTimeout.bind(this); // xhr callbacks\n\n this._boundXhrOnError = this._xhrOnError.bind(this);\n this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this);\n this._boundXhrOnAbort = this._xhrOnAbort.bind(this);\n this._boundXhrOnLoad = this._xhrOnLoad.bind(this);\n /**\n * Dispatched when the resource beings to load.\n *\n * The callback looks like {@link Resource.OnStartSignal}.\n *\n * @member {Signal}\n */\n\n this.onStart = new Signal();\n /**\n * Dispatched each time progress of this resource load updates.\n * Not all resources types and loader systems can support this event\n * so sometimes it may not be available. If the resource\n * is being loaded on a modern browser, using XHR, and the remote server\n * properly sets Content-Length headers, then this will be available.\n *\n * The callback looks like {@link Resource.OnProgressSignal}.\n *\n * @member {Signal}\n */\n\n this.onProgress = new Signal();\n /**\n * Dispatched once this resource has loaded, if there was an error it will\n * be in the `error` property.\n *\n * The callback looks like {@link Resource.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onComplete = new Signal();\n /**\n * Dispatched after this resource has had all the *after* middleware run on it.\n *\n * The callback looks like {@link Resource.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onAfterMiddleware = new Signal();\n }\n /**\n * When the resource starts to load.\n *\n * @memberof Resource\n * @callback OnStartSignal\n * @param {Resource} resource - The resource that the event happened on.\n */\n\n /**\n * When the resource reports loading progress.\n *\n * @memberof Resource\n * @callback OnProgressSignal\n * @param {Resource} resource - The resource that the event happened on.\n * @param {number} percentage - The progress of the load in the range [0, 1].\n */\n\n /**\n * When the resource finishes loading.\n *\n * @memberof Resource\n * @callback OnCompleteSignal\n * @param {Resource} resource - The resource that the event happened on.\n */\n\n /**\n * @memberof Resource\n * @typedef {object} IMetadata\n * @property {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @property {boolean} [skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @property {string|string[]} [mimeType] - The mime type to use for the source element\n * of a video/audio elment. If the urls are an array, you can pass this as an array as well\n * where each index is the mime type to use for the corresponding url index.\n */\n\n /**\n * Stores whether or not this url is a data url.\n *\n * @readonly\n * @member {boolean}\n */\n\n\n var _proto = Resource.prototype;\n\n /**\n * Marks the resource as complete.\n *\n */\n _proto.complete = function complete() {\n this._clearEvents();\n\n this._finish();\n }\n /**\n * Aborts the loading of this resource, with an optional message.\n *\n * @param {string} message - The message to use for the error\n */\n ;\n\n _proto.abort = function abort(message) {\n // abort can be called multiple times, ignore subsequent calls.\n if (this.error) {\n return;\n } // store error\n\n\n this.error = new Error(message); // clear events before calling aborts\n\n this._clearEvents(); // abort the actual loading\n\n\n if (this.xhr) {\n this.xhr.abort();\n } else if (this.xdr) {\n this.xdr.abort();\n } else if (this.data) {\n // single source\n if (this.data.src) {\n this.data.src = Resource.EMPTY_GIF;\n } // multi-source\n else {\n while (this.data.firstChild) {\n this.data.removeChild(this.data.firstChild);\n }\n }\n } // done now.\n\n\n this._finish();\n }\n /**\n * Kicks off loading of this resource. This method is asynchronous.\n *\n * @param {Resource.OnCompleteSignal} [cb] - Optional callback to call once the resource is loaded.\n */\n ;\n\n _proto.load = function load(cb) {\n var _this = this;\n\n if (this.isLoading) {\n return;\n }\n\n if (this.isComplete) {\n if (cb) {\n setTimeout(function () {\n return cb(_this);\n }, 1);\n }\n\n return;\n } else if (cb) {\n this.onComplete.once(cb);\n }\n\n this._setFlag(Resource.STATUS_FLAGS.LOADING, true);\n\n this.onStart.dispatch(this); // if unset, determine the value\n\n if (this.crossOrigin === false || typeof this.crossOrigin !== 'string') {\n this.crossOrigin = this._determineCrossOrigin(this.url);\n }\n\n switch (this.loadType) {\n case Resource.LOAD_TYPE.IMAGE:\n this.type = Resource.TYPE.IMAGE;\n\n this._loadElement('image');\n\n break;\n\n case Resource.LOAD_TYPE.AUDIO:\n this.type = Resource.TYPE.AUDIO;\n\n this._loadSourceElement('audio');\n\n break;\n\n case Resource.LOAD_TYPE.VIDEO:\n this.type = Resource.TYPE.VIDEO;\n\n this._loadSourceElement('video');\n\n break;\n\n case Resource.LOAD_TYPE.XHR:\n /* falls through */\n\n default:\n if (useXdr && this.crossOrigin) {\n this._loadXdr();\n } else {\n this._loadXhr();\n }\n\n break;\n }\n }\n /**\n * Checks if the flag is set.\n *\n * @private\n * @param {number} flag - The flag to check.\n * @return {boolean} True if the flag is set.\n */\n ;\n\n _proto._hasFlag = function _hasFlag(flag) {\n return (this._flags & flag) !== 0;\n }\n /**\n * (Un)Sets the flag.\n *\n * @private\n * @param {number} flag - The flag to (un)set.\n * @param {boolean} value - Whether to set or (un)set the flag.\n */\n ;\n\n _proto._setFlag = function _setFlag(flag, value) {\n this._flags = value ? this._flags | flag : this._flags & ~flag;\n }\n /**\n * Clears all the events from the underlying loading source.\n *\n * @private\n */\n ;\n\n _proto._clearEvents = function _clearEvents() {\n clearTimeout(this._elementTimer);\n\n if (this.data && this.data.removeEventListener) {\n this.data.removeEventListener('error', this._boundOnError, false);\n this.data.removeEventListener('load', this._boundComplete, false);\n this.data.removeEventListener('progress', this._boundOnProgress, false);\n this.data.removeEventListener('canplaythrough', this._boundComplete, false);\n }\n\n if (this.xhr) {\n if (this.xhr.removeEventListener) {\n this.xhr.removeEventListener('error', this._boundXhrOnError, false);\n this.xhr.removeEventListener('timeout', this._boundXhrOnTimeout, false);\n this.xhr.removeEventListener('abort', this._boundXhrOnAbort, false);\n this.xhr.removeEventListener('progress', this._boundOnProgress, false);\n this.xhr.removeEventListener('load', this._boundXhrOnLoad, false);\n } else {\n this.xhr.onerror = null;\n this.xhr.ontimeout = null;\n this.xhr.onprogress = null;\n this.xhr.onload = null;\n }\n }\n }\n /**\n * Finalizes the load.\n *\n * @private\n */\n ;\n\n _proto._finish = function _finish() {\n if (this.isComplete) {\n throw new Error('Complete called again for an already completed resource.');\n }\n\n this._setFlag(Resource.STATUS_FLAGS.COMPLETE, true);\n\n this._setFlag(Resource.STATUS_FLAGS.LOADING, false);\n\n this.onComplete.dispatch(this);\n }\n /**\n * Loads this resources using an element that has a single source,\n * like an HTMLImageElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\n ;\n\n _proto._loadElement = function _loadElement(type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n } else if (type === 'image' && typeof window.Image !== 'undefined') {\n this.data = new Image();\n } else {\n this.data = document.createElement(type);\n }\n\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n\n if (!this.metadata.skipSource) {\n this.data.src = this.url;\n }\n\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n }\n /**\n * Loads this resources using an element that has multiple sources,\n * like an HTMLAudioElement or HTMLVideoElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\n ;\n\n _proto._loadSourceElement = function _loadSourceElement(type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n } else if (type === 'audio' && typeof window.Audio !== 'undefined') {\n this.data = new Audio();\n } else {\n this.data = document.createElement(type);\n }\n\n if (this.data === null) {\n this.abort(\"Unsupported element: \" + type);\n return;\n }\n\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n\n if (!this.metadata.skipSource) {\n // support for CocoonJS Canvas+ runtime, lacks document.createElement('source')\n if (navigator.isCocoonJS) {\n this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;\n } else if (Array.isArray(this.url)) {\n var mimeTypes = this.metadata.mimeType;\n\n for (var i = 0; i < this.url.length; ++i) {\n this.data.appendChild(this._createSource(type, this.url[i], Array.isArray(mimeTypes) ? mimeTypes[i] : mimeTypes));\n }\n } else {\n var _mimeTypes = this.metadata.mimeType;\n this.data.appendChild(this._createSource(type, this.url, Array.isArray(_mimeTypes) ? _mimeTypes[0] : _mimeTypes));\n }\n }\n\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n this.data.addEventListener('canplaythrough', this._boundComplete, false);\n this.data.load();\n\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n }\n /**\n * Loads this resources using an XMLHttpRequest.\n *\n * @private\n */\n ;\n\n _proto._loadXhr = function _loadXhr() {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n\n var xhr = this.xhr = new XMLHttpRequest(); // set the request type and url\n\n xhr.open('GET', this.url, true);\n xhr.timeout = this.timeout; // load json as text and parse it ourselves. We do this because some browsers\n // *cough* safari *cough* can't deal with it.\n\n if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON || this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n xhr.responseType = Resource.XHR_RESPONSE_TYPE.TEXT;\n } else {\n xhr.responseType = this.xhrType;\n }\n\n xhr.addEventListener('error', this._boundXhrOnError, false);\n xhr.addEventListener('timeout', this._boundXhrOnTimeout, false);\n xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n xhr.addEventListener('progress', this._boundOnProgress, false);\n xhr.addEventListener('load', this._boundXhrOnLoad, false);\n xhr.send();\n }\n /**\n * Loads this resources using an XDomainRequest. This is here because we need to support IE9 (gross).\n *\n * @private\n */\n ;\n\n _proto._loadXdr = function _loadXdr() {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n\n var xdr = this.xhr = new XDomainRequest(); // eslint-disable-line no-undef\n // XDomainRequest has a few quirks. Occasionally it will abort requests\n // A way to avoid this is to make sure ALL callbacks are set even if not used\n // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n\n xdr.timeout = this.timeout || 5000; // XDR needs a timeout value or it breaks in IE9\n\n xdr.onerror = this._boundXhrOnError;\n xdr.ontimeout = this._boundXhrOnTimeout;\n xdr.onprogress = this._boundOnProgress;\n xdr.onload = this._boundXhrOnLoad;\n xdr.open('GET', this.url, true); // Note: The xdr.send() call is wrapped in a timeout to prevent an\n // issue with the interface where some requests are lost if multiple\n // XDomainRequests are being sent at the same time.\n // Some info here: https://github.com/photonstorm/phaser/issues/1248\n\n setTimeout(function () {\n return xdr.send();\n }, 1);\n }\n /**\n * Creates a source used in loading via an element.\n *\n * @private\n * @param {string} type - The element type (video or audio).\n * @param {string} url - The source URL to load from.\n * @param {string} [mime] - The mime type of the video\n * @return {HTMLSourceElement} The source element.\n */\n ;\n\n _proto._createSource = function _createSource(type, url, mime) {\n if (!mime) {\n mime = type + \"/\" + this._getExtension(url);\n }\n\n var source = document.createElement('source');\n source.src = url;\n source.type = mime;\n return source;\n }\n /**\n * Called if a load errors out.\n *\n * @param {Event} event - The error event from the element that emits it.\n * @private\n */\n ;\n\n _proto._onError = function _onError(event) {\n this.abort(\"Failed to load element using: \" + event.target.nodeName);\n }\n /**\n * Called if a load progress event fires for an element or xhr/xdr.\n *\n * @private\n * @param {XMLHttpRequestProgressEvent|Event} event - Progress event.\n */\n ;\n\n _proto._onProgress = function _onProgress(event) {\n if (event && event.lengthComputable) {\n this.onProgress.dispatch(this, event.loaded / event.total);\n }\n }\n /**\n * Called if a timeout event fires for an element.\n *\n * @private\n */\n ;\n\n _proto._onTimeout = function _onTimeout() {\n this.abort(\"Load timed out.\");\n }\n /**\n * Called if an error event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnError = function _xhrOnError() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request failed. Status: \" + xhr.status + \", text: \\\"\" + xhr.statusText + \"\\\"\");\n }\n /**\n * Called if an error event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnTimeout = function _xhrOnTimeout() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request timed out.\");\n }\n /**\n * Called if an abort event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnAbort = function _xhrOnAbort() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request was aborted by the user.\");\n }\n /**\n * Called when data successfully loads from an xhr/xdr request.\n *\n * @private\n * @param {XMLHttpRequestLoadEvent|Event} event - Load event\n */\n ;\n\n _proto._xhrOnLoad = function _xhrOnLoad() {\n var xhr = this.xhr;\n var text = '';\n var status = typeof xhr.status === 'undefined' ? STATUS_OK : xhr.status; // XDR has no `.status`, assume 200.\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n\n if (xhr.responseType === '' || xhr.responseType === 'text' || typeof xhr.responseType === 'undefined') {\n text = xhr.responseText;\n } // status can be 0 when using the `file://` protocol so we also check if a response is set.\n // If it has a response, we assume 200; otherwise a 0 status code with no contents is an aborted request.\n\n\n if (status === STATUS_NONE && (text.length > 0 || xhr.responseType === Resource.XHR_RESPONSE_TYPE.BUFFER)) {\n status = STATUS_OK;\n } // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n else if (status === STATUS_IE_BUG_EMPTY) {\n status = STATUS_EMPTY;\n }\n\n var statusType = status / 100 | 0;\n\n if (statusType === STATUS_TYPE_OK) {\n // if text, just return it\n if (this.xhrType === Resource.XHR_RESPONSE_TYPE.TEXT) {\n this.data = text;\n this.type = Resource.TYPE.TEXT;\n } // if json, parse into json object\n else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON) {\n try {\n this.data = JSON.parse(text);\n this.type = Resource.TYPE.JSON;\n } catch (e) {\n this.abort(\"Error trying to parse loaded json: \" + e);\n return;\n }\n } // if xml, parse into an xml document or div element\n else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n try {\n if (window.DOMParser) {\n var domparser = new DOMParser();\n this.data = domparser.parseFromString(text, 'text/xml');\n } else {\n var div = document.createElement('div');\n div.innerHTML = text;\n this.data = div;\n }\n\n this.type = Resource.TYPE.XML;\n } catch (e) {\n this.abort(\"Error trying to parse loaded xml: \" + e);\n return;\n }\n } // other types just return the response\n else {\n this.data = xhr.response || text;\n }\n } else {\n this.abort(\"[\" + xhr.status + \"] \" + xhr.statusText + \": \" + xhr.responseURL);\n return;\n }\n\n this.complete();\n }\n /**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n *\n * @private\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\n ;\n\n _proto._determineCrossOrigin = function _determineCrossOrigin(url, loc) {\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n } // A sandboxed iframe without the 'allow-same-origin' attribute will have a special\n // origin designed not to match window.location.origin, and will always require\n // crossOrigin requests regardless of whether the location matches.\n\n\n if (window.origin !== window.location.origin) {\n return 'anonymous';\n } // default is window.location\n\n\n loc = loc || window.location;\n\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n } // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n\n\n tempAnchor.href = url;\n url = parseUri(tempAnchor.href, {\n strictMode: true\n });\n var samePort = !url.port && loc.port === '' || url.port === loc.port;\n var protocol = url.protocol ? url.protocol + \":\" : ''; // if cross origin\n\n if (url.host !== loc.hostname || !samePort || protocol !== loc.protocol) {\n return 'anonymous';\n }\n\n return '';\n }\n /**\n * Determines the responseType of an XHR request based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.XHR_RESPONSE_TYPE} The responseType to use.\n */\n ;\n\n _proto._determineXhrType = function _determineXhrType() {\n return Resource._xhrTypeMap[this.extension] || Resource.XHR_RESPONSE_TYPE.TEXT;\n }\n /**\n * Determines the loadType of a resource based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.LOAD_TYPE} The loadType to use.\n */\n ;\n\n _proto._determineLoadType = function _determineLoadType() {\n return Resource._loadTypeMap[this.extension] || Resource.LOAD_TYPE.XHR;\n }\n /**\n * Extracts the extension (sans '.') of the file being loaded by the resource.\n *\n * @private\n * @return {string} The extension.\n */\n ;\n\n _proto._getExtension = function _getExtension() {\n var url = this.url;\n var ext = '';\n\n if (this.isDataUrl) {\n var slashIndex = url.indexOf('/');\n ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex));\n } else {\n var queryStart = url.indexOf('?');\n var hashStart = url.indexOf('#');\n var index = Math.min(queryStart > -1 ? queryStart : url.length, hashStart > -1 ? hashStart : url.length);\n url = url.substring(0, index);\n ext = url.substring(url.lastIndexOf('.') + 1);\n }\n\n return ext.toLowerCase();\n }\n /**\n * Determines the mime type of an XHR request based on the responseType of\n * resource being loaded.\n *\n * @private\n * @param {Resource.XHR_RESPONSE_TYPE} type - The type to get a mime type for.\n * @return {string} The mime type to use.\n */\n ;\n\n _proto._getMimeFromXhrType = function _getMimeFromXhrType(type) {\n switch (type) {\n case Resource.XHR_RESPONSE_TYPE.BUFFER:\n return 'application/octet-binary';\n\n case Resource.XHR_RESPONSE_TYPE.BLOB:\n return 'application/blob';\n\n case Resource.XHR_RESPONSE_TYPE.DOCUMENT:\n return 'application/xml';\n\n case Resource.XHR_RESPONSE_TYPE.JSON:\n return 'application/json';\n\n case Resource.XHR_RESPONSE_TYPE.DEFAULT:\n case Resource.XHR_RESPONSE_TYPE.TEXT:\n /* falls through */\n\n default:\n return 'text/plain';\n }\n };\n\n _createClass(Resource, [{\n key: \"isDataUrl\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.DATA_URL);\n }\n /**\n * Describes if this resource has finished loading. Is true when the resource has completely\n * loaded.\n *\n * @readonly\n * @member {boolean}\n */\n\n }, {\n key: \"isComplete\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.COMPLETE);\n }\n /**\n * Describes if this resource is currently loading. Is true when the resource starts loading,\n * and is false again when complete.\n *\n * @readonly\n * @member {boolean}\n */\n\n }, {\n key: \"isLoading\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.LOADING);\n }\n }]);\n\n return Resource;\n}();\n/**\n * The types of resources a resource could represent.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\n\nResource.STATUS_FLAGS = {\n NONE: 0,\n DATA_URL: 1 << 0,\n COMPLETE: 1 << 1,\n LOADING: 1 << 2\n};\n/**\n * The types of resources a resource could represent.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\nResource.TYPE = {\n UNKNOWN: 0,\n JSON: 1,\n XML: 2,\n IMAGE: 3,\n AUDIO: 4,\n VIDEO: 5,\n TEXT: 6\n};\n/**\n * The types of loading a resource can use.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\nResource.LOAD_TYPE = {\n /** Uses XMLHttpRequest to load the resource. */\n XHR: 1,\n\n /** Uses an `Image` object to load the resource. */\n IMAGE: 2,\n\n /** Uses an `Audio` object to load the resource. */\n AUDIO: 3,\n\n /** Uses a `Video` object to load the resource. */\n VIDEO: 4\n};\n/**\n * The XHR ready states, used internally.\n *\n * @static\n * @readonly\n * @enum {string}\n */\n\nResource.XHR_RESPONSE_TYPE = {\n /** string */\n DEFAULT: 'text',\n\n /** ArrayBuffer */\n BUFFER: 'arraybuffer',\n\n /** Blob */\n BLOB: 'blob',\n\n /** Document */\n DOCUMENT: 'document',\n\n /** Object */\n JSON: 'json',\n\n /** String */\n TEXT: 'text'\n};\nResource._loadTypeMap = {\n // images\n gif: Resource.LOAD_TYPE.IMAGE,\n png: Resource.LOAD_TYPE.IMAGE,\n bmp: Resource.LOAD_TYPE.IMAGE,\n jpg: Resource.LOAD_TYPE.IMAGE,\n jpeg: Resource.LOAD_TYPE.IMAGE,\n tif: Resource.LOAD_TYPE.IMAGE,\n tiff: Resource.LOAD_TYPE.IMAGE,\n webp: Resource.LOAD_TYPE.IMAGE,\n tga: Resource.LOAD_TYPE.IMAGE,\n svg: Resource.LOAD_TYPE.IMAGE,\n 'svg+xml': Resource.LOAD_TYPE.IMAGE,\n // for SVG data urls\n // audio\n mp3: Resource.LOAD_TYPE.AUDIO,\n ogg: Resource.LOAD_TYPE.AUDIO,\n wav: Resource.LOAD_TYPE.AUDIO,\n // videos\n mp4: Resource.LOAD_TYPE.VIDEO,\n webm: Resource.LOAD_TYPE.VIDEO\n};\nResource._xhrTypeMap = {\n // xml\n xhtml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n html: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n htm: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n xml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n tmx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n svg: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n // This was added to handle Tiled Tileset XML, but .tsx is also a TypeScript React Component.\n // Since it is way less likely for people to be loading TypeScript files instead of Tiled files,\n // this should probably be fine.\n tsx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n // images\n gif: Resource.XHR_RESPONSE_TYPE.BLOB,\n png: Resource.XHR_RESPONSE_TYPE.BLOB,\n bmp: Resource.XHR_RESPONSE_TYPE.BLOB,\n jpg: Resource.XHR_RESPONSE_TYPE.BLOB,\n jpeg: Resource.XHR_RESPONSE_TYPE.BLOB,\n tif: Resource.XHR_RESPONSE_TYPE.BLOB,\n tiff: Resource.XHR_RESPONSE_TYPE.BLOB,\n webp: Resource.XHR_RESPONSE_TYPE.BLOB,\n tga: Resource.XHR_RESPONSE_TYPE.BLOB,\n // json\n json: Resource.XHR_RESPONSE_TYPE.JSON,\n // text\n text: Resource.XHR_RESPONSE_TYPE.TEXT,\n txt: Resource.XHR_RESPONSE_TYPE.TEXT,\n // fonts\n ttf: Resource.XHR_RESPONSE_TYPE.BUFFER,\n otf: Resource.XHR_RESPONSE_TYPE.BUFFER\n}; // We can't set the `src` attribute to empty string, so on abort we set it to this 1px transparent gif\n\nResource.EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n/**\n * Quick helper to set a value on one of the extension maps. Ensures there is no\n * dot at the start of the extension.\n *\n * @ignore\n * @param {object} map - The map to set on.\n * @param {string} extname - The extension (or key) to set.\n * @param {number} val - The value to set.\n */\n\nfunction setExtMap(map, extname, val) {\n if (extname && extname.indexOf('.') === 0) {\n extname = extname.substring(1);\n }\n\n if (!extname) {\n return;\n }\n\n map[extname] = val;\n}\n/**\n * Quick helper to get string xhr type.\n *\n * @ignore\n * @param {XMLHttpRequest|XDomainRequest} xhr - The request to check.\n * @return {string} The type.\n */\n\n\nfunction reqType(xhr) {\n return xhr.toString().replace('object ', '');\n}\n\nvar _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n/**\n * Encodes binary into base64.\n *\n * @function encodeBinary\n * @param {string} input The input data to encode.\n * @returns {string} The encoded base64 string\n */\n\nfunction encodeBinary(input) {\n var output = '';\n var inx = 0;\n\n while (inx < input.length) {\n // Fill byte buffer array\n var bytebuffer = [0, 0, 0];\n var encodedCharIndexes = [0, 0, 0, 0];\n\n for (var jnx = 0; jnx < bytebuffer.length; ++jnx) {\n if (inx < input.length) {\n // throw away high-order byte, as documented at:\n // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n } else {\n bytebuffer[jnx] = 0;\n }\n } // Get each encoded character, 6 bits at a time\n // index 1: first 6 bits\n\n\n encodedCharIndexes[0] = bytebuffer[0] >> 2; // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n\n encodedCharIndexes[1] = (bytebuffer[0] & 0x3) << 4 | bytebuffer[1] >> 4; // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n\n encodedCharIndexes[2] = (bytebuffer[1] & 0x0f) << 2 | bytebuffer[2] >> 6; // index 3: forth 6 bits (6 least significant bits from input byte 3)\n\n encodedCharIndexes[3] = bytebuffer[2] & 0x3f; // Determine whether padding happened, and adjust accordingly\n\n var paddingBytes = inx - (input.length - 1);\n\n switch (paddingBytes) {\n case 2:\n // Set last 2 characters to padding char\n encodedCharIndexes[3] = 64;\n encodedCharIndexes[2] = 64;\n break;\n\n case 1:\n // Set last character to padding char\n encodedCharIndexes[3] = 64;\n break;\n\n default:\n break;\n // No padding - proceed\n } // Now we will grab each appropriate character out of our keystring\n // based on our index array and append it to the output string\n\n\n for (var _jnx = 0; _jnx < encodedCharIndexes.length; ++_jnx) {\n output += _keyStr.charAt(encodedCharIndexes[_jnx]);\n }\n }\n\n return output;\n}\n\nvar Url = window.URL || window.webkitURL;\n/**\n * A middleware for transforming XHR loaded Blobs into more useful objects\n *\n * @memberof middleware\n * @function parsing\n * @example\n * import { Loader, middleware } from 'resource-loader';\n * const loader = new Loader();\n * loader.use(middleware.parsing);\n * @param {Resource} resource - Current Resource\n * @param {function} next - Callback when complete\n */\n\nfunction parsing(resource, next) {\n if (!resource.data) {\n next();\n return;\n } // if this was an XHR load of a blob\n\n\n if (resource.xhr && resource.xhrType === Resource.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!window.Blob || typeof resource.data === 'string') {\n var type = resource.xhr.getResponseHeader('content-type'); // this is an image, convert the binary string into a data url\n\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = \"data:\" + type + \";base64,\" + encodeBinary(resource.xhr.responseText);\n resource.type = Resource.TYPE.IMAGE; // wait until the image loads and then callback\n\n resource.data.onload = function () {\n resource.data.onload = null;\n next();\n }; // next will be called on load\n\n\n return;\n }\n } // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n var src = Url.createObjectURL(resource.data);\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src;\n resource.type = Resource.TYPE.IMAGE; // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n\n resource.data.onload = function () {\n Url.revokeObjectURL(src);\n resource.data.onload = null;\n next();\n }; // next will be called on load.\n\n\n return;\n }\n }\n\n next();\n}\n\n/**\n * @namespace middleware\n */\n\nvar index = ({\n caching: caching,\n parsing: parsing\n});\n\nvar MAX_PROGRESS = 100;\nvar rgxExtractUrlHash = /(#[\\w-]+)?$/;\n/**\n * Manages the state and loading of multiple resources to load.\n *\n * @class\n */\n\nvar Loader =\n/*#__PURE__*/\nfunction () {\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader(baseUrl, concurrency) {\n var _this = this;\n\n if (baseUrl === void 0) {\n baseUrl = '';\n }\n\n if (concurrency === void 0) {\n concurrency = 10;\n }\n\n /**\n * The base url for all resources loaded by this loader.\n *\n * @member {string}\n */\n this.baseUrl = baseUrl;\n /**\n * The progress percent of the loader going through the queue.\n *\n * @member {number}\n * @default 0\n */\n\n this.progress = 0;\n /**\n * Loading state of the loader, true if it is currently loading resources.\n *\n * @member {boolean}\n * @default false\n */\n\n this.loading = false;\n /**\n * A querystring to append to every URL added to the loader.\n *\n * This should be a valid query string *without* the question-mark (`?`). The loader will\n * also *not* escape values for you. Make sure to escape your parameters with\n * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.\n *\n * @example\n * const loader = new Loader();\n *\n * loader.defaultQueryString = 'user=me&password=secret';\n *\n * // This will request 'image.png?user=me&password=secret'\n * loader.add('image.png').load();\n *\n * loader.reset();\n *\n * // This will request 'image.png?v=1&user=me&password=secret'\n * loader.add('iamge.png?v=1').load();\n *\n * @member {string}\n * @default ''\n */\n\n this.defaultQueryString = '';\n /**\n * The middleware to run before loading each resource.\n *\n * @private\n * @member {function[]}\n */\n\n this._beforeMiddleware = [];\n /**\n * The middleware to run after loading each resource.\n *\n * @private\n * @member {function[]}\n */\n\n this._afterMiddleware = [];\n /**\n * The tracks the resources we are currently completing parsing for.\n *\n * @private\n * @member {Resource[]}\n */\n\n this._resourcesParsing = [];\n /**\n * The `_loadResource` function bound with this object context.\n *\n * @private\n * @member {function}\n * @param {Resource} r - The resource to load\n * @param {Function} d - The dequeue function\n * @return {undefined}\n */\n\n this._boundLoadResource = function (r, d) {\n return _this._loadResource(r, d);\n };\n /**\n * The resources waiting to be loaded.\n *\n * @private\n * @member {Resource[]}\n */\n\n\n this._queue = queue(this._boundLoadResource, concurrency);\n\n this._queue.pause();\n /**\n * All the resources for this loader keyed by name.\n *\n * @member {object}\n */\n\n\n this.resources = {};\n /**\n * Dispatched once per loaded or errored resource.\n *\n * The callback looks like {@link Loader.OnProgressSignal}.\n *\n * @member {Signal}\n */\n\n this.onProgress = new Signal();\n /**\n * Dispatched once per errored resource.\n *\n * The callback looks like {@link Loader.OnErrorSignal}.\n *\n * @member {Signal}\n */\n\n this.onError = new Signal();\n /**\n * Dispatched once per loaded resource.\n *\n * The callback looks like {@link Loader.OnLoadSignal}.\n *\n * @member {Signal}\n */\n\n this.onLoad = new Signal();\n /**\n * Dispatched when the loader begins to process the queue.\n *\n * The callback looks like {@link Loader.OnStartSignal}.\n *\n * @member {Signal}\n */\n\n this.onStart = new Signal();\n /**\n * Dispatched when the queued resources all load.\n *\n * The callback looks like {@link Loader.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onComplete = new Signal(); // Add default before middleware\n\n for (var i = 0; i < Loader._defaultBeforeMiddleware.length; ++i) {\n this.pre(Loader._defaultBeforeMiddleware[i]);\n } // Add default after middleware\n\n\n for (var _i = 0; _i < Loader._defaultAfterMiddleware.length; ++_i) {\n this.use(Loader._defaultAfterMiddleware[_i]);\n }\n }\n /**\n * When the progress changes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnProgressSignal\n * @param {Loader} loader - The loader the progress is advancing on.\n * @param {Resource} resource - The resource that has completed or failed to cause the progress to advance.\n */\n\n /**\n * When an error occurrs the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnErrorSignal\n * @param {Loader} loader - The loader the error happened in.\n * @param {Resource} resource - The resource that caused the error.\n */\n\n /**\n * When a load completes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnLoadSignal\n * @param {Loader} loader - The loader that laoded the resource.\n * @param {Resource} resource - The resource that has completed loading.\n */\n\n /**\n * When the loader starts loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnStartSignal\n * @param {Loader} loader - The loader that has started loading resources.\n */\n\n /**\n * When the loader completes loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnCompleteSignal\n * @param {Loader} loader - The loader that has finished loading resources.\n */\n\n /**\n * Options for a call to `.add()`.\n *\n * @see Loader#add\n *\n * @typedef {object} IAddOptions\n * @property {string} [name] - The name of the resource to load, if not passed the url is used.\n * @property {string} [key] - Alias for `name`.\n * @property {string} [url] - The url for this resource, relative to the baseUrl of this loader.\n * @property {string|boolean} [crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @property {number} [timeout=0] - A timeout in milliseconds for the load. If the load takes\n * longer than this time it is cancelled and the load is considered a failure. If this value is\n * set to `0` then there is no explicit timeout.\n * @property {Resource.LOAD_TYPE} [loadType=Resource.LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @property {Resource.XHR_RESPONSE_TYPE} [xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @property {Resource.OnCompleteSignal} [onComplete] - Callback to add an an onComplete signal istener.\n * @property {Resource.OnCompleteSignal} [callback] - Alias for `onComplete`.\n * @property {Resource.IMetadata} [metadata] - Extra configuration for middleware and the Resource object.\n */\n\n /* eslint-disable require-jsdoc,valid-jsdoc */\n\n /**\n * Adds a resource (or multiple resources) to the loader queue.\n *\n * This function can take a wide variety of different parameters. The only thing that is always\n * required the url to load. All the following will work:\n *\n * ```js\n * loader\n * // normal param syntax\n * .add('key', 'http://...', function () {})\n * .add('http://...', function () {})\n * .add('http://...')\n *\n * // object syntax\n * .add({\n * name: 'key2',\n * url: 'http://...'\n * }, function () {})\n * .add({\n * url: 'http://...'\n * }, function () {})\n * .add({\n * name: 'key3',\n * url: 'http://...'\n * onComplete: function () {}\n * })\n * .add({\n * url: 'https://...',\n * onComplete: function () {},\n * crossOrigin: true\n * })\n *\n * // you can also pass an array of objects or urls or both\n * .add([\n * { name: 'key4', url: 'http://...', onComplete: function () {} },\n * { url: 'http://...', onComplete: function () {} },\n * 'http://...'\n * ])\n *\n * // and you can use both params and options\n * .add('key', 'http://...', { crossOrigin: true }, function () {})\n * .add('http://...', { crossOrigin: true }, function () {});\n * ```\n *\n * @function\n * @variation 1\n * @param {string} name - The name of the resource to load.\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 2\n * @param {string} name - The name of the resource to load.\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {IAddOptions} [options] - The options for the load.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 3\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 4\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {IAddOptions} [options] - The options for the load.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 5\n * @param {IAddOptions} options - The options for the load. This object must contain a `url` property.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 6\n * @param {Array} resources - An array of resources to load, where each is\n * either an object with the options or a string url. If you pass an object, it must contain a `url` property.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n\n var _proto = Loader.prototype;\n\n _proto.add = function add(name, url, options, cb) {\n // special case of an array of objects or urls\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; ++i) {\n this.add(name[i]);\n }\n\n return this;\n } // if an object is passed instead of params\n\n\n if (typeof name === 'object') {\n cb = url || name.callback || name.onComplete;\n options = name;\n url = name.url;\n name = name.name || name.key || name.url;\n } // case where no name is passed shift all args over by one.\n\n\n if (typeof url !== 'string') {\n cb = options;\n options = url;\n url = name;\n } // now that we shifted make sure we have a proper url.\n\n\n if (typeof url !== 'string') {\n throw new Error('No url passed to add resource to loader.');\n } // options are optional so people might pass a function and no options\n\n\n if (typeof options === 'function') {\n cb = options;\n options = null;\n } // if loading already you can only add resources that have a parent.\n\n\n if (this.loading && (!options || !options.parentResource)) {\n throw new Error('Cannot add resources while the loader is running.');\n } // check if resource already exists.\n\n\n if (this.resources[name]) {\n throw new Error(\"Resource named \\\"\" + name + \"\\\" already exists.\");\n } // add base url if this isn't an absolute url\n\n\n url = this._prepareUrl(url); // create the store the resource\n\n this.resources[name] = new Resource(name, url, options);\n\n if (typeof cb === 'function') {\n this.resources[name].onAfterMiddleware.once(cb);\n } // if actively loading, make sure to adjust progress chunks for that parent and its children\n\n\n if (this.loading) {\n var parent = options.parentResource;\n var incompleteChildren = [];\n\n for (var _i2 = 0; _i2 < parent.children.length; ++_i2) {\n if (!parent.children[_i2].isComplete) {\n incompleteChildren.push(parent.children[_i2]);\n }\n }\n\n var fullChunk = parent.progressChunk * (incompleteChildren.length + 1); // +1 for parent\n\n var eachChunk = fullChunk / (incompleteChildren.length + 2); // +2 for parent & new child\n\n parent.children.push(this.resources[name]);\n parent.progressChunk = eachChunk;\n\n for (var _i3 = 0; _i3 < incompleteChildren.length; ++_i3) {\n incompleteChildren[_i3].progressChunk = eachChunk;\n }\n\n this.resources[name].progressChunk = eachChunk;\n } // add the resource to the queue\n\n\n this._queue.push(this.resources[name]);\n\n return this;\n }\n /* eslint-enable require-jsdoc,valid-jsdoc */\n\n /**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @param {function} fn - The middleware function to register.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.pre = function pre(fn) {\n this._beforeMiddleware.push(fn);\n\n return this;\n }\n /**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @param {function} fn - The middleware function to register.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.use = function use(fn) {\n this._afterMiddleware.push(fn);\n\n return this;\n }\n /**\n * Resets the queue of the loader to prepare for a new load.\n *\n * @return {this} Returns itself.\n */\n ;\n\n _proto.reset = function reset() {\n this.progress = 0;\n this.loading = false;\n\n this._queue.kill();\n\n this._queue.pause(); // abort all resource loads\n\n\n for (var k in this.resources) {\n var res = this.resources[k];\n\n if (res._onLoadBinding) {\n res._onLoadBinding.detach();\n }\n\n if (res.isLoading) {\n res.abort();\n }\n }\n\n this.resources = {};\n return this;\n }\n /**\n * Starts loading the queued resources.\n *\n * @param {function} [cb] - Optional callback that will be bound to the `complete` event.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.load = function load(cb) {\n // register complete callback if they pass one\n if (typeof cb === 'function') {\n this.onComplete.once(cb);\n } // if the queue has already started we are done here\n\n\n if (this.loading) {\n return this;\n }\n\n if (this._queue.idle()) {\n this._onStart();\n\n this._onComplete();\n } else {\n // distribute progress chunks\n var numTasks = this._queue._tasks.length;\n var chunk = MAX_PROGRESS / numTasks;\n\n for (var i = 0; i < this._queue._tasks.length; ++i) {\n this._queue._tasks[i].data.progressChunk = chunk;\n } // notify we are starting\n\n\n this._onStart(); // start loading\n\n\n this._queue.resume();\n }\n\n return this;\n }\n /**\n * The number of resources to load concurrently.\n *\n * @member {number}\n * @default 10\n */\n ;\n\n /**\n * Prepares a url for usage based on the configuration of this object\n *\n * @private\n * @param {string} url - The url to prepare.\n * @return {string} The prepared url.\n */\n _proto._prepareUrl = function _prepareUrl(url) {\n var parsedUrl = parseUri(url, {\n strictMode: true\n });\n var result; // absolute url, just use it as is.\n\n if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) {\n result = url;\n } // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n else if (this.baseUrl.length && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 && url.charAt(0) !== '/') {\n result = this.baseUrl + \"/\" + url;\n } else {\n result = this.baseUrl + url;\n } // if we need to add a default querystring, there is a bit more work\n\n\n if (this.defaultQueryString) {\n var hash = rgxExtractUrlHash.exec(result)[0];\n result = result.substr(0, result.length - hash.length);\n\n if (result.indexOf('?') !== -1) {\n result += \"&\" + this.defaultQueryString;\n } else {\n result += \"?\" + this.defaultQueryString;\n }\n\n result += hash;\n }\n\n return result;\n }\n /**\n * Loads a single resource.\n *\n * @private\n * @param {Resource} resource - The resource to load.\n * @param {function} dequeue - The function to call when we need to dequeue this item.\n */\n ;\n\n _proto._loadResource = function _loadResource(resource, dequeue) {\n var _this2 = this;\n\n resource._dequeue = dequeue; // run before middleware\n\n eachSeries(this._beforeMiddleware, function (fn, next) {\n fn.call(_this2, resource, function () {\n // if the before middleware marks the resource as complete,\n // break and don't process any more before middleware\n next(resource.isComplete ? {} : null);\n });\n }, function () {\n if (resource.isComplete) {\n _this2._onLoad(resource);\n } else {\n resource._onLoadBinding = resource.onComplete.once(_this2._onLoad, _this2);\n resource.load();\n }\n }, true);\n }\n /**\n * Called once loading has started.\n *\n * @private\n */\n ;\n\n _proto._onStart = function _onStart() {\n this.progress = 0;\n this.loading = true;\n this.onStart.dispatch(this);\n }\n /**\n * Called once each resource has loaded.\n *\n * @private\n */\n ;\n\n _proto._onComplete = function _onComplete() {\n this.progress = MAX_PROGRESS;\n this.loading = false;\n this.onComplete.dispatch(this, this.resources);\n }\n /**\n * Called each time a resources is loaded.\n *\n * @private\n * @param {Resource} resource - The resource that was loaded\n */\n ;\n\n _proto._onLoad = function _onLoad(resource) {\n var _this3 = this;\n\n resource._onLoadBinding = null; // remove this resource from the async queue, and add it to our list of resources that are being parsed\n\n this._resourcesParsing.push(resource);\n\n resource._dequeue(); // run all the after middleware for this resource\n\n\n eachSeries(this._afterMiddleware, function (fn, next) {\n fn.call(_this3, resource, next);\n }, function () {\n resource.onAfterMiddleware.dispatch(resource);\n _this3.progress = Math.min(MAX_PROGRESS, _this3.progress + resource.progressChunk);\n\n _this3.onProgress.dispatch(_this3, resource);\n\n if (resource.error) {\n _this3.onError.dispatch(resource.error, _this3, resource);\n } else {\n _this3.onLoad.dispatch(_this3, resource);\n }\n\n _this3._resourcesParsing.splice(_this3._resourcesParsing.indexOf(resource), 1); // do completion check\n\n\n if (_this3._queue.idle() && _this3._resourcesParsing.length === 0) {\n _this3._onComplete();\n }\n }, true);\n };\n\n _createClass(Loader, [{\n key: \"concurrency\",\n get: function get() {\n return this._queue.concurrency;\n } // eslint-disable-next-line require-jsdoc\n ,\n set: function set(concurrency) {\n this._queue.concurrency = concurrency;\n }\n }]);\n\n return Loader;\n}();\n/**\n * A default array of middleware to run before loading each resource.\n * Each of these middlewares are added to any new Loader instances when they are created.\n *\n * @private\n * @member {function[]}\n */\n\n\nLoader._defaultBeforeMiddleware = [];\n/**\n * A default array of middleware to run after loading each resource.\n * Each of these middlewares are added to any new Loader instances when they are created.\n *\n * @private\n * @member {function[]}\n */\n\nLoader._defaultAfterMiddleware = [];\n/**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @static\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\nLoader.pre = function LoaderPreStatic(fn) {\n Loader._defaultBeforeMiddleware.push(fn);\n\n return Loader;\n};\n/**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @static\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\nLoader.use = function LoaderUseStatic(fn) {\n Loader._defaultAfterMiddleware.push(fn);\n\n return Loader;\n};\n\nexport { Loader, Resource, async, encodeBinary, index as middleware };\n//# sourceMappingURL=resource-loader.esm.js.map\n","/*!\n * @pixi/loaders - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/loaders is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Resource as e,middleware as t,Loader as r}from\"resource-loader\";import{Texture as n}from\"@pixi/core\";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var i=function(){function t(){}return t.add=function(){e.setExtensionLoadType(\"svg\",e.LOAD_TYPE.XHR),e.setExtensionXhrType(\"svg\",e.XHR_RESPONSE_TYPE.TEXT)},t.use=function(t,r){if(!t.data||t.type!==e.TYPE.IMAGE&&\"svg\"!==t.extension)r();else{var o=t.data,i=t.url,s=t.name,a=t.metadata;n.fromLoader(o,i,s,a).then(function(e){t.texture=e,r()}).catch(r)}},t}(),s=function(e){function t(r,n){for(var o=e.call(this,r,n)||this,i=0;i0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=33776&&t<=33779)return\"s3tc\";if(t>=37488&&t<=37497)return\"etc\";if(t>=35840&&t<=35843)return\"pvrtc\";if(t>=36196)return\"etc1\";if(t>=35986&&t<=34798)return\"atc\";throw new Error(\"Invalid (compressed) texture format given!\")},e._createLevelBuffers=function(t,e,_,r,n,o,s){for(var a=new Array(_),i=t.byteOffset,R=o,T=s,h=R+r-1&~(r-1),O=T+n-1&~(n-1),A=h*O*E[e],u=0;u<_;u++)a[u]={levelID:u,levelWidth:_>1?R:h,levelHeight:_>1?T:O,levelBuffer:new Uint8Array(t.buffer,i,A)},i+=A,A=(h=(R=R>>1||1)+r-1&~(r-1))*(O=(T=T>>1||1)+n-1&~(n-1))*E[e];return a},e}(G),S=/iPhone/i,c=/iPod/i,D=/iPad/i,l=/\\biOS-universal(?:.+)Mac\\b/i,f=/\\bAndroid(?:.+)Mobile\\b/i,I=/Android/i,p=/(?:SD4930UR|\\bSilk(?:.+)Mobile\\b)/i,X=/Silk/i,C=/Windows Phone/i,F=/\\bWindows(?:.+)ARM\\b/i,P=/BlackBerry/i,B=/BB10/i,v=/Opera Mini/i,d=/\\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\\b/i,m=function(t){return void 0!==t&&\"MacIntel\"===t.platform&&\"number\"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&\"undefined\"==typeof MSStream};var U=function(t){var e={userAgent:\"\",platform:\"\",maxTouchPoints:0};t||\"undefined\"==typeof navigator?\"string\"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var _=e.userAgent,r=_.split(\"[FBAN\");void 0!==r[1]&&(_=r[0]),void 0!==(r=_.split(\"Twitter\"))[1]&&(_=r[0]);var n=function(t){return function(e){return e.test(t)}}(_),o={apple:{phone:n(S)&&!n(C),ipod:n(c),tablet:!n(S)&&(n(D)||m(e))&&!n(C),universal:n(l),device:(n(S)||n(c)||n(D)||n(l)||m(e))&&!n(C)},amazon:{phone:n(p),tablet:!n(p)&&n(X),device:n(p)||n(X)},android:{phone:!n(C)&&n(p)||!n(C)&&n(f),tablet:!n(C)&&!n(p)&&!n(f)&&(n(X)||n(I)),device:!n(C)&&(n(p)||n(X)||n(f)||n(I))||n(/\\bokhttp\\b/i)},windows:{phone:n(C),tablet:n(F),device:n(C)||n(F)},other:{blackberry:n(P),blackberry10:n(B),opera:n(v),firefox:n(N),chrome:n(d),device:n(P)||n(B)||n(v)||n(N)||n(d)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(self.navigator);var L={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(U.tablet||U.phone){var _;U.apple.device&&(_=navigator.userAgent.match(/OS (\\d+)_(\\d+)?/))&&parseInt(_[1],10)<11&&(e=!1),U.android.device&&(_=navigator.userAgent.match(/Android\\s([0-9.]*)/))&&parseInt(_[1],10)<7&&(e=!1)}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:\"highp\",PRECISION_FRAGMENT:U.apple.device?\"highp\":\"mediump\",CAN_UPLOAD_SAME_BUFFER:!U.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},g=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{};function y(t,e,_){return t(_={path:e,exports:{},require:function(t,e){return function(){throw new Error(\"Dynamic requires are not currently supported by @rollup/plugin-commonjs\")}(null==e&&_.path)}},_.exports),_.exports}y(function(t){var e=Object.prototype.hasOwnProperty,_=\"~\";function r(){}function n(t,e,_){this.fn=t,this.context=e,this.once=_||!1}function o(t,e,r,o,s){if(\"function\"!=typeof r)throw new TypeError(\"The listener must be a function\");var a=new n(r,o||t,s),i=_?_+e:e;return t._events[i]?t._events[i].fn?t._events[i]=[t._events[i],a]:t._events[i].push(a):(t._events[i]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(_=!1)),a.prototype.eventNames=function(){var t,r,n=[];if(0===this._eventsCount)return n;for(r in t=this._events)e.call(t,r)&&n.push(_?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=_?_+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,s=new Array(o);n= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},l=R-T,f=Math.floor,I=String.fromCharCode;function p(t){throw RangeError(D[t])}function X(t,e){for(var _=t.length,r=[];_--;)r[_]=e(t[_]);return r}function C(t,e){var _=t.split(\"@\"),r=\"\";return _.length>1&&(r=_[0]+\"@\",t=_[1]),r+X((t=t.replace(c,\".\")).split(\".\"),e).join(\".\")}function F(t){for(var e,_,r=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=I((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=I(t)}).join(\"\")}function B(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function v(t,e,_){var r=0;for(t=_?f(t/O):t>>1,t+=f(t/e);t>l*h>>1;r+=R)t=f(t/l);return f(r+(l+1)*t/(t+E))}function d(t){var e,_,r,n,o,s,a,E,O,M,S,c=[],D=t.length,l=0,I=u,X=A;for((_=t.lastIndexOf(G))<0&&(_=0),r=0;r<_;++r)t.charCodeAt(r)>=128&&p(\"not-basic\"),c.push(t.charCodeAt(r));for(n=_>0?_+1:0;n=D&&p(\"invalid-input\"),((E=(S=t.charCodeAt(n++))-48<10?S-22:S-65<26?S-65:S-97<26?S-97:R)>=R||E>f((i-l)/s))&&p(\"overflow\"),l+=E*s,!(E<(O=a<=X?T:a>=X+h?h:a-X));a+=R)s>f(i/(M=R-O))&&p(\"overflow\"),s*=M;X=v(l-o,e=c.length+1,0==o),f(l/e)>i-I&&p(\"overflow\"),I+=f(l/e),l%=e,c.splice(l++,0,I)}return P(c)}function N(t){var e,_,r,n,o,s,a,E,O,M,S,c,D,l,X,C=[];for(c=(t=F(t)).length,e=u,_=0,o=A,s=0;s=e&&Sf((i-_)/(D=r+1))&&p(\"overflow\"),_+=(a-e)*D,e=a,s=0;si&&p(\"overflow\"),S==e){for(E=_,O=R;!(E<(M=O<=o?T:O>=o+h?h:O-o));O+=R)X=E-M,l=R-M,C.push(I(B(M+X%l,0))),E=f(X/l);C.push(I(B(E,0))),o=v(_,D,r==n),_=0,++r}++_,++e}return C.join(\"\")}if(s={version:\"1.3.2\",ucs2:{decode:F,encode:P},decode:d,encode:N,toASCII:function(t){return C(t,function(t){return S.test(t)?\"xn--\"+N(t):t})},toUnicode:function(t){return C(t,function(t){return M.test(t)?d(t.slice(4).toLowerCase()):t})}},r&&n)if(t.exports==r)n.exports=s;else for(a in s)s.hasOwnProperty(a)&&(r[a]=s[a]);else _.punycode=s}(g)}),b={isString:function(t){return\"string\"==typeof t},isObject:function(t){return\"object\"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};function x(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Y=function(t,e,_,r){e=e||\"&\",_=_||\"=\";var n={};if(\"string\"!=typeof t||0===t.length)return n;var o=/\\+/g;t=t.split(e);var s=1e3;r&&\"number\"==typeof r.maxKeys&&(s=r.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var i=0;i=0?(R=O.substr(0,A),T=O.substr(A+1)):(R=O,T=\"\"),h=decodeURIComponent(R),E=decodeURIComponent(T),x(n,h)?Array.isArray(n[h])?n[h].push(E):n[h]=[n[h],E]:n[h]=E}return n},H=function(t){switch(typeof t){case\"string\":return t;case\"boolean\":return t?\"true\":\"false\";case\"number\":return isFinite(t)?t:\"\";default:return\"\"}},j=function(t,e,_,r){return e=e||\"&\",_=_||\"=\",null===t&&(t=void 0),\"object\"==typeof t?Object.keys(t).map(function(r){var n=encodeURIComponent(H(r))+_;return Array.isArray(t[r])?t[r].map(function(t){return n+encodeURIComponent(H(t))}).join(e):n+encodeURIComponent(H(t[r]))}).join(e):r?encodeURIComponent(H(r))+_+encodeURIComponent(H(t)):\"\"},V=y(function(t,e){e.decode=e.parse=Y,e.encode=e.stringify=j}),W=at,k=function(t,e){return at(t,!1,!0).resolve(e)},q=function(t){b.isString(t)&&(t=at(t));if(!(t instanceof K))return K.prototype.format.call(t);return t.format()};function K(){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 z=/^([a-z0-9.+-]+:)/i,Q=/:[0-9]*$/,$=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,Z=[\"{\",\"}\",\"|\",\"\\\\\",\"^\",\"`\"].concat([\"<\",\">\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"]),J=[\"'\"].concat(Z),tt=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(J),et=[\"/\",\"?\",\"#\"],_t=/^[+a-z0-9A-Z_-]{0,63}$/,rt=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,nt={javascript:!0,\"javascript:\":!0},ot={javascript:!0,\"javascript:\":!0},st={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0};function at(t,e,_){if(t&&b.isObject(t)&&t instanceof K)return t;var r=new K;return r.parse(t,e,_),r}K.prototype.parse=function(t,e,_){if(!b.isString(t))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof t);var r=t.indexOf(\"?\"),n=-1!==r&&r127?D+=\"x\":D+=c[l];if(!D.match(_t)){var I=M.slice(0,A),p=M.slice(A+1),X=c.match(rt);X&&(I.push(X[1]),p.unshift(X[2])),p.length&&(s=\"/\"+p.join(\".\")+s),this.hostname=I.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),G||(this.hostname=w.toASCII(this.hostname));var C=this.port?\":\"+this.port:\"\",F=this.hostname||\"\";this.host=F+C,this.href+=this.host,G&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==s[0]&&(s=\"/\"+s))}if(!nt[R])for(A=0,S=J.length;A0)&&_.host.split(\"@\"))&&(_.auth=X.shift(),_.host=_.hostname=X.shift());return _.search=t.search,_.query=t.query,b.isNull(_.pathname)&&b.isNull(_.search)||(_.path=(_.pathname?_.pathname:\"\")+(_.search?_.search:\"\")),_.href=_.format(),_}if(!c.length)return _.pathname=null,_.search?_.path=\"/\"+_.search:_.path=null,_.href=_.format(),_;for(var l=c.slice(-1)[0],f=(_.host||t.host||c.length>1)&&(\".\"===l||\"..\"===l)||\"\"===l,I=0,p=c.length;p>=0;p--)\".\"===(l=c[p])?c.splice(p,1):\"..\"===l?(c.splice(p,1),I++):I&&(c.splice(p,1),I--);if(!M&&!S)for(;I--;I)c.unshift(\"..\");!M||\"\"===c[0]||c[0]&&\"/\"===c[0].charAt(0)||c.unshift(\"\"),f&&\"/\"!==c.join(\"/\").substr(-1)&&c.push(\"\");var X,C=\"\"===c[0]||c[0]&&\"/\"===c[0].charAt(0);D&&(_.hostname=_.host=C?\"\":c.length?c.shift():\"\",(X=!!(_.host&&_.host.indexOf(\"@\")>0)&&_.host.split(\"@\"))&&(_.auth=X.shift(),_.host=_.hostname=X.shift()));return(M=M||_.host&&c.length)&&!C&&c.unshift(\"\"),c.length?_.pathname=c.join(\"/\"):(_.pathname=null,_.path=null),b.isNull(_.pathname)&&b.isNull(_.search)||(_.path=(_.pathname?_.pathname:\"\")+(_.search?_.search:\"\")),_.auth=t.auth||_.auth,_.slashes=_.slashes||t.slashes,_.href=_.format(),_},K.prototype.parseHost=function(){var t=this.host,e=Q.exec(t);e&&(\":\"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var it={parse:W,format:q,resolve:k};L.RETINA_PREFIX=/@([0-9\\.]+)x/,L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;(function(){for(var t=[],e=[],_=0;_<32;_++)t[_]=_,e[_]=_;t[o.NORMAL_NPM]=o.NORMAL,t[o.ADD_NPM]=o.ADD,t[o.SCREEN_NPM]=o.SCREEN,e[o.NORMAL]=o.NORMAL_NPM,e[o.ADD]=o.ADD_NPM,e[o.SCREEN]=o.SCREEN_NPM;var r=[];r.push(e),r.push(t)})(),function(){function t(t,e,_){this.canvas=document.createElement(\"canvas\"),this.context=this.canvas.getContext(\"2d\"),this.resolution=_||L.RESOLUTION,this.resize(t,e)}t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,\"width\",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"height\",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t},enumerable:!1,configurable:!0})}();var Rt,Tt,ht=function(){function t(){}return t.use=function(e,_){var r=e.data;if(e.type===n.TYPE.JSON&&r&&r.cacheID&&r.textures){for(var o=r.textures,s=void 0,a=void 0,i=0,R=o.length;i>>=1,I>>>=1}var X=148;for(p=0;p1?I:X,levelHeight:A>1?p:C,levelBuffer:new Uint8Array(_,v,f)},v+=f}F=(F+=B+4)%4!=0?F+4-F%4:F,f=(X=(I=I>>1||1)+4-1&-4)*(C=(p=p>>1||1)+4-1&-4)*G}if(0!==o)throw new Error(\"TODO: Uncompressed\");return D.map(function(t){return new M(null,{format:a,width:i,height:R,levels:A,levelBuffers:t})})},t.validate=function(t,e){for(var _=0;_16384&&(o=16384),n._properties=[!1,!0,!1,!1,!1],n._maxSize=i,n._batchSize=o,n._buffers=null,n._bufferUpdateIDs=[],n._updateID=0,n.interactiveChildren=!1,n.blendMode=t.NORMAL,n.autoResize=a,n.roundPixels=!0,n.baseTexture=null,n.setProperties(r),n._tint=0,n.tintRgb=new Float32Array(4),n.tint=16777215,n}return y(i,e),i.prototype.setProperties=function(t){t&&(this._properties[0]=\"vertices\"in t||\"scale\"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]=\"position\"in t?!!t.position:this._properties[1],this._properties[2]=\"rotation\"in t?!!t.rotation:this._properties[2],this._properties[3]=\"uvs\"in t?!!t.uvs:this._properties[3],this._properties[4]=\"tint\"in t||\"alpha\"in t?!!t.tint||!!t.alpha:this._properties[4])},i.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(i.prototype,\"tint\",{get:function(){return this._tint},set:function(t){this._tint=t,r(t,this.tintRgb)},enumerable:!1,configurable:!0}),i.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once(\"update\",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},i.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(s=i);var u=t._buffers;u||(u=t._buffers=this.generateBuffers(t));var p=e[0]._texture.baseTexture;this.state.blendMode=a(t.blendMode,p.alphaMode),o.state.set(this.state);var h=o.gl,f=t.worldTransform.copyTo(this.tempMatrix);f.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=f.toArray(!0),this.shader.uniforms.uColor=n(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,p.alphaMode),this.shader.uniforms.uSampler=p,this.renderer.shader.bind(this.shader);for(var d=!1,l=0,c=0;lr&&(y=r),c>=u.length&&u.push(this._generateOneMoreBuffer(t));var v=u[c];v.uploadDynamic(e,l,y);var m=t._bufferUpdateIDs[c]||0;(d=d||v._updateID0,h=u.alpha,f=h<1&&p?s(u._tintRGB,h):u._tintRGB+(255*h<<24);r[a]=f,r[a+o]=f,r[a+2*o]=f,r[a+3*o]=f,a+=4*o}},i.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},i}(h);export{v as ParticleContainer,b as ParticleRenderer};\n//# sourceMappingURL=particles.min.js.map\n","/*!\n * @pixi/graphics - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/graphics is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Texture as t,BaseTexture as e,BatchDrawCall as i,BatchTextureArray as r,BatchGeometry as s,UniformGroup as n,Shader as h,State as a}from\"@pixi/core\";import{SHAPES as o,Point as l,PI_2 as u,Matrix as p,Polygon as c,Rectangle as d,RoundedRectangle as f,Circle as y,Ellipse as g}from\"@pixi/math\";import{earcut as v,premultiplyTint as b,hex2rgb as m}from\"@pixi/utils\";import{WRAP_MODES as x,DRAW_MODES as _,BLEND_MODES as w}from\"@pixi/constants\";import{Bounds as M,Container as P}from\"@pixi/display\";var S,T;!function(t){t.MITER=\"miter\",t.BEVEL=\"bevel\",t.ROUND=\"round\"}(S||(S={})),function(t){t.BUTT=\"butt\",t.ROUND=\"round\",t.SQUARE=\"square\"}(T||(T={}));var D={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return ithis.maxSegments&&(i=this.maxSegments),i}},A=function(){function e(){this.color=16777215,this.alpha=1,this.texture=t.WHITE,this.matrix=null,this.visible=!1,this.reset()}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},e.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=t.WHITE,this.matrix=null,this.visible=!1},e.prototype.destroy=function(){this.texture=null,this.matrix=null},e}(),C=function(t,e){return(C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function I(t,e){function i(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var E={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var i=t.points,r=t.holes,s=e.points,n=e.indices;if(i.length>=6){for(var h=[],a=0;ap&&(p+=2*Math.PI);var c=u,d=p-u,f=Math.abs(d),y=Math.sqrt(o*o+l*l),g=1+(15*f*Math.sqrt(y)/Math.PI>>0),v=d/g;if(c+=v,a){h.push(t,e),h.push(i,r);for(var b=1,m=c;bx?(V?(f.push(K,$),f.push(M+I*N,P+E*N),f.push(K,$),f.push(M+R*N,P+B*N)):(f.push(M-I*U,P-E*U),f.push(tt,et),f.push(M-R*U,P-B*U),f.push(tt,et)),g+=2):n.join===S.ROUND?V?(f.push(K,$),f.push(M+I*N,P+E*N),g+=j(M,P,M+I*N,P+E*N,M+R*N,P+B*N,f,!0)+4,f.push(K,$),f.push(M+R*N,P+B*N)):(f.push(M-I*U,P-E*U),f.push(tt,et),g+=j(M,P,M-I*U,P-E*U,M-R*U,P-B*U,f,!1)+4,f.push(M-R*U,P-B*U),f.push(tt,et)):(f.push(K,$),f.push(tt,et)):(f.push(M-I*U,P-E*U),f.push(M+I*N,P+E*N),n.join===S.BEVEL||J/m>x||(n.join===S.ROUND?g+=V?j(M,P,M+I*N,P+E*N,M+R*N,P+B*N,f,!0)+2:j(M,P,M-I*U,P-E*U,M-R*U,P-B*U,f,!1)+2:(V?(f.push(tt,et),f.push(tt,et)):(f.push(K,$),f.push(K,$)),g+=2)),f.push(M-R*U,P-B*U),f.push(M+R*N,P+B*N),g+=2)}}_=r[2*(y-2)],w=r[2*(y-2)+1],M=r[2*(y-1)],I=-(w-(P=r[2*(y-1)+1])),E=_-M,I/=L=Math.sqrt(I*I+E*E),E/=L,I*=b,E*=b,f.push(M-I*U,P-E*U),f.push(M+I*N,P+E*N),u||(n.cap===T.ROUND?g+=j(M-I*(U-N)*.5,P-E*(U-N)*.5,M-I*U,P-E*U,M+I*N,P+E*N,f,!1)+2:n.cap===T.SQUARE&&(g+=F(M,P,I,E,U,N,!1,f)));var rt=e.indices,st=D.epsilon*D.epsilon;for(z=v;zu*a}},t.arc=function(t,e,i,r,s,n,h,a,o){for(var l=h-n,p=D._segmentsCount(Math.abs(l)*s,40*Math.ceil(Math.abs(l)/u)),c=l/(2*p),d=2*c,f=Math.cos(c),y=Math.sin(c),g=p-1,v=g%1/g,b=0;b<=g;++b){var m=c+n+d*(b+v*b),x=Math.cos(m),_=-Math.sin(m);o.push((f*x+y*_)*s+i,(f*-_+y*x)*s+r)}},t}(),k=function(){function t(){}return t.curveLength=function(t,e,i,r,s,n,h,a){for(var o=0,l=0,u=0,p=0,c=0,d=0,f=0,y=0,g=0,v=0,b=0,m=t,x=e,_=1;_<=10;++_)v=m-(y=(f=(d=(c=1-(l=_/10))*c)*c)*t+3*d*l*i+3*c*(u=l*l)*s+(p=u*l)*h),b=x-(g=f*e+3*d*l*r+3*c*u*n+p*a),m=y,x=g,o+=Math.sqrt(v*v+b*b);return o},t.curveTo=function(e,i,r,s,n,h,a){var o=a[a.length-2],l=a[a.length-1];a.length-=2;var u=D._segmentsCount(t.curveLength(o,l,e,i,r,s,n,h)),p=0,c=0,d=0,f=0,y=0;a.push(o,l);for(var g=1,v=0;g<=u;++g)d=(c=(p=1-(v=g/u))*p)*p,y=(f=v*v)*v,a.push(d*o+3*c*v*e+3*p*f*r+y*n,d*l+3*c*v*i+3*p*f*s+y*h)},t}(),H=function(){function t(){}return t.curveLength=function(t,e,i,r,s,n){var h=t-2*i+s,a=e-2*r+n,o=2*i-2*t,l=2*r-2*e,u=4*(h*h+a*a),p=4*(h*o+a*l),c=o*o+l*l,d=2*Math.sqrt(u+p+c),f=Math.sqrt(u),y=2*u*f,g=2*Math.sqrt(c),v=p/f;return(y*d+f*p*(d-g)+(4*c*u-p*p)*Math.log((2*f+v+d)/(v+g)))/(4*y)},t.curveTo=function(e,i,r,s,n){for(var h=n[n.length-2],a=n[n.length-1],o=D._segmentsCount(t.curveLength(h,a,e,i,r,s)),l=0,u=0,p=1;p<=o;++p){var c=p/o;l=h+(e-h)*c,u=a+(i-a)*c,n.push(l+(e+(r-e)*c-l)*c,u+(i+(s-i)*c-u)*c)}},t}(),Y=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),G=((z={})[o.POLY]=E,z[o.CIRC]=R,z[o.ELIP]=R,z[o.RECT]=B,z[o.RREC]=U,z),V=[],W=[],Q=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),X=new l,Z=new M,J=function(t){function s(){var e=t.call(this)||this;return e.uvsFloat32=null,e.indicesUint16=null,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.dirty=0,e.batchDirty=-1,e.cacheDirty=-1,e.clearDirty=0,e.drawCalls=[],e.batches=[],e.shapeIndex=0,e._bounds=new M,e.boundsDirty=-1,e.boundsPadding=0,e.batchable=!1,e.indicesUint16=null,e.uvsFloat32=null,e.closePointEps=1e-4,e}return I(s,t),Object.defineProperty(s.prototype,\"bounds\",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),s.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},s.prototype.drawShape=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null);var s=new Q(t,e,i,r);return this.graphicsData.push(s),this.dirty++,this},s.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var i=new Q(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},s.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e0&&(s=(r=this.batches[this.batches.length-1]).style);for(var n=this.shapeIndex;n65535&&t;this.indicesUint16=v?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},s.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},s.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t131070)return!1;for(var t=this.batches,e=0;e0&&((a=W.pop())||((a=new i).texArray=new r),this.drawCalls.push(a)),a.start=d,a.size=0,a.texArray.count=0,a.type=c),g.touched=1,g._batchEnabled=t,g._batchLocation=o,g.wrapMode=10497,a.texArray.elements[a.texArray.count++]=g,o++)),a.size+=f.size,d+=f.size,u=g._batchLocation,this.addColors(n,y.color,y.alpha,f.attribSize),this.addTextureIds(h,u,f.attribSize)}e._globalBatch=t,this.packAttributes()},s.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,s=new ArrayBuffer(3*t.length*4),n=new Float32Array(s),h=new Uint32Array(s),a=0,o=0;o>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(s)},s.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},s.prototype.addUvs=function(t,e,i,r,s,n){void 0===n&&(n=null);for(var h=0,a=e.length,o=i.frame;h0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this},i.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new c,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new c,this.currentPath.closeStroke=!1},i.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},i.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},i.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],s=i[i.length-1];return r===t&&s===e||i.push(t,e),this},i.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},i.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var s=this.currentPath.points;return 0===s.length&&this.moveTo(0,0),H.curveTo(t,e,i,r,s),this},i.prototype.bezierCurveTo=function(t,e,i,r,s,n){return this._initCurve(),k.curveTo(t,e,i,r,s,n,this.currentPath.points),this},i.prototype.arcTo=function(t,e,i,r,s){this._initCurve(t,e);var n=this.currentPath.points,h=q.curveTo(t,e,i,r,s,n);if(h){var a=h.cx,o=h.cy,l=h.radius,u=h.startAngle,p=h.endAngle,c=h.anticlockwise;this.arc(a,o,l,u,p,c)}return this},i.prototype.arc=function(t,e,i,r,s,n){if(void 0===n&&(n=!1),r===s)return this;if(!n&&s<=r?s+=u:n&&r<=s&&(r+=u),0===s-r)return this;var h=t+Math.cos(r)*i,a=e+Math.sin(r)*i,o=this._geometry.closePointEps,l=this.currentPath?this.currentPath.points:null;if(l){var p=Math.abs(l[l.length-2]-h),c=Math.abs(l[l.length-1]-a);p0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this},i.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},i.prototype.drawRect=function(t,e,i,r){return this.drawShape(new d(t,e,i,r))},i.prototype.drawRoundedRect=function(t,e,i,r,s){return this.drawShape(new f(t,e,i,r,s))},i.prototype.drawCircle=function(t,e,i){return this.drawShape(new y(t,e,i))},i.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new g(t,e,i,r))},i.prototype.drawPolygon=function(){for(var t,e=arguments,i=[],r=0;r>16&255)/255*s,n.tint[1]=(r>>8&255)/255*s,n.tint[2]=(255&r)/255*s,n.tint[3]=s,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var a=0,o=h.length;a>16)+(65280&s)+((255&s)<<16)}}},i.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,i=e.a,r=e.b,s=e.c,n=e.d,h=e.tx,a=e.ty,o=this._geometry.points,l=this.vertexData,u=0,p=0;p=r&&u.x=o&&u.y>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"texture\",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off(\"update\",this._onTextureUpdate,this),this._texture=t||e.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once(\"update\",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),r}(i);export{c as Sprite};\n//# sourceMappingURL=sprite.min.js.map\n","/*!\n * @pixi/text - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/text is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Sprite as t}from\"@pixi/sprite\";import{Texture as e}from\"@pixi/core\";import{settings as i}from\"@pixi/settings\";import{Rectangle as r}from\"@pixi/math\";import{hex2string as n,hex2rgb as o,string2hex as s,trimCanvas as a,sign as h}from\"@pixi/utils\";var l,c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]=\"LINEAR_VERTICAL\",t[t.LINEAR_HORIZONTAL=1]=\"LINEAR_HORIZONTAL\"}(l||(l={}));var f={align:\"left\",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:\"black\",dropShadowDistance:5,fill:\"black\",fillGradientType:l.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:\"Arial\",fontSize:26,fontStyle:\"normal\",fontVariant:\"normal\",fontWeight:\"normal\",letterSpacing:0,lineHeight:0,lineJoin:\"miter\",miterLimit:10,padding:0,stroke:\"black\",strokeThickness:0,textBaseline:\"alphabetic\",trim:!1,whiteSpace:\"pre\",wordWrap:!1,wordWrapWidth:100,leading:0},u=[\"serif\",\"sans-serif\",\"monospace\",\"cursive\",\"fantasy\",\"system-ui\"],d=function(){function t(t){this.styleID=0,this.reset(),y(this,t,t)}return t.prototype.clone=function(){var e={};return y(e,this,f),new t(e)},t.prototype.reset=function(){y(this,f,f)},Object.defineProperty(t.prototype,\"align\",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"breakWords\",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadow\",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowAlpha\",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowAngle\",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowBlur\",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowColor\",{get:function(){return this._dropShadowColor},set:function(t){var e=g(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowDistance\",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"fill\",{get:function(){return this._fill},set:function(t){var e=g(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"fillGradientType\",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"fillGradientStops\",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i=0;i--){var r=e[i].trim();!/([\\\"\\'])[^\\'\\\"]+\\1/.test(r)&&u.indexOf(r)<0&&(r='\"'+r+'\"'),e[i]=r}return this.fontStyle+\" \"+this.fontVariant+\" \"+this.fontWeight+\" \"+t+\" \"+e.join(\",\")},t}();function p(t){return\"number\"==typeof t?n(t):(\"string\"==typeof t&&0===t.indexOf(\"0x\")&&(t=t.replace(\"0x\",\"#\")),t)}function g(t){if(Array.isArray(t)){for(var e=0;ep)if(\"\"!==s&&(a+=t.addLine(s),s=\"\",o=0),t.canBreakWords(_,i.breakWords))for(var w=t.wordWrapSplit(_),v=0;vp&&(a+=t.addLine(s),d=!1,s=\"\",o=0),s+=x,o+=O}else{s.length>0&&(a+=t.addLine(s),s=\"\",o=0);var L=y===g.length-1;a+=t.addLine(_,!L),d=!1,s=\"\",o=0}else S+o>p&&(d=!1,a+=t.addLine(s),s=\"\",o=0),(s.length>0||!t.isBreakingSpace(_)||d)&&(s+=_,o+=S)}return a+=t.addLine(s,!1)},t.addLine=function(e,i){return void 0===i&&(i=!0),e=t.trimRight(e),e=i?e+\"\\n\":e},t.getFromCache=function(t,e,i,r){var n=i[t];if(\"number\"!=typeof n){var o=t.length*e;n=r.measureText(t).width+o,i[t]=n}return n},t.collapseSpaces=function(t){return\"normal\"===t||\"pre-line\"===t},t.collapseNewlines=function(t){return\"normal\"===t},t.trimRight=function(e){if(\"string\"!=typeof e)return\"\";for(var i=e.length-1;i>=0;i--){var r=e[i];if(!t.isBreakingSpace(r))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return\"string\"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,i){return\"string\"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var i=[],r=\"\";if(\"string\"!=typeof e)return i;for(var n=0;na;--u){for(g=0;g0},t}();function l(t,i){var r=!1;if(t&&t._textures&&t._textures.length)for(var o=0;o=0;e--)this.add(t.children[e]);return this},e.prototype.destroy=function(){this.ticking&&o.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},e}();function H(t,e){return e instanceof i&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function _(t,e){if(!(e instanceof r))return!1;var i=e.geometry;e.finishPoly(),i.updateBatches();for(var o=i.batches,n=0;n=o&&_.x=i&&_.y>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),i.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;p(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},i}(i),I=function(t){function e(e,r,i){var a=t.call(this)||this,o=new n(e),s=new n(r,!0),u=new n(i,!0,!0);return a.addAttribute(\"aVertexPosition\",o,2,!1,l.FLOAT).addAttribute(\"aTextureCoord\",s,2,!1,l.FLOAT).addIndex(u),a._updateId=-1,a}return m(e,t),Object.defineProperty(e.prototype,\"vertexDirtyId\",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(a);export{b as Mesh,x as MeshBatchUvs,I as MeshGeometry,D as MeshMaterial};\n//# sourceMappingURL=mesh.min.js.map\n","/*!\n * @pixi/text-bitmap - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/text-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Rectangle as t,Point as e,ObservablePoint as r}from\"@pixi/math\";import{settings as i}from\"@pixi/settings\";import{MeshGeometry as n,MeshMaterial as a,Mesh as s}from\"@pixi/mesh\";import{hex2rgb as o,string2hex as h,getResolutionOfUrl as f,removeItems as l}from\"@pixi/utils\";import{BaseTexture as u,Texture as c}from\"@pixi/core\";import{TEXT_GRADIENT as p,TextStyle as g,TextMetrics as d}from\"@pixi/text\";import{Container as m}from\"@pixi/display\";import{LoaderResource as v}from\"@pixi/loaders\";var x=function(t,e){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var y=function(){return function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]}}(),b=function(){function t(){}return t.test=function(t){return\"string\"==typeof t&&0===t.indexOf(\"info face=\")},t.parse=function(t){var e=t.match(/^[a-z]+\\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],a=e[i].match(/[a-zA-Z]+=([^\\s\"']+|\"([^\"]*)\")/gm),s={};for(var o in a){var h=a[o].split(\"=\"),f=h[0],l=h[1].replace(/\"/gm,\"\"),u=parseFloat(l),c=isNaN(u)?l:u;s[f]=c}r[n].push(s)}var p=new y;return r.info.forEach(function(t){return p.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return p.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return p.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return p.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return p.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),p},t}(),_=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName(\"page\").length&&null!==t.getElementsByTagName(\"info\")[0].getAttribute(\"face\")},t.parse=function(t){for(var e=new y,r=t.getElementsByTagName(\"info\"),i=t.getElementsByTagName(\"common\"),n=t.getElementsByTagName(\"page\"),a=t.getElementsByTagName(\"char\"),s=t.getElementsByTagName(\"kerning\"),o=0;o\")>-1){var e=(new self.DOMParser).parseFromString(t,\"text/xml\");return _.test(e)}return!1},t.parse=function(t){var e=(new self.DOMParser).parseFromString(t,\"text/xml\");return _.parse(e)},t}(),A=[b,_,w];function S(t){for(var e=0;e=f-k*o){if(0===A)throw new Error(\"[BitmapFont] textureHeight \"+f+\"px is too small for \"+p.fontSize+\"px fonts\");--O,x=null,b=null,_=null,A=0,w=0,S=0}else if(S=Math.max(k+P.fontProperties.descent,S),C*o+w>=m)--O,A+=S*o,A=Math.ceil(A),w=0,S=0;else{I(x,b,P,w,A,o,p);var M=P.text.charCodeAt(0);v.char.push({id:M,page:T.length-1,x:w/o,y:A/o,width:C,height:k,xoffset:0,yoffset:0,xadvance:Math.ceil(E-(p.dropShadow?p.dropShadowDistance:0)-(p.stroke?p.strokeThickness:0))}),w+=(C+2*s)*o,w=Math.ceil(w)}}O=0;for(var H=l.length;O0&&o.x>d&&(l(h,1+b-++w,1+T-b),T=b,b=-1,f.push(_),u.push(h.length>0?h[h.length-1].prevSpaces:0),x=Math.max(x,_),y++,o.x=0,o.y+=r.lineHeight,m=null,S=0)}}else f.push(v),u.push(-1),x=Math.max(x,v),++y,++w,o.x=0,o.y+=r.lineHeight,m=null,S=0}var H=p.charAt(p.length-1);\"\\r\"!==H&&\"\\n\"!==H&&(/(?:\\s)/.test(H)&&(v=_),f.push(v),x=Math.max(x,v),u.push(-1));var z=[];for(T=0;T<=y;T++){var B=0;\"right\"===this._align?B=x-f[T]:\"center\"===this._align?B=(x-f[T])/2:\"justify\"===this._align&&(B=u[T]<0?0:(x-f[T])/u[T]),z.push(B)}var N=h.length,L={},j=[],F=this._activePagesMeshData;for(T=0;T6*X)||rt.vertices.length<2*s.BATCHABLE_SIZE)rt.vertices=new Float32Array(8*X),rt.uvs=new Float32Array(8*X),rt.indices=new Uint16Array(6*X);else for(var Y=rt.total,G=rt.vertices,J=4*Y*2;J=i&&(e=t-E-1),o+=u=u.replace(\"%value%\",r[e].toString()),o+=\"\\n\"}return n=(n=n.replace(\"%blur%\",o)).replace(\"%size%\",t.toString())}(u);return(_=t.call(this,l,T)||this).horizontal=r,_.resolution=E,_._quality=0,_.quality=o,_.blur=i,_}return i(r,t),r.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,E=e,u=n;this.state.blend=!1,t.applyFilter(this,E,u,L.CLEAR);for(var _=1;_ 0.0) {\\n c.rgb /= c.a;\\n }\\n\\n vec4 result;\\n\\n result.r = (m[0] * c.r);\\n result.r += (m[1] * c.g);\\n result.r += (m[2] * c.b);\\n result.r += (m[3] * c.a);\\n result.r += m[4];\\n\\n result.g = (m[5] * c.r);\\n result.g += (m[6] * c.g);\\n result.g += (m[7] * c.b);\\n result.g += (m[8] * c.a);\\n result.g += m[9];\\n\\n result.b = (m[10] * c.r);\\n result.b += (m[11] * c.g);\\n result.b += (m[12] * c.b);\\n result.b += (m[13] * c.a);\\n result.b += m[14];\\n\\n result.a = (m[15] * c.r);\\n result.a += (m[16] * c.g);\\n result.a += (m[17] * c.b);\\n result.a += (m[18] * c.a);\\n result.a += m[19];\\n\\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\\n\\n // Premultiply alpha again.\\n rgb *= result.a;\\n\\n gl_FragColor = vec4(rgb, result.a);\\n}\\n\",e=function(r){function e(){var o=this,e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(o=r.call(this,t,n,e)||this).alpha=1,o}return function(t,r){function n(){this.constructor=t}o(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}(e,r),e.prototype._loadMatrix=function(t,r){void 0===r&&(r=!1);var o=t;r&&(this._multiply(o,this.uniforms.m,t),o=this._colorMatrix(o)),this.uniforms.m=o},e.prototype._multiply=function(t,r,o){return t[0]=r[0]*o[0]+r[1]*o[5]+r[2]*o[10]+r[3]*o[15],t[1]=r[0]*o[1]+r[1]*o[6]+r[2]*o[11]+r[3]*o[16],t[2]=r[0]*o[2]+r[1]*o[7]+r[2]*o[12]+r[3]*o[17],t[3]=r[0]*o[3]+r[1]*o[8]+r[2]*o[13]+r[3]*o[18],t[4]=r[0]*o[4]+r[1]*o[9]+r[2]*o[14]+r[3]*o[19]+r[4],t[5]=r[5]*o[0]+r[6]*o[5]+r[7]*o[10]+r[8]*o[15],t[6]=r[5]*o[1]+r[6]*o[6]+r[7]*o[11]+r[8]*o[16],t[7]=r[5]*o[2]+r[6]*o[7]+r[7]*o[12]+r[8]*o[17],t[8]=r[5]*o[3]+r[6]*o[8]+r[7]*o[13]+r[8]*o[18],t[9]=r[5]*o[4]+r[6]*o[9]+r[7]*o[14]+r[8]*o[19]+r[9],t[10]=r[10]*o[0]+r[11]*o[5]+r[12]*o[10]+r[13]*o[15],t[11]=r[10]*o[1]+r[11]*o[6]+r[12]*o[11]+r[13]*o[16],t[12]=r[10]*o[2]+r[11]*o[7]+r[12]*o[12]+r[13]*o[17],t[13]=r[10]*o[3]+r[11]*o[8]+r[12]*o[13]+r[13]*o[18],t[14]=r[10]*o[4]+r[11]*o[9]+r[12]*o[14]+r[13]*o[19]+r[14],t[15]=r[15]*o[0]+r[16]*o[5]+r[17]*o[10]+r[18]*o[15],t[16]=r[15]*o[1]+r[16]*o[6]+r[17]*o[11]+r[18]*o[16],t[17]=r[15]*o[2]+r[16]*o[7]+r[17]*o[12]+r[18]*o[17],t[18]=r[15]*o[3]+r[16]*o[8]+r[17]*o[13]+r[18]*o[18],t[19]=r[15]*o[4]+r[16]*o[9]+r[17]*o[14]+r[18]*o[19]+r[19],t},e.prototype._colorMatrix=function(t){var r=new Float32Array(t);return r[4]/=255,r[9]/=255,r[14]/=255,r[19]/=255,r},e.prototype.brightness=function(t,r){var o=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},e.prototype.greyscale=function(t,r){var o=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,r){t=(t||0)/180*Math.PI;var o=Math.cos(t),n=Math.sin(t),e=1/3,i=(0,Math.sqrt)(e),a=[o+(1-o)*e,e*(1-o)-i*n,e*(1-o)+i*n,0,0,e*(1-o)+i*n,o+e*(1-o),e*(1-o)-i*n,0,0,e*(1-o)-i*n,e*(1-o)+i*n,o+e*(1-o),0,0,0,0,0,1,0];this._loadMatrix(a,r)},e.prototype.contrast=function(t,r){var o=(t||0)+1,n=-.5*(o-1),e=[o,0,0,0,n,0,o,0,0,n,0,0,o,0,n,0,0,0,1,0];this._loadMatrix(e,r)},e.prototype.saturate=function(t,r){void 0===t&&(t=0);var o=2*t/3+1,n=-.5*(o-1),e=[o,n,n,0,0,n,o,n,0,0,n,n,o,0,0,0,0,0,1,0];this._loadMatrix(e,r)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,r,o,n,e){var i=((o=o||16770432)>>16&255)/255,a=(o>>8&255)/255,u=(255&o)/255,l=((n=n||3375104)>>16&255)/255,p=(n>>8&255)/255,c=(255&n)/255,s=[.3,.59,.11,0,0,i,a,u,t=t||.2,0,l,p,c,r=r||.15,0,i-l,a-p,u-c,0,0];this._loadMatrix(s,e)},e.prototype.night=function(t,r){var o=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},e.prototype.predator=function(t,r){var o=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(o,r)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(e.prototype,\"matrix\",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"alpha\",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(r);e.prototype.grayscale=e.prototype.greyscale;export{e as ColorMatrixFilter};\n//# sourceMappingURL=filter-color-matrix.min.js.map\n","/*!\n * @pixi/filter-displacement - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/filter-displacement is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Filter as t}from\"@pixi/core\";import{Matrix as r,Point as n}from\"@pixi/math\";var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])})(t,r)};var i=\"varying vec2 vFilterCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 scale;\\nuniform mat2 rotation;\\nuniform sampler2D uSampler;\\nuniform sampler2D mapSampler;\\n\\nuniform highp vec4 inputSize;\\nuniform vec4 inputClamp;\\n\\nvoid main(void)\\n{\\n vec4 map = texture2D(mapSampler, vFilterCoord);\\n\\n map -= 0.5;\\n map.xy = scale * inputSize.zw * (rotation * map.xy);\\n\\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\\n}\\n\",o=\"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 filterMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec2 vFilterCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n\\tgl_Position = filterVertexPosition();\\n\\tvTextureCoord = filterTextureCoord();\\n\\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\\n}\\n\",a=function(t){function a(e,a){var u=this,p=new r;return e.renderable=!1,(u=t.call(this,o,i,{mapSampler:e._texture,filterMatrix:p,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,u.maskMatrix=p,null==a&&(a=20),u.scale=new n(a,a),u}return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}(a,t),a.prototype.apply=function(t,r,n,e){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var i=this.maskSprite.worldTransform,o=Math.sqrt(i.a*i.a+i.b*i.b),a=Math.sqrt(i.c*i.c+i.d*i.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=i.a/o,this.uniforms.rotation[1]=i.b/o,this.uniforms.rotation[2]=i.c/a,this.uniforms.rotation[3]=i.d/a),t.applyFilter(this,r,n,e)},Object.defineProperty(a.prototype,\"map\",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),a}(t);export{a as DisplacementFilter};\n//# sourceMappingURL=filter-displacement.min.js.map\n","/*!\n * @pixi/filter-fxaa - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/filter-fxaa is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Filter as n}from\"@pixi/core\";var e=function(n,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r])})(n,r)};var r=\"\\nattribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vFragCoord;\\n\\nuniform vec4 inputPixel;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\\n out vec2 v_rgbNW, out vec2 v_rgbNE,\\n out vec2 v_rgbSW, out vec2 v_rgbSE,\\n out vec2 v_rgbM) {\\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\\n v_rgbM = vec2(fragCoord * inverseVP);\\n}\\n\\nvoid main(void) {\\n\\n gl_Position = filterVertexPosition();\\n\\n vFragCoord = aVertexPosition * outputFrame.zw;\\n\\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n}\\n\",o='varying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vFragCoord;\\nuniform sampler2D uSampler;\\nuniform highp vec4 inputPixel;\\n\\n\\n/**\\n Basic FXAA implementation based on the code on geeks3d.com with the\\n modification that the texture2DLod stuff was removed since it\\'s\\n unsupported by WebGL.\\n\\n --\\n\\n From:\\n https://github.com/mitsuhiko/webgl-meincraft\\n\\n Copyright (c) 2011 by Armin Ronacher.\\n\\n Some rights reserved.\\n\\n Redistribution and use in source and binary forms, with or without\\n modification, are permitted provided that the following conditions are\\n met:\\n\\n * Redistributions of source code must retain the above copyright\\n notice, this list of conditions and the following disclaimer.\\n\\n * Redistributions in binary form must reproduce the above\\n copyright notice, this list of conditions and the following\\n disclaimer in the documentation and/or other materials provided\\n with the distribution.\\n\\n * The names of the contributors may not be used to endorse or\\n promote products derived from this software without specific\\n prior written permission.\\n\\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n */\\n\\n#ifndef FXAA_REDUCE_MIN\\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\\n#endif\\n#ifndef FXAA_REDUCE_MUL\\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\\n#endif\\n#ifndef FXAA_SPAN_MAX\\n#define FXAA_SPAN_MAX 8.0\\n#endif\\n\\n//optimized version for mobile, where dependent\\n//texture reads can be a bottleneck\\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\\n vec2 v_rgbNW, vec2 v_rgbNE,\\n vec2 v_rgbSW, vec2 v_rgbSE,\\n vec2 v_rgbM) {\\n vec4 color;\\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\\n vec4 texColor = texture2D(tex, v_rgbM);\\n vec3 rgbM = texColor.xyz;\\n vec3 luma = vec3(0.299, 0.587, 0.114);\\n float lumaNW = dot(rgbNW, luma);\\n float lumaNE = dot(rgbNE, luma);\\n float lumaSW = dot(rgbSW, luma);\\n float lumaSE = dot(rgbSE, luma);\\n float lumaM = dot(rgbM, luma);\\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\\n\\n mediump vec2 dir;\\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\\n\\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\\n\\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\\n dir * rcpDirMin)) * inverseVP;\\n\\n vec3 rgbA = 0.5 * (\\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\\n\\n float lumaB = dot(rgbB, luma);\\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\\n color = vec4(rgbA, texColor.a);\\n else\\n color = vec4(rgbB, texColor.a);\\n return color;\\n}\\n\\nvoid main() {\\n\\n vec4 color;\\n\\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n\\n gl_FragColor = color;\\n}\\n',t=function(n){function t(){return n.call(this,r,o)||this}return function(n,r){function o(){this.constructor=n}e(n,r),n.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}(t,n),t}(n);export{t as FXAAFilter};\n//# sourceMappingURL=filter-fxaa.min.js.map\n","/*!\n * @pixi/filter-noise - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/filter-noise is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{defaultFilterVertex as o,Filter as n}from\"@pixi/core\";var r=function(o,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,n){o.__proto__=n}||function(o,n){for(var r in n)n.hasOwnProperty(r)&&(o[r]=n[r])})(o,n)};var e=\"precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform float uNoise;\\nuniform float uSeed;\\nuniform sampler2D uSampler;\\n\\nfloat rand(vec2 co)\\n{\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float randomValue = rand(gl_FragCoord.xy * uSeed);\\n float diff = (randomValue - 0.5) * uNoise;\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n }\\n\\n color.r += diff;\\n color.g += diff;\\n color.b += diff;\\n\\n // Premultiply alpha again.\\n color.rgb *= color.a;\\n\\n gl_FragColor = color;\\n}\\n\",t=function(n){function t(r,t){void 0===r&&(r=.5),void 0===t&&(t=Math.random());var i=n.call(this,o,e,{uNoise:0,uSeed:0})||this;return i.noise=r,i.seed=t,i}return function(o,n){function e(){this.constructor=o}r(o,n),o.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(t,n),Object.defineProperty(t.prototype,\"noise\",{get:function(){return this.uniforms.uNoise},set:function(o){this.uniforms.uNoise=o},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"seed\",{get:function(){return this.uniforms.uSeed},set:function(o){this.uniforms.uSeed=o},enumerable:!1,configurable:!0}),t}(n);export{t as NoiseFilter};\n//# sourceMappingURL=filter-noise.min.js.map\n","/*!\n * @pixi/mixin-cache-as-bitmap - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{RenderTexture as t,BaseTexture as a,Texture as e}from\"@pixi/core\";import{Sprite as i}from\"@pixi/sprite\";import{DisplayObject as r}from\"@pixi/display\";import{Matrix as s}from\"@pixi/math\";import{uid as n}from\"@pixi/utils\";import{settings as h}from\"@pixi/settings\";var o=new s;r.prototype._cacheAsBitmap=!1,r.prototype._cacheData=null,r.prototype._cacheAsBitmapResolution=null;var c=function(){return function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}}();Object.defineProperties(r.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var a;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new c),(a=this._cacheData).originalRender=this.render,a.originalRenderCanvas=this.renderCanvas,a.originalUpdateTransform=this.updateTransform,a.originalCalculateBounds=this.calculateBounds,a.originalGetLocalBounds=this.getLocalBounds,a.originalDestroy=this.destroy,a.originalContainsPoint=this.containsPoint,a.originalMask=this._mask,a.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((a=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=a.originalRender,this.renderCanvas=a.originalRenderCanvas,this.calculateBounds=a.originalCalculateBounds,this.getLocalBounds=a.originalGetLocalBounds,this.destroy=a.originalDestroy,this.updateTransform=a.originalUpdateTransform,this.containsPoint=a.originalContainsPoint,this._mask=a.originalMask,this.filterArea=a.originalFilterArea))}}}),r.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},r.prototype._initCachedDisplayObject=function(r){if(!this._cacheData||!this._cacheData.sprite){var s=this.alpha;this.alpha=1,r.batch.flush();var c=this.getLocalBounds(null,!0).clone();if(this.filters){var l=this.filters[0].padding;c.pad(l)}c.ceil(h.RESOLUTION);var d=r.renderTexture.current,p=r.renderTexture.sourceFrame.clone(),u=r.renderTexture.destinationFrame.clone(),m=r.projection.transform,_=t.create({width:c.width,height:c.height,resolution:this.cacheAsBitmapResolution||r.resolution}),f=\"cacheAsBitmap_\"+n();this._cacheData.textureCacheId=f,a.addToCache(_.baseTexture,f),e.addToCache(_,f);var C=this.transform.localTransform.copyTo(o).invert().translate(-c.x,-c.y);this.render=this._cacheData.originalRender,r.render(this,{renderTexture:_,clear:!0,transform:C,skipUpdateTransform:!1}),r.projection.transform=m,r.renderTexture.bind(d,p,u),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var g=new i(_);g.transform.worldTransform=this.transform.worldTransform,g.anchor.x=-c.x/c.width,g.anchor.y=-c.y/c.height,g.alpha=s,g._bounds=this._bounds,this._cacheData.sprite=g,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=g.containsPoint.bind(g)}},r.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},r.prototype._initCachedDisplayObjectCanvas=function(r){if(!this._cacheData||!this._cacheData.sprite){var s=this.getLocalBounds(null,!0),c=this.alpha;this.alpha=1;var l=r.context,d=r._projTransform;s.ceil(h.RESOLUTION);var p=t.create({width:s.width,height:s.height}),u=\"cacheAsBitmap_\"+n();this._cacheData.textureCacheId=u,a.addToCache(p.baseTexture,u),e.addToCache(p,u);var m=o;this.transform.localTransform.copyTo(m),m.invert(),m.tx-=s.x,m.ty-=s.y,this.renderCanvas=this._cacheData.originalRenderCanvas,r.render(this,{renderTexture:p,clear:!0,transform:m,skipUpdateTransform:!1}),r.context=l,r._projTransform=d,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var _=new i(p);_.transform.worldTransform=this.transform.worldTransform,_.anchor.x=-s.x/s.width,_.anchor.y=-s.y/s.height,_.alpha=c,_._bounds=this._bounds,this._cacheData.sprite=_,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=r._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=_.containsPoint.bind(_)}},r.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},r.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},r.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,a.removeFromCache(this._cacheData.textureCacheId),e.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},r.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)};export{c as CacheData};\n//# sourceMappingURL=mixin-cache-as-bitmap.min.js.map\n","/*!\n * @pixi/mixin-get-child-by-name - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/mixin-get-child-by-name is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{DisplayObject as i,Container as e}from\"@pixi/display\";i.prototype.name=null,e.prototype.getChildByName=function(i,e){for(var r=0,t=this.children.length;r0){var p=n.x-t[d].x,g=n.y-t[d].y,c=Math.sqrt(p*p+g*g);n=t[d],s+=c/a}else s=d/(u-1);h[f]=s,h[f+1]=0,h[f+2]=s,h[f+3]=1}var l=0;for(d=0;d0?this.textureScale*this._width/2:this._width/2;r/=d,h/=d,r*=f,h*=f,o[u]=a.x+r,o[u+1]=a.y+h,o[u+2]=a.x-r,o[u+3]=a.y-h,i=a}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(t),u=function(t){function e(e,h,o){void 0===o&&(o=0);var s=this,n=new a(e.height,h,o),u=new i(e);return o>0&&(e.baseTexture.wrapMode=r.REPEAT),(s=t.call(this,n,u)||this).autoUpdate=!0,s}return s(e,t),e.prototype._render=function(e){var i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),t.prototype._render.call(this,e)},e}(e),d=function(t){function e(e,r,o){var s=this,a=new n(e.width,e.height,r,o),u=new i(h.WHITE);return(s=t.call(this,a,u)||this).texture=e,s}return s(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry;t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build()},Object.defineProperty(e.prototype,\"texture\",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once(\"update\",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off(\"update\",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(e),f=function(e){function r(r,o,s,n,a){void 0===r&&(r=h.EMPTY);var u=this,d=new t(o,s,n);d.getBuffer(\"aVertexPosition\").static=!1;var f=new i(r);return(u=e.call(this,d,f,null,a)||this).autoUpdate=!0,u}return s(r,e),Object.defineProperty(r.prototype,\"vertices\",{get:function(){return this.geometry.getBuffer(\"aVertexPosition\").data},set:function(t){this.geometry.getBuffer(\"aVertexPosition\").data=t},enumerable:!1,configurable:!0}),r.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer(\"aVertexPosition\").update(),e.prototype._render.call(this,t)},r}(e),p=10,g=function(t){function e(e,i,r,o,s){void 0===i&&(i=p),void 0===r&&(r=p),void 0===o&&(o=p),void 0===s&&(s=p);var n=t.call(this,h.WHITE,4,4)||this;return n._origWidth=e.orig.width,n._origHeight=e.orig.height,n._width=n._origWidth,n._height=n._origHeight,n._leftWidth=i,n._rightWidth=o,n._topHeight=r,n._bottomHeight=s,n.texture=e,n}return s(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,\"vertices\",{get:function(){return this.geometry.getBuffer(\"aVertexPosition\").data},set:function(t){this.geometry.getBuffer(\"aVertexPosition\").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,r=this._height>i?1:this._height/i;return Math.min(e,r)},Object.defineProperty(e.prototype,\"width\",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"height\",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"leftWidth\",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"rightWidth\",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"topHeight\",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"bottomHeight\",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=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]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(d);export{g as NineSlicePlane,n as PlaneGeometry,a as RopeGeometry,f as SimpleMesh,d as SimplePlane,u as SimpleRope};\n//# sourceMappingURL=mesh-extras.min.js.map\n","/*!\n * @pixi/sprite-animated - v6.0.2\n * Compiled Mon, 05 Apr 2021 18:17:46 UTC\n *\n * @pixi/sprite-animated is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Texture as t}from\"@pixi/core\";import{Sprite as e}from\"@pixi/sprite\";import{Ticker as r,UPDATE_PRIORITY as i}from\"@pixi/ticker\";var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};var n=function(e){function n(r,i){void 0===i&&(i=!0);var o=e.call(this,r[0]instanceof t?r[0]:r[0].texture)||this;return o._textures=null,o._durations=null,o._autoUpdate=i,o._isConnectedToTicker=!1,o.animationSpeed=1,o.loop=!0,o.updateAnchor=!1,o.onComplete=null,o.onFrameChange=null,o.onLoop=null,o._currentTime=0,o._playing=!1,o._previousFrame=null,o.textures=r,o}return function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(n,e),n.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(r.shared.remove(this.update,this),this._isConnectedToTicker=!1))},n.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(r.shared.add(this.update,this,i.HIGH),this._isConnectedToTicker=!0))},n.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},n.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},n.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var o=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*o,this._currentTime+=o;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())}},n.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},n.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},n.fromFrames=function(e){for(var r=[],i=0;i