![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/sthb/dist/ |
Upload File : |
/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 356: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ipsumLoremWord = exports.identCharacters = void 0; exports.parallelMatch = parallelMatch; exports.randomIdent = randomIdent; exports.randomParagraph = randomParagraph; exports.randomPhrase = randomPhrase; exports.randomSentence = randomSentence; exports.randomWord = randomWord; var _random = __webpack_require__(96212); var identCharacters = exports.identCharacters = function () { var chars = 'qwertyuiopasdfghjklzxcvbnm'; chars = chars + chars.toUpperCase(); var num = '0123456789'; var spect = '_'; return (chars + spect + num).split(''); }(); function randomIdent(length) { if (!(length > 0)) length = 4; var factor = identCharacters; return [factor[Math.random() * (factor.length - 10) >> 0]].concat(Array(length - 1).fill('').map(function () { return factor[Math.random() * factor.length >> 0]; })).join(''); } function parallelMatch(a, b) { var l = Math.min(a.length, b.length); var res = 0; for (var i = 0; i < l; ++i) { if (a[i] == b[i]) ++res; } return res; } var ipsumLoremWord = exports.ipsumLoremWord = ['lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit', 'sed', 'do', 'eiusmod', 'tempor', 'incididunt', 'ut', 'labore', 'et', 'dolore', 'magna', 'aliqua', 'enim', 'ad', 'minim', 'veniam', 'quis', 'nostrud', 'exercitation', 'ullamco', 'laboris', 'nisi', 'aliquip', 'ex', 'ea', 'commodo', 'consequat', 'duis', 'aute', 'irure', 'in', 'reprehenderit', 'voluptate', 'velit', 'esse', 'cillum', 'eu', 'fugiat', 'nulla', 'pariatur', 'excepteur', 'sint', 'occaecat', 'cupidatat', 'non', 'proident', 'sunt', 'culpa', 'qui', 'officia', 'deserunt', 'mollit', 'anim', 'id', 'est', 'laborum', 'perspiciatis', 'unde', 'omnis', 'iste', 'natus', 'error', 'voluptatem', 'accusantium', 'doloremque', 'laudantium', 'totam', 'rem', 'aperiam', 'eaque', 'ipsa', 'quae', 'ab', 'illo', 'inventore', 'veritatis', 'quasi', 'architecto', 'beatae', 'vitae', 'dicta', 'explicabo', 'nemo', 'ipsam', 'quia', 'voluptas', 'aspernatur', 'aut', 'odit', 'fugit', 'consequuntur', 'magni', 'dolores', 'eos', 'ratione', 'sequi', 'nesciunt', 'neque', 'porro', 'quisquam', 'dolorem', 'adipisci', 'numquam', 'eius', 'modi', 'tempora', 'incidunt', 'magnam', 'aliquam', 'quaerat', 'minima', 'nostrum', 'exercitationem', 'ullam', 'corporis', 'suscipit', 'laboriosam', 'aliquid', 'commodi', 'consequatur', 'autem', 'vel', 'eum', 'iure', 'quam', 'nihil', 'molestiae', 'illum', 'quo', 'at', 'vero', 'accusamus', 'iusto', 'odio', 'dignissimos', 'ducimus', 'blanditiis', 'praesentium', 'voluptatum', 'deleniti', 'atque', 'corrupti', 'quos', 'quas', 'molestias', 'excepturi', 'occaecati', 'cupiditate', 'provident', 'similique', 'mollitia', 'animi', 'dolorum', 'fuga', 'harum', 'quidem', 'rerum', 'facilis', 'expedita', 'distinctio', 'nam', 'libero', 'tempore', 'sum', 'soluta', 'nobis', 'eligendi', 'optio', 'cumque', 'impedit', 'minus', 'quod', 'maxime', 'placeat', 'facere', 'possimus', 'assumenda', 'repellendus', 'temporibus', 'quibusdam', 'officiis', 'debitis', 'necessitatibus', 'saepe', 'eveniet', 'voluptates', 'repudiandae', 'recusandae', 'itaque', 'earum', 'hic', 'tenetur', 'a', 'sapiente', 'delectus', 'reiciendis', 'voluptatibus', 'maiores', 'alias', 'perferendis', 'doloribus', 'asperiores', 'repellat', 'integer', 'nec', 'praesent', 'cursus', 'ante', 'dapibus', 'diam', 'sem', 'nibh', 'elementum', 'imperdiet', 'sagittis', 'mauris', 'fusce', 'tellus', 'augue', 'semper', 'porta', 'massa', 'vestibulum', 'lacinia', 'arcu', 'eget', 'class', 'aptent', 'taciti', 'sociosqu', 'litora', 'torquent', 'per', 'conubia', 'nostra', 'inceptos', 'himenaeos', 'curabitur', 'sodales', 'ligula', 'dignissim', 'nunc', 'tortor', 'pellentesque', 'aenean', 'scelerisque', 'maecenas', 'mattis', 'convallis', 'tristique', 'proin', 'egestas', 'porttitor', 'morbi', 'lectus', 'risus', 'iaculis', 'luctus', 'ac', 'turpis', 'aliquet', 'metus', 'ullamcorper', 'tincidunt', 'euismod', 'quisque', 'volutpat', 'condimentum', 'urna', 'facilisi', 'fringilla', 'suspendisse', 'potenti', 'feugiat', 'mi', 'sapien', 'etiam', 'ultrices', 'justo', 'lacus', 'pharetra', 'auctor', 'interdum', 'primis', 'faucibus', 'orci', 'posuere', 'cubilia', 'curae', 'molestie', 'dui', 'blandit', 'congue', 'pede', 'facilisis', 'laoreet', 'donec', 'viverra', 'malesuada', 'pulvinar', 'sollicitudin', 'cras', 'nisl', 'felis', 'venenatis', 'ultricies', 'accumsan', 'pretium', 'fermentum', 'nullam', 'purus', 'mollis', 'vivamus', 'consectetuer']; function randomWord() { var arr = ipsumLoremWord; var idx = (0, _random.randomInt)(0, arr.length - 1); return arr[idx]; } /** * @param {number}arg1 * @param {number=}arg2 * @also * @param {number} arg1 * @returns {string} */ function randomPhrase(arg1, arg2) { var limitLength = arguments[arguments.length - 1]; var minLength = 1; if (arguments.length > 1) minLength = arguments[0]; if (!limitLength) limitLength = 50; var length = Math.ceil((Math.random() * (limitLength - minLength) + minLength) / 7); return new Array(length).fill(null).map(randomWord).reduce(function (ac, cr) { if (ac.length + cr.length < limitLength || ac.length < minLength) { ac.parts.push(cr); } return ac; }, { parts: [], length: 0 }).parts.join(' '); } function randomSentence(limitLenght) { if (!limitLenght) limitLenght = 300; var length = Math.ceil(Math.random() * limitLenght / 70); var res = new Array(length).fill(null).map(function (value) { return randomPhrase(value); }).reduce(function (ac, cr) { if (ac.length + cr.length < limitLenght) { ac.parts.push(cr); } return ac; }, { parts: [], length: 0 }).parts.join(', '); if (Math.random() < 0.03) { res = res.replace(/\,/i, ':'); } res = res.replace(/^./, function (x) { return x.toUpperCase(); }); res += '.'; return res; } function randomParagraph(limitLength) { if (!limitLength) limitLength = 1000; var length = Math.ceil(Math.random() * limitLength / 200); return new Array(length).fill(null).map(function (value) { return randomSentence(value); }).reduce(function (ac, cr) { if (ac.length + cr.length < limitLength) { ac.parts.push(cr); } return ac; }, { parts: [], length: 0 }).parts.join(' '); } /***/ }), /***/ 407: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var BlendModeFilter = __webpack_require__(8948); var GLhls = __webpack_require__(44064); var GPUhls = __webpack_require__(505); var AlphaFilter = __webpack_require__(60375); var BlurFilter = __webpack_require__(38991); var BlurFilterPass = __webpack_require__(9154); var _const = __webpack_require__(59249); var generateBlurFragSource = __webpack_require__(76421); var generateBlurGlProgram = __webpack_require__(45299); var generateBlurVertSource = __webpack_require__(34278); var generateBlurProgram = __webpack_require__(69177); var ColorMatrixFilter = __webpack_require__(9972); var DisplacementFilter = __webpack_require__(31503); var NoiseFilter = __webpack_require__(50859); var Filter = __webpack_require__(92393); var FilterEffect = __webpack_require__(51856); var FilterPipe = __webpack_require__(43717); var FilterSystem = __webpack_require__(10116); var MaskFilter = __webpack_require__(9012); var blendTemplate = __webpack_require__(1196); var blendTemplate$1 = __webpack_require__(54807); var blendTemplate$2 = __webpack_require__(83873); var hsl = __webpack_require__(74486); var alpha = __webpack_require__(61507); var alpha$1 = __webpack_require__(25082); var blurTemplate = __webpack_require__(82422); var colorMatrixFilter = __webpack_require__(79556); var colorMatrixFilter$1 = __webpack_require__(45001); var defaultFilter = __webpack_require__(78440); var displacement = __webpack_require__(53659); var displacement$1 = __webpack_require__(5144); var displacement$2 = __webpack_require__(70818); var noise = __webpack_require__(55191); var noise$1 = __webpack_require__(83014); var mask = __webpack_require__(6586); var mask$1 = __webpack_require__(72521); var mask$2 = __webpack_require__(56655); "use strict"; exports.BlendModeFilter = BlendModeFilter.BlendModeFilter; exports.hslgl = GLhls.hslgl; exports.hslgpu = GPUhls.hslgpu; exports.AlphaFilter = AlphaFilter.AlphaFilter; exports.BlurFilter = BlurFilter.BlurFilter; exports.BlurFilterPass = BlurFilterPass.BlurFilterPass; exports.GAUSSIAN_VALUES = _const.GAUSSIAN_VALUES; exports.generateBlurFragSource = generateBlurFragSource.generateBlurFragSource; exports.generateBlurGlProgram = generateBlurGlProgram.generateBlurGlProgram; exports.generateBlurVertSource = generateBlurVertSource.generateBlurVertSource; exports.generateBlurProgram = generateBlurProgram.generateBlurProgram; exports.ColorMatrixFilter = ColorMatrixFilter.ColorMatrixFilter; exports.DisplacementFilter = DisplacementFilter.DisplacementFilter; exports.NoiseFilter = NoiseFilter.NoiseFilter; exports.Filter = Filter.Filter; exports.FilterEffect = FilterEffect.FilterEffect; exports.FilterPipe = FilterPipe.FilterPipe; exports.FilterSystem = FilterSystem.FilterSystem; exports.MaskFilter = MaskFilter.MaskFilter; exports.blendTemplateFrag = blendTemplate["default"]; exports.blendTemplateVert = blendTemplate$1["default"]; exports.blendTemplateWgsl = blendTemplate$2["default"]; exports.hslWgsl = hsl["default"]; exports.alphaFrag = alpha["default"]; exports.alphaWgsl = alpha$1["default"]; exports.blurTemplateWgsl = blurTemplate["default"]; exports.colorMatrixFilterFrag = colorMatrixFilter["default"]; exports.colorMatrixFilterWgsl = colorMatrixFilter$1["default"]; exports.defaultFilterVert = defaultFilter["default"]; exports.displacementFrag = displacement["default"]; exports.displacementVert = displacement$1["default"]; exports.displacementWgsl = displacement$2["default"]; exports.noiseFrag = noise["default"]; exports.noiseWgsl = noise$1["default"]; exports.maskFrag = mask["default"]; exports.maskVert = mask$1["default"]; exports.maskWgsl = mask$2["default"]; /***/ }), /***/ 505: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var hslgpu = "\n\tfn getLuminosity(c: vec3<f32>) -> f32\n\t{\n\t\treturn 0.3*c.r + 0.59*c.g + 0.11*c.b;\n\t}\n\n\tfn setLuminosity(c: vec3<f32>, lum: f32) -> vec3<f32>\n\t{\n\t\tvar modLum: f32 = lum - getLuminosity(c);\n\t\tvar color: vec3<f32> = c.rgb + modLum;\n\n\t\t// clip back into legal range\n\t\tmodLum = getLuminosity(color);\n\t\tlet modLumVec = vec3<f32>(modLum);\n\n\t\tlet cMin: f32 = min(color.r, min(color.g, color.b));\n\t\tlet cMax: f32 = max(color.r, max(color.g, color.b));\n\n\t\tif(cMin < 0.0)\n\t\t{\n\t\t\tcolor = mix(modLumVec, color, modLum / (modLum - cMin));\n\t\t}\n\n\t\tif(cMax > 1.0)\n\t\t{\n\t\t\tcolor = mix(modLumVec, color, (1 - modLum) / (cMax - modLum));\n\t\t}\n\n\t\treturn color;\n\t}\n\n\tfn getSaturation(c: vec3<f32>) -> f32\n\t{\n\t\treturn max(c.r, max(c.g, c.b)) - min(c.r, min(c.g, c.b));\n\t}\n\n\tfn setSaturationMinMidMax(cSorted: vec3<f32>, s: f32) -> vec3<f32>\n\t{\n\t\tvar colorSorted = cSorted;\n\n\t\tif(colorSorted.z > colorSorted.x)\n\t\t{\n\t\t\tcolorSorted.y = (((colorSorted.y - colorSorted.x) * s) / (colorSorted.z - colorSorted.x));\n\t\t\tcolorSorted.z = s;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcolorSorted.y = 0;\n\t\t\tcolorSorted.z = 0;\n\t\t}\n\n\t\tcolorSorted.x = 0;\n\n\t\treturn colorSorted;\n\t}\n\n\tfn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32>\n\t{\n\t\tvar color = c;\n\n\t\tif (color.r <= color.g && color.r <= color.b)\n\t\t{\n\t\t\tif (color.g <= color.b)\n\t\t\t{\n\t\t\t\tcolor = vec3<f32>(setSaturationMinMidMax(color.rgb, s)).rgb;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcolor = vec3<f32>(setSaturationMinMidMax(color.rbg, s)).rbg;\n\t\t\t}\n\t\t}\n\t\telse if (color.g <= color.r && color.g <= color.b)\n\t\t{\n\t\t\tif (color.r <= color.b)\n\t\t\t{\n\t\t\t\tcolor = vec3<f32>(setSaturationMinMidMax(color.grb, s)).grb;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcolor = vec3<f32>(setSaturationMinMidMax(color.gbr, s)).gbr;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Using bgr for both fixes part of hue\n\t\t\tif (color.r <= color.g)\n\t\t\t{\n\t\t\t\tcolor = vec3<f32>(setSaturationMinMidMax(color.brg, s)).brg;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcolor = vec3<f32>(setSaturationMinMidMax(color.bgr, s)).bgr;\n\t\t\t}\n\t\t}\n\n\t\treturn color;\n\t}\n\t"; exports.hslgpu = hslgpu; /***/ }), /***/ 755: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropSet(t, e, o, r, p, f) { return _set(_getPrototypeOf(f ? t.prototype : t), e, o, r, p); } function set(e, r, t, o) { return set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) { var f, i = _superPropBase(e, r); if (i) { if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), !0; if (!f.writable) return !1; } if (f = Object.getOwnPropertyDescriptor(o, r)) { if (!f.writable) return !1; f.value = t, Object.defineProperty(o, r, f); } else _defineProperty(o, r, t); return !0; }, set(e, r, t, o); } function _set(e, r, t, o, f) { if (!set(e, r, t, o || e) && f) throw new TypeError("failed to set property"); return t; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var warn = __webpack_require__(57371); var TextStyle = __webpack_require__(55858); var generateTextStyleKey = __webpack_require__(5070); var textStyleToCSS = __webpack_require__(85080); "use strict"; var HTMLTextStyle = /*#__PURE__*/function (_TextStyle$TextStyle) { function HTMLTextStyle() { var _this$cssOverrides, _options$tagStyles; var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, HTMLTextStyle); _this = _callSuper(this, HTMLTextStyle, [options]); _this._cssOverrides = []; (_this$cssOverrides = _this.cssOverrides) !== null && _this$cssOverrides !== void 0 ? _this$cssOverrides : _this.cssOverrides = options.cssOverrides; _this.tagStyles = (_options$tagStyles = options.tagStyles) !== null && _options$tagStyles !== void 0 ? _options$tagStyles : {}; return _this; } /** List of style overrides that will be applied to the HTML text. */ _inherits(HTMLTextStyle, _TextStyle$TextStyle); return _createClass(HTMLTextStyle, [{ key: "cssOverrides", get: function get() { return this._cssOverrides; }, set: function set(value) { this._cssOverrides = value instanceof Array ? value : [value]; this.update(); } }, { key: "_generateKey", value: function _generateKey() { this._styleKey = generateTextStyleKey.generateTextStyleKey(this) + this._cssOverrides.join("-"); return this._styleKey; } }, { key: "update", value: function update() { this._cssStyle = null; _superPropGet(HTMLTextStyle, "update", this, 3)([]); } /** * Creates a new HTMLTextStyle object with the same values as this one. * @returns New cloned HTMLTextStyle object */ }, { key: "clone", value: function clone() { return new HTMLTextStyle({ align: this.align, breakWords: this.breakWords, dropShadow: this.dropShadow ? _objectSpread({}, this.dropShadow) : null, fill: this._fill, fontFamily: this.fontFamily, fontSize: this.fontSize, fontStyle: this.fontStyle, fontVariant: this.fontVariant, fontWeight: this.fontWeight, letterSpacing: this.letterSpacing, lineHeight: this.lineHeight, padding: this.padding, stroke: this._stroke, whiteSpace: this.whiteSpace, wordWrap: this.wordWrap, wordWrapWidth: this.wordWrapWidth, cssOverrides: this.cssOverrides }); } }, { key: "cssStyle", get: function get() { if (!this._cssStyle) { this._cssStyle = textStyleToCSS.textStyleToCSS(this); } return this._cssStyle; } /** * Add a style override, this can be any CSS property * it will override any built-in style. This is the * property and the value as a string (e.g., `color: red`). * This will override any other internal style. * @param {string} value - CSS style(s) to add. * @example * style.addOverride('background-color: red'); */ }, { key: "addOverride", value: function addOverride() { var _this2 = this; for (var _len = arguments.length, value = new Array(_len), _key = 0; _key < _len; _key++) { value[_key] = arguments[_key]; } var toAdd = value.filter(function (v) { return !_this2.cssOverrides.includes(v); }); if (toAdd.length > 0) { var _this$cssOverrides2; (_this$cssOverrides2 = this.cssOverrides).push.apply(_this$cssOverrides2, _toConsumableArray(toAdd)); this.update(); } } /** * Remove any overrides that match the value. * @param {string} value - CSS style to remove. * @example * style.removeOverride('background-color: red'); */ }, { key: "removeOverride", value: function removeOverride() { var _this3 = this; for (var _len2 = arguments.length, value = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { value[_key2] = arguments[_key2]; } var toRemove = value.filter(function (v) { return _this3.cssOverrides.includes(v); }); if (toRemove.length > 0) { this.cssOverrides = this.cssOverrides.filter(function (v) { return !toRemove.includes(v); }); this.update(); } } }, { key: "fill", set: function set(value) { if (typeof value !== "string" && typeof value !== "number") { warn.warn("[HTMLTextStyle] only color fill is not supported by HTMLText"); } _superPropSet(HTMLTextStyle, "fill", value, this, 1, 1); } }, { key: "stroke", set: function set(value) { if (value && typeof value !== "string" && typeof value !== "number") { warn.warn("[HTMLTextStyle] only color stroke is not supported by HTMLText"); } _superPropSet(HTMLTextStyle, "stroke", value, this, 1, 1); } }]); }(TextStyle.TextStyle); exports.HTMLTextStyle = HTMLTextStyle; /***/ }), /***/ 800: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var warn = __webpack_require__(57371); var Geometry = __webpack_require__(18964); var Shader = __webpack_require__(27866); var State = __webpack_require__(84938); var TextureSource = __webpack_require__(55406); var Texture = __webpack_require__(73782); var GlProgram = __webpack_require__(23896); "use strict"; var bigTriangleGeometry = new Geometry.Geometry({ attributes: { aPosition: [-1, -1, // Bottom left corner 3, -1, // Bottom right corner, extending beyond right edge -1, 3 // Top left corner, extending beyond top edge ] } }); var _GlBackBufferSystem = /*#__PURE__*/function () { function _GlBackBufferSystem(renderer) { _classCallCheck(this, _GlBackBufferSystem); /** if true, the back buffer is used */ this.useBackBuffer = false; this._useBackBufferThisRender = false; this._renderer = renderer; } return _createClass(_GlBackBufferSystem, [{ key: "init", value: function init() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _GlBackBufferSystem$d = _objectSpread(_objectSpread({}, _GlBackBufferSystem.defaultOptions), options), useBackBuffer = _GlBackBufferSystem$d.useBackBuffer, antialias = _GlBackBufferSystem$d.antialias; this.useBackBuffer = useBackBuffer; this._antialias = antialias; if (!this._renderer.context.supports.msaa) { warn.warn("antialiasing, is not supported on when using the back buffer"); this._antialias = false; } this._state = State.State.for2d(); var bigTriangleProgram = new GlProgram.GlProgram({ vertex: "\n attribute vec2 aPosition;\n out vec2 vUv;\n\n void main() {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n\n vUv = (aPosition + 1.0) / 2.0;\n\n // flip dem UVs\n vUv.y = 1.0 - vUv.y;\n }", fragment: "\n in vec2 vUv;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n void main() {\n finalColor = texture(uTexture, vUv);\n }", name: "big-triangle" }); this._bigTriangleShader = new Shader.Shader({ glProgram: bigTriangleProgram, resources: { uTexture: Texture.Texture.WHITE.source } }); } /** * This is called before the RenderTargetSystem is started. This is where * we replace the target with the back buffer if required. * @param options - The options for this render. */ }, { key: "renderStart", value: function renderStart(options) { var renderTarget = this._renderer.renderTarget.getRenderTarget(options.target); this._useBackBufferThisRender = this.useBackBuffer && !!renderTarget.isRoot; if (this._useBackBufferThisRender) { var renderTarget2 = this._renderer.renderTarget.getRenderTarget(options.target); this._targetTexture = renderTarget2.colorTexture; options.target = this._getBackBufferTexture(renderTarget2.colorTexture); } } }, { key: "renderEnd", value: function renderEnd() { this._presentBackBuffer(); } }, { key: "_presentBackBuffer", value: function _presentBackBuffer() { var renderer = this._renderer; renderer.renderTarget.finishRenderPass(); if (!this._useBackBufferThisRender) return; renderer.renderTarget.bind(this._targetTexture, false); this._bigTriangleShader.resources.uTexture = this._backBufferTexture.source; renderer.encoder.draw({ geometry: bigTriangleGeometry, shader: this._bigTriangleShader, state: this._state }); } }, { key: "_getBackBufferTexture", value: function _getBackBufferTexture(targetSourceTexture) { this._backBufferTexture = this._backBufferTexture || new Texture.Texture({ source: new TextureSource.TextureSource({ width: targetSourceTexture.width, height: targetSourceTexture.height, resolution: targetSourceTexture._resolution, antialias: this._antialias }) }); this._backBufferTexture.source.resize(targetSourceTexture.width, targetSourceTexture.height, targetSourceTexture._resolution); return this._backBufferTexture; } /** destroys the back buffer */ }, { key: "destroy", value: function destroy() { if (this._backBufferTexture) { this._backBufferTexture.destroy(); this._backBufferTexture = null; } } }]); }(); /** @ignore */ _GlBackBufferSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "backBuffer", priority: 1 }; /** default options for the back buffer system */ _GlBackBufferSystem.defaultOptions = { /** if true will use the back buffer where required */ useBackBuffer: false }; var GlBackBufferSystem = _GlBackBufferSystem; exports.GlBackBufferSystem = GlBackBufferSystem; /***/ }), /***/ 968: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 1021: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function getGeometryBounds(geometry, attributeId, bounds) { var attribute = geometry.getAttribute(attributeId); if (!attribute) { bounds.minX = 0; bounds.minY = 0; bounds.maxX = 0; bounds.maxY = 0; return bounds; } var data = attribute.buffer.data; var minX = Infinity; var minY = Infinity; var maxX = -Infinity; var maxY = -Infinity; var byteSize = data.BYTES_PER_ELEMENT; var offset = (attribute.offset || 0) / byteSize; var stride = (attribute.stride || 2 * 4) / byteSize; for (var i = offset; i < data.length; i += stride) { var x = data[i]; var y = data[i + 1]; if (x > maxX) maxX = x; if (y > maxY) maxY = y; if (x < minX) minX = x; if (y < minY) minY = y; } bounds.minX = minX; bounds.minY = minY; bounds.maxX = maxX; bounds.maxY = maxY; return bounds; } exports.getGeometryBounds = getGeometryBounds; /***/ }), /***/ 1196: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var blendTemplateFrag = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nout vec4 finalColor;\n\nuniform float uBlend;\n\nuniform sampler2D uTexture;\nuniform sampler2D uBackTexture;\n\n{FUNCTIONS}\n\nvoid main()\n{ \n vec4 back = texture(uBackTexture, vTextureCoord);\n vec4 front = texture(uTexture, vTextureCoord);\n float blendedAlpha = front.a + back.a * (1.0 - front.a);\n \n {MAIN}\n}\n"; exports["default"] = blendTemplateFrag; /***/ }), /***/ 1226: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 1336: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Rectangle = __webpack_require__(74731); "use strict"; var fullFrame = new Rectangle.Rectangle(0, 0, 1, 1); function viewportFromFrame(viewport, source, frame) { frame || (frame = fullFrame); var pixelWidth = source.pixelWidth; var pixelHeight = source.pixelHeight; viewport.x = frame.x * pixelWidth | 0; viewport.y = frame.y * pixelHeight | 0; viewport.width = frame.width * pixelWidth | 0; viewport.height = frame.height * pixelHeight | 0; return viewport; } exports.viewportFromFrame = viewportFromFrame; /***/ }), /***/ 1484: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var uid = __webpack_require__(90844); "use strict"; var BufferResource = /*#__PURE__*/function (_EventEmitter) { /** * Create a new Buffer Resource. * @param options - The options for the buffer resource * @param options.buffer - The underlying buffer that this resource is using * @param options.offset - The offset of the buffer this resource is using. * If not provided, then it will use the offset of the buffer. * @param options.size - The size of the buffer this resource is using. * If not provided, then it will use the size of the buffer. */ function BufferResource(_ref) { var _this; var buffer = _ref.buffer, offset = _ref.offset, size = _ref.size; _classCallCheck(this, BufferResource); _this = _callSuper(this, BufferResource); /** * emits when the underlying buffer has changed shape (i.e. resized) * letting the renderer know that it needs to discard the old buffer on the GPU and create a new one * @event change */ /** a unique id for this uniform group used through the renderer */ _this.uid = uid.uid("buffer"); /** * a resource type, used to identify how to handle it when its in a bind group / shader resource * @internal * @ignore */ _this._resourceType = "bufferResource"; /** * used internally to know if a uniform group was used in the last render pass * @internal * @ignore */ _this._touched = 0; /** * the resource id used internally by the renderer to build bind group keys * @internal * @ignore */ _this._resourceId = uid.uid("resource"); /** * A cheeky hint to the GL renderer to let it know this is a BufferResource * @internal * @ignore */ _this._bufferResource = true; /** * Has the Buffer resource been destroyed? * @readonly */ _this.destroyed = false; _this.buffer = buffer; _this.offset = offset | 0; _this.size = size; _this.buffer.on("change", _this.onBufferChange, _this); return _this; } _inherits(BufferResource, _EventEmitter); return _createClass(BufferResource, [{ key: "onBufferChange", value: function onBufferChange() { this._resourceId = uid.uid("resource"); this.emit("change", this); } /** * Destroys this resource. Make sure the underlying buffer is not used anywhere else * if you want to destroy it as well, or code will explode * @param destroyBuffer - Should the underlying buffer be destroyed as well? */ }, { key: "destroy", value: function destroy() { var destroyBuffer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this.destroyed = true; if (destroyBuffer) { this.buffer.destroy(); } this.emit("change", this); this.buffer = null; } }]); }(EventEmitter); exports.BufferResource = BufferResource; /***/ }), /***/ 1635: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var adapter = __webpack_require__(72450); var fontStringFromTextStyle = __webpack_require__(30145); "use strict"; var contextSettings = { // TextMetrics requires getImageData readback for measuring fonts. willReadFrequently: true }; var _CanvasTextMetrics = /*#__PURE__*/function () { /** * @param text - the text that was measured * @param style - the style that was measured * @param width - the measured width of the text * @param height - the measured height of the text * @param lines - an array of the lines of text broken by new lines and wrapping if specified in style * @param lineWidths - an array of the line widths for each line matched to `lines` * @param lineHeight - the measured line height for this style * @param maxLineWidth - the maximum line width for all measured lines * @param {FontMetrics} fontProperties - the font properties object from TextMetrics.measureFont */ function _CanvasTextMetrics(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties) { _classCallCheck(this, _CanvasTextMetrics); this.text = text; this.style = style; this.width = width; this.height = height; this.lines = lines; this.lineWidths = lineWidths; this.lineHeight = lineHeight; this.maxLineWidth = maxLineWidth; this.fontProperties = fontProperties; } /** * Measures the supplied string of text and returns a Rectangle. * @param text - The text to measure. * @param style - The text style to use for measuring * @param canvas - optional specification of the canvas to use for measuring. * @param wordWrap * @returns Measured width and height of the text. */ return _createClass(_CanvasTextMetrics, null, [{ key: "experimentalLetterSpacingSupported", get: /** * Checking that we can use modern canvas 2D API. * * Note: This is an unstable API, Chrome < 94 use `textLetterSpacing`, later versions use `letterSpacing`. * @see TextMetrics.experimentalLetterSpacing * @see https://developer.mozilla.org/en-US/docs/Web/API/ICanvasRenderingContext2D/letterSpacing * @see https://developer.chrome.com/origintrials/#/view_trial/3585991203293757441 */ function get() { var result = _CanvasTextMetrics._experimentalLetterSpacingSupported; if (result !== void 0) { var proto = adapter.DOMAdapter.get().getCanvasRenderingContext2D().prototype; result = _CanvasTextMetrics._experimentalLetterSpacingSupported = "letterSpacing" in proto || "textLetterSpacing" in proto; } return result; } }, { key: "measureText", value: function measureText() { var _style$_stroke; var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : " "; var style = arguments.length > 1 ? arguments[1] : undefined; var canvas = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _CanvasTextMetrics._canvas; var wordWrap = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : style.wordWrap; var textKey = "".concat(text, ":").concat(style.styleKey); if (_CanvasTextMetrics._measurementCache[textKey]) return _CanvasTextMetrics._measurementCache[textKey]; var font = fontStringFromTextStyle.fontStringFromTextStyle(style); var fontProperties = _CanvasTextMetrics.measureFont(font); if (fontProperties.fontSize === 0) { fontProperties.fontSize = style.fontSize; fontProperties.ascent = style.fontSize; } var context = _CanvasTextMetrics.__context; context.font = font; var outputText = wordWrap ? _CanvasTextMetrics._wordWrap(text, style, canvas) : text; var lines = outputText.split(/(?:\r\n|\r|\n)/); var lineWidths = new Array(lines.length); var maxLineWidth = 0; for (var i = 0; i < lines.length; i++) { var lineWidth = _CanvasTextMetrics._measureText(lines[i], style.letterSpacing, context); lineWidths[i] = lineWidth; maxLineWidth = Math.max(maxLineWidth, lineWidth); } var strokeWidth = ((_style$_stroke = style._stroke) === null || _style$_stroke === void 0 ? void 0 : _style$_stroke.width) || 0; var width = maxLineWidth + strokeWidth; if (style.dropShadow) { width += style.dropShadow.distance; } var lineHeight = style.lineHeight || fontProperties.fontSize; var height = Math.max(lineHeight, fontProperties.fontSize + strokeWidth) + (lines.length - 1) * (lineHeight + style.leading); if (style.dropShadow) { height += style.dropShadow.distance; } var measurements = new _CanvasTextMetrics(text, style, width, height, lines, lineWidths, lineHeight + style.leading, maxLineWidth, fontProperties); return measurements; } }, { key: "_measureText", value: function _measureText(text, letterSpacing, context) { var useExperimentalLetterSpacing = false; if (_CanvasTextMetrics.experimentalLetterSpacingSupported) { if (_CanvasTextMetrics.experimentalLetterSpacing) { context.letterSpacing = "".concat(letterSpacing, "px"); context.textLetterSpacing = "".concat(letterSpacing, "px"); useExperimentalLetterSpacing = true; } else { context.letterSpacing = "0px"; context.textLetterSpacing = "0px"; } } var metrics = context.measureText(text); var metricWidth = metrics.width; var actualBoundingBoxLeft = -metrics.actualBoundingBoxLeft; var actualBoundingBoxRight = metrics.actualBoundingBoxRight; var boundsWidth = actualBoundingBoxRight - actualBoundingBoxLeft; if (metricWidth > 0) { if (useExperimentalLetterSpacing) { metricWidth -= letterSpacing; boundsWidth -= letterSpacing; } else { var val = (_CanvasTextMetrics.graphemeSegmenter(text).length - 1) * letterSpacing; metricWidth += val; boundsWidth += val; } } return Math.max(metricWidth, boundsWidth); } /** * Applies newlines to a string to have it optimally fit into the horizontal * bounds set by the Text object's wordWrapWidth property. * @param text - String to apply word wrapping to * @param style - the style to use when wrapping * @param canvas - optional specification of the canvas to use for measuring. * @returns New string with new lines applied where required */ }, { key: "_wordWrap", value: function _wordWrap(text, style) { var canvas = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _CanvasTextMetrics._canvas; var context = canvas.getContext("2d", contextSettings); var width = 0; var line = ""; var lines = ""; var cache = /* @__PURE__ */Object.create(null); var letterSpacing = style.letterSpacing, whiteSpace = style.whiteSpace; var collapseSpaces = _CanvasTextMetrics._collapseSpaces(whiteSpace); var collapseNewlines = _CanvasTextMetrics._collapseNewlines(whiteSpace); var canPrependSpaces = !collapseSpaces; var wordWrapWidth = style.wordWrapWidth + letterSpacing; var tokens = _CanvasTextMetrics._tokenize(text); for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (_CanvasTextMetrics._isNewline(token)) { if (!collapseNewlines) { lines += _CanvasTextMetrics._addLine(line); canPrependSpaces = !collapseSpaces; line = ""; width = 0; continue; } token = " "; } if (collapseSpaces) { var currIsBreakingSpace = _CanvasTextMetrics.isBreakingSpace(token); var lastIsBreakingSpace = _CanvasTextMetrics.isBreakingSpace(line[line.length - 1]); if (currIsBreakingSpace && lastIsBreakingSpace) { continue; } } var tokenWidth = _CanvasTextMetrics._getFromCache(token, letterSpacing, cache, context); if (tokenWidth > wordWrapWidth) { if (line !== "") { lines += _CanvasTextMetrics._addLine(line); line = ""; width = 0; } if (_CanvasTextMetrics.canBreakWords(token, style.breakWords)) { var characters = _CanvasTextMetrics.wordWrapSplit(token); for (var j = 0; j < characters.length; j++) { var _char2 = characters[j]; var lastChar = _char2; var k = 1; while (characters[j + k]) { var nextChar = characters[j + k]; if (!_CanvasTextMetrics.canBreakChars(lastChar, nextChar, token, j, style.breakWords)) { _char2 += nextChar; } else { break; } lastChar = nextChar; k++; } j += k - 1; var characterWidth = _CanvasTextMetrics._getFromCache(_char2, letterSpacing, cache, context); if (characterWidth + width > wordWrapWidth) { lines += _CanvasTextMetrics._addLine(line); canPrependSpaces = false; line = ""; width = 0; } line += _char2; width += characterWidth; } } else { if (line.length > 0) { lines += _CanvasTextMetrics._addLine(line); line = ""; width = 0; } var isLastToken = i === tokens.length - 1; lines += _CanvasTextMetrics._addLine(token, !isLastToken); canPrependSpaces = false; line = ""; width = 0; } } else { if (tokenWidth + width > wordWrapWidth) { canPrependSpaces = false; lines += _CanvasTextMetrics._addLine(line); line = ""; width = 0; } if (line.length > 0 || !_CanvasTextMetrics.isBreakingSpace(token) || canPrependSpaces) { line += token; width += tokenWidth; } } } lines += _CanvasTextMetrics._addLine(line, false); return lines; } /** * Convenience function for logging each line added during the wordWrap method. * @param line - The line of text to add * @param newLine - Add new line character to end * @returns A formatted line */ }, { key: "_addLine", value: function _addLine(line) { var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; line = _CanvasTextMetrics._trimRight(line); line = newLine ? "".concat(line, "\n") : line; return line; } /** * Gets & sets the widths of calculated characters in a cache object * @param key - The key * @param letterSpacing - The letter spacing * @param cache - The cache * @param context - The canvas context * @returns The from cache. */ }, { key: "_getFromCache", value: function _getFromCache(key, letterSpacing, cache, context) { var width = cache[key]; if (typeof width !== "number") { width = _CanvasTextMetrics._measureText(key, letterSpacing, context) + letterSpacing; cache[key] = width; } return width; } /** * Determines whether we should collapse breaking spaces. * @param whiteSpace - The TextStyle property whiteSpace * @returns Should collapse */ }, { key: "_collapseSpaces", value: function _collapseSpaces(whiteSpace) { return whiteSpace === "normal" || whiteSpace === "pre-line"; } /** * Determines whether we should collapse newLine chars. * @param whiteSpace - The white space * @returns should collapse */ }, { key: "_collapseNewlines", value: function _collapseNewlines(whiteSpace) { return whiteSpace === "normal"; } /** * Trims breaking whitespaces from string. * @param text - The text * @returns Trimmed string */ }, { key: "_trimRight", value: function _trimRight(text) { if (typeof text !== "string") { return ""; } for (var i = text.length - 1; i >= 0; i--) { var _char3 = text[i]; if (!_CanvasTextMetrics.isBreakingSpace(_char3)) { break; } text = text.slice(0, -1); } return text; } /** * Determines if char is a newline. * @param char - The character * @returns True if newline, False otherwise. */ }, { key: "_isNewline", value: function _isNewline(_char4) { if (typeof _char4 !== "string") { return false; } return _CanvasTextMetrics._newlines.includes(_char4.charCodeAt(0)); } /** * Determines if char is a breaking whitespace. * * It allows one to determine whether char should be a breaking whitespace * For example certain characters in CJK langs or numbers. * It must return a boolean. * @param char - The character * @param [_nextChar] - The next character * @returns True if whitespace, False otherwise. */ }, { key: "isBreakingSpace", value: function isBreakingSpace(_char5, _nextChar) { if (typeof _char5 !== "string") { return false; } return _CanvasTextMetrics._breakingSpaces.includes(_char5.charCodeAt(0)); } /** * Splits a string into words, breaking-spaces and newLine characters * @param text - The text * @returns A tokenized array */ }, { key: "_tokenize", value: function _tokenize(text) { var tokens = []; var token = ""; if (typeof text !== "string") { return tokens; } for (var i = 0; i < text.length; i++) { var _char6 = text[i]; var nextChar = text[i + 1]; if (_CanvasTextMetrics.isBreakingSpace(_char6, nextChar) || _CanvasTextMetrics._isNewline(_char6)) { if (token !== "") { tokens.push(token); token = ""; } tokens.push(_char6); continue; } token += _char6; } if (token !== "") { tokens.push(token); } return tokens; } /** * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior. * * It allows one to customise which words should break * Examples are if the token is CJK or numbers. * It must return a boolean. * @param _token - The token * @param breakWords - The style attr break words * @returns Whether to break word or not */ }, { key: "canBreakWords", value: function canBreakWords(_token, breakWords) { return breakWords; } /** * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior. * * It allows one to determine whether a pair of characters * should be broken by newlines * For example certain characters in CJK langs or numbers. * It must return a boolean. * @param _char - The character * @param _nextChar - The next character * @param _token - The token/word the characters are from * @param _index - The index in the token of the char * @param _breakWords - The style attr break words * @returns whether to break word or not */ }, { key: "canBreakChars", value: function canBreakChars(_char, _nextChar, _token, _index, _breakWords) { return true; } /** * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior. * * It is called when a token (usually a word) has to be split into separate pieces * in order to determine the point to break a word. * It must return an array of characters. * @param token - The token to split * @returns The characters of the token * @see CanvasTextMetrics.graphemeSegmenter */ }, { key: "wordWrapSplit", value: function wordWrapSplit(token) { return _CanvasTextMetrics.graphemeSegmenter(token); } /** * Calculates the ascent, descent and fontSize of a given font-style * @param font - String representing the style of the font * @returns Font properties object */ }, { key: "measureFont", value: function measureFont(font) { if (_CanvasTextMetrics._fonts[font]) { return _CanvasTextMetrics._fonts[font]; } var context = _CanvasTextMetrics._context; context.font = font; var metrics = context.measureText(_CanvasTextMetrics.METRICS_STRING + _CanvasTextMetrics.BASELINE_SYMBOL); var properties = { ascent: metrics.actualBoundingBoxAscent, descent: metrics.actualBoundingBoxDescent, fontSize: metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent }; _CanvasTextMetrics._fonts[font] = properties; return properties; } /** * Clear font metrics in metrics cache. * @param {string} [font] - font name. If font name not set then clear cache for all fonts. */ }, { key: "clearMetrics", value: function clearMetrics() { var font = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; if (font) { delete _CanvasTextMetrics._fonts[font]; } else { _CanvasTextMetrics._fonts = {}; } } /** * Cached canvas element for measuring text * TODO: this should be private, but isn't because of backward compat, will fix later. * @ignore */ }, { key: "_canvas", get: function get() { if (!_CanvasTextMetrics.__canvas) { var canvas; try { var c = new OffscreenCanvas(0, 0); var context = c.getContext("2d", contextSettings); if (context !== null && context !== void 0 && context.measureText) { _CanvasTextMetrics.__canvas = c; return c; } canvas = adapter.DOMAdapter.get().createCanvas(); } catch (_cx) { canvas = adapter.DOMAdapter.get().createCanvas(); } canvas.width = canvas.height = 10; _CanvasTextMetrics.__canvas = canvas; } return _CanvasTextMetrics.__canvas; } /** * TODO: this should be private, but isn't because of backward compat, will fix later. * @ignore */ }, { key: "_context", get: function get() { if (!_CanvasTextMetrics.__context) { _CanvasTextMetrics.__context = _CanvasTextMetrics._canvas.getContext("2d", contextSettings); } return _CanvasTextMetrics.__context; } }]); }(); /** * String used for calculate font metrics. * These characters are all tall to help calculate the height required for text. */ _CanvasTextMetrics.METRICS_STRING = "|\xC9q\xC5"; /** Baseline symbol for calculate font metrics. */ _CanvasTextMetrics.BASELINE_SYMBOL = "M"; /** Baseline multiplier for calculate font metrics. */ _CanvasTextMetrics.BASELINE_MULTIPLIER = 1.4; /** Height multiplier for setting height of canvas to calculate font metrics. */ _CanvasTextMetrics.HEIGHT_MULTIPLIER = 2; /** * A Unicode "character", or "grapheme cluster", can be composed of multiple Unicode code points, * such as letters with diacritical marks (e.g. `'\u0065\u0301'`, letter e with acute) * or emojis with modifiers (e.g. `'\uD83E\uDDD1\u200D\uD83D\uDCBB'`, technologist). * The new `Intl.Segmenter` API in ES2022 can split the string into grapheme clusters correctly. If it is not available, * PixiJS will fallback to use the iterator of String, which can only spilt the string into code points. * If you want to get full functionality in environments that don't support `Intl.Segmenter` (such as Firefox), * you can use other libraries such as [grapheme-splitter]{@link https://www.npmjs.com/package/grapheme-splitter} * or [graphemer]{@link https://www.npmjs.com/package/graphemer} to create a polyfill. Since these libraries can be * relatively large in size to handle various Unicode grapheme clusters properly, PixiJS won't use them directly. */ _CanvasTextMetrics.graphemeSegmenter = function (_Intl) { if (typeof ((_Intl = Intl) === null || _Intl === void 0 ? void 0 : _Intl.Segmenter) === "function") { var segmenter = new Intl.Segmenter(); return function (s) { return _toConsumableArray(segmenter.segment(s)).map(function (x) { return x.segment; }); }; } return function (s) { return _toConsumableArray(s); }; }(); /** * New rendering behavior for letter-spacing which uses Chrome's new native API. This will * lead to more accurate letter-spacing results because it does not try to manually draw * each character. However, this Chrome API is experimental and may not serve all cases yet. * @see TextMetrics.experimentalLetterSpacingSupported */ _CanvasTextMetrics.experimentalLetterSpacing = false; /** Cache of {@see TextMetrics.FontMetrics} objects. */ _CanvasTextMetrics._fonts = {}; /** Cache of new line chars. */ _CanvasTextMetrics._newlines = [10, // line feed 13 // carriage return ]; /** Cache of breaking spaces. */ _CanvasTextMetrics._breakingSpaces = [9, // character tabulation 32, // space 8192, // en quad 8193, // em quad 8194, // en space 8195, // em space 8196, // three-per-em space 8197, // four-per-em space 8198, // six-per-em space 8200, // punctuation space 8201, // thin space 8202, // hair space 8287, // medium mathematical space 12288 // ideographic space ]; _CanvasTextMetrics._measurementCache = {}; var CanvasTextMetrics = _CanvasTextMetrics; exports.CanvasTextMetrics = CanvasTextMetrics; /***/ }), /***/ 1761: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var UNIFORM_TO_SINGLE_SETTERS = { f32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1f(location, v);\n }", "vec2<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1]);\n }", "vec3<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3f(location, v[0], v[1], v[2]);\n }", "vec4<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }", i32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }", "vec2<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }", "vec3<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }", "vec4<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }", u32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1ui(location, v);\n }", "vec2<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2ui(location, v[0], v[1]);\n }", "vec3<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }", "vec4<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }", bool: "if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }", "vec2<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }", "vec3<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }", "vec4<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }", "mat2x2<f32>": "gl.uniformMatrix2fv(location, false, v);", "mat3x3<f32>": "gl.uniformMatrix3fv(location, false, v);", "mat4x4<f32>": "gl.uniformMatrix4fv(location, false, v);" }; var UNIFORM_TO_ARRAY_SETTERS = { f32: "gl.uniform1fv(location, v);", "vec2<f32>": "gl.uniform2fv(location, v);", "vec3<f32>": "gl.uniform3fv(location, v);", "vec4<f32>": "gl.uniform4fv(location, v);", "mat2x2<f32>": "gl.uniformMatrix2fv(location, false, v);", "mat3x3<f32>": "gl.uniformMatrix3fv(location, false, v);", "mat4x4<f32>": "gl.uniformMatrix4fv(location, false, v);", i32: "gl.uniform1iv(location, v);", "vec2<i32>": "gl.uniform2iv(location, v);", "vec3<i32>": "gl.uniform3iv(location, v);", "vec4<i32>": "gl.uniform4iv(location, v);", u32: "gl.uniform1iv(location, v);", "vec2<u32>": "gl.uniform2iv(location, v);", "vec3<u32>": "gl.uniform3iv(location, v);", "vec4<u32>": "gl.uniform4iv(location, v);", bool: "gl.uniform1iv(location, v);", "vec2<bool>": "gl.uniform2iv(location, v);", "vec3<bool>": "gl.uniform3iv(location, v);", "vec4<bool>": "gl.uniform4iv(location, v);" }; exports.UNIFORM_TO_ARRAY_SETTERS = UNIFORM_TO_ARRAY_SETTERS; exports.UNIFORM_TO_SINGLE_SETTERS = UNIFORM_TO_SINGLE_SETTERS; /***/ }), /***/ 2081: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var isWebGLSupported = __webpack_require__(67073); var isWebGPUSupported = __webpack_require__(50132); var getSupportedGlCompressedTextureFormats = __webpack_require__(40260); var getSupportedGPUCompressedTextureFormats = __webpack_require__(53252); "use strict"; var supportedCompressedTextureFormats; function getSupportedCompressedTextureFormats() { return _getSupportedCompressedTextureFormats.apply(this, arguments); } function _getSupportedCompressedTextureFormats() { _getSupportedCompressedTextureFormats = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: if (!(supportedCompressedTextureFormats !== void 0)) { _context2.n = 1; break; } return _context2.a(2, supportedCompressedTextureFormats); case 1: _context2.n = 2; return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var _isWebGPUSupported, _isWebGLSupported, gpuTextureFormats, glTextureFormats; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return isWebGPUSupported.isWebGPUSupported(); case 1: _isWebGPUSupported = _context.v; _isWebGLSupported = isWebGLSupported.isWebGLSupported(); if (!(_isWebGPUSupported && _isWebGLSupported)) { _context.n = 3; break; } _context.n = 2; return getSupportedGPUCompressedTextureFormats.getSupportedGPUCompressedTextureFormats(); case 2: gpuTextureFormats = _context.v; glTextureFormats = getSupportedGlCompressedTextureFormats.getSupportedGlCompressedTextureFormats(); return _context.a(2, gpuTextureFormats.filter(function (format) { return glTextureFormats.includes(format); })); case 3: if (!_isWebGPUSupported) { _context.n = 5; break; } _context.n = 4; return getSupportedGPUCompressedTextureFormats.getSupportedGPUCompressedTextureFormats(); case 4: return _context.a(2, _context.v); case 5: if (!_isWebGLSupported) { _context.n = 6; break; } return _context.a(2, getSupportedGlCompressedTextureFormats.getSupportedGlCompressedTextureFormats()); case 6: return _context.a(2, []); } }, _callee); }))(); case 2: supportedCompressedTextureFormats = _context2.v; return _context2.a(2, supportedCompressedTextureFormats); } }, _callee2); })); return _getSupportedCompressedTextureFormats.apply(this, arguments); } exports.getSupportedCompressedTextureFormats = getSupportedCompressedTextureFormats; /***/ }), /***/ 2110: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var warn = __webpack_require__(57371); var Container = __webpack_require__(47719); "use strict"; var _RenderLayerClass = /*#__PURE__*/function (_Container$Container) { /** * Creates a new RenderLayer instance * @param options - Configuration options for the RenderLayer * @param {boolean} [options.sortableChildren=false] - If true, layer children will be automatically sorted each render * @param {Function} [options.sortFunction] - Custom function to sort layer children. Default sorts by zIndex */ function _RenderLayerClass() { var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _RenderLayerClass); options = _objectSpread(_objectSpread({}, _RenderLayerClass.defaultOptions), options); _this = _callSuper(this, _RenderLayerClass); /** List of objects to be rendered by this layer */ _this.renderLayerChildren = []; _this.sortableChildren = options.sortableChildren; _this.sortFunction = options.sortFunction; return _this; } /** * Add an Container to this render layer. The Container will be rendered as part of this layer * while maintaining its original parent in the scene graph. * If the Container already belongs to a layer, it will be removed from the old layer before being added to this one. * @param children - The Container(s) to add to this layer */ _inherits(_RenderLayerClass, _Container$Container); return _createClass(_RenderLayerClass, [{ key: "attach", value: function attach() { for (var i = 0; i < arguments.length; i++) { var child = i < 0 || arguments.length <= i ? undefined : arguments[i]; if (child.parentRenderLayer) { if (child.parentRenderLayer === this) continue; child.parentRenderLayer.detach(child); } this.renderLayerChildren.push(child); child.parentRenderLayer = this; var renderGroup = this.renderGroup || this.parentRenderGroup; if (renderGroup) { renderGroup.structureDidChange = true; } } return arguments.length <= 0 ? undefined : arguments[0]; } /** * Remove an Container from this render layer. The Container will no longer be rendered * as part of this layer but maintains its original parent. * @param children - The Container(s) to remove from this layer */ }, { key: "detach", value: function detach() { for (var i = 0; i < arguments.length; i++) { var child = i < 0 || arguments.length <= i ? undefined : arguments[i]; var index = this.renderLayerChildren.indexOf(child); if (index !== -1) { this.renderLayerChildren.splice(index, 1); } child.parentRenderLayer = null; var renderGroup = this.renderGroup || this.parentRenderGroup; if (renderGroup) { renderGroup.structureDidChange = true; } } return arguments.length <= 0 ? undefined : arguments[0]; } /** Remove all objects from this render layer. */ }, { key: "detachAll", value: function detachAll() { var layerChildren = this.renderLayerChildren; for (var i = 0; i < layerChildren.length; i++) { layerChildren[i].parentRenderLayer = null; } this.renderLayerChildren.length = 0; } }, { key: "collectRenderables", value: function collectRenderables(instructionSet, renderer, _currentLayer) { var layerChildren = this.renderLayerChildren; var length = layerChildren.length; if (this.sortableChildren) { this.sortRenderLayerChildren(); } for (var i = 0; i < length; i++) { if (!layerChildren[i].parent) { warn.warn("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)", layerChildren[i]); } layerChildren[i].collectRenderables(instructionSet, renderer, this); } } /** * Sort the layer's children using the defined sort function. * Will be called each render if sortableChildren is true. * Otherwise can call this manually. */ }, { key: "sortRenderLayerChildren", value: function sortRenderLayerChildren() { this.renderLayerChildren.sort(this.sortFunction); } }, { key: "_getGlobalBoundsRecursive", value: function _getGlobalBoundsRecursive(factorRenderLayers, bounds, _currentLayer) { if (!factorRenderLayers) return; var children = this.renderLayerChildren; for (var i = 0; i < children.length; i++) { children[i]._getGlobalBoundsRecursive(true, bounds, this); } } }]); }(Container.Container); /** * Default options for RenderLayer instances * @property {boolean} sortableChildren - If true, layer children will be automatically sorted each render. * Default false. * @property {Function} sortFunction - Function used to sort layer children. Default sorts by zIndex. */ _RenderLayerClass.defaultOptions = { sortableChildren: false, sortFunction: function sortFunction(a, b) { return a.zIndex - b.zIndex; } }; var RenderLayerClass = _RenderLayerClass; var RenderLayer = RenderLayerClass; exports.RenderLayer = RenderLayer; exports.RenderLayerClass = RenderLayerClass; /***/ }), /***/ 2187: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var createUboSyncFunction = __webpack_require__(46674); var uboSyncFunctions = __webpack_require__(52029); var generateArraySyncSTD40 = __webpack_require__(71075); "use strict"; function createUboSyncFunctionSTD40(uboElements) { return createUboSyncFunction.createUboSyncFunction(uboElements, "uboStd40", generateArraySyncSTD40.generateArraySyncSTD40, uboSyncFunctions.uboSyncFunctionsSTD40); } exports.createUboSyncFunctionSTD40 = createUboSyncFunctionSTD40; /***/ }), /***/ 2352: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ANhip = ANhip; exports.AbstractAlliance = AbstractAlliance; exports.AnhTrang = AnhTrang; exports.BauDat = BauDat; exports.DaoLnHot = DaoLnHot; exports.May = May; exports.TiaNang = TiaNang; var _pixi = __webpack_require__(3635); var _stringGenerate = __webpack_require__(356); var _util = __webpack_require__(19330); var _OOP = __webpack_require__(64181); var _Rectangle = _interopRequireDefault(__webpack_require__(34478)); var _GameObjects = __webpack_require__(36805); var _Vec = _interopRequireDefault(__webpack_require__(28239)); var _Bullets = __webpack_require__(83886); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * * @param {Level1Scene|AbstractScene|PreviewScene} scene * @param {number} x * @param {number} y * @constructor */ function AbstractAlliance(scene, x, y) { this.id = (0, _stringGenerate.randomIdent)(8); this.x = x; this.y = y; this.scene = scene; this.texture = this.scene.assetMng.getTexture(this.imageRes); this.sprite = new _pixi.Sprite(this.texture); this.sprite.x = -this.imageOffset.x; this.sprite.y = -this.imageOffset.y; this.stand = new _pixi.Container(); this.stand.addChild(this.sprite); this.stand.y = 25; this.root = new _pixi.Container(); this.root.addChild(this.stand); this.scene.pLiveObject.addChild(this.root); this.scaleKeyFrame = Math.random(); this.root.x = (x + 0.5) * 108; this.root.y = (y + 0.5) * 108; this.scene.alliances[this.id] = this; this.scene.starCoins -= this.cost; this.remainToAttack = this.attackTime; this.remainBullet = this.attackLevel; this.attackTarget = null; this.root.zIndex = this.y * 12 + this.x; this.scene.pLiveObject.sortChildren(); this.canUpgrade = false; this.upgradeIcon = new _pixi.Container(); this.upgradeIconImage = new _pixi.Sprite(this.scene.assetMng.getTexture('upgrade_arrow')); this.upgradeIconImage.x = -10; this.upgradeIconImage.y = -25; this.upgradeIcon.x = 35; this.upgradeIcon.y = 28; this.upgradeIcon.addChild(this.upgradeIconImage); this.upgradeIconKeyFrame = Math.random(); // console.log('pixi',this.scene.pixi) } AbstractAlliance.prototype.BulletClass = _Bullets.AbstractBullet; AbstractAlliance.prototype.cost = 10; AbstractAlliance.prototype.attackTime = 2e3; AbstractAlliance.prototype.attackLevel = 1; AbstractAlliance.prototype.fireDelay = 150; AbstractAlliance.prototype.attack = 10; AbstractAlliance.prototype.attackRange = 4; AbstractAlliance.prototype.slowEffect = false; AbstractAlliance.prototype.burnEffect = false; AbstractAlliance.prototype.imageSize = { width: 131, height: 131 }; AbstractAlliance.prototype.imageOffset = { y: 109, x: 131 / 2 }; AbstractAlliance.prototype.scaleDuration = 1000; AbstractAlliance.prototype.imageRes = 'a_nhip'; AbstractAlliance.prototype.width = 1; AbstractAlliance.prototype.height = 1; AbstractAlliance.prototype.minScale = 0.9; AbstractAlliance.prototype.maxScale = 1; AbstractAlliance.prototype.update = function (deltaTime) { this.scaleKeyFrame += deltaTime / this.scaleDuration; this.scaleKeyFrame = this.scaleKeyFrame % 1; var t = (0, _util.bezierBlend)(this.scaleKeyFrame); if (t < 0.5) t = t * 2;else t = (1 - t) * 2; this.stand.scale.y = this.minScale + (this.maxScale - this.minScale) * t; this.remainToAttack -= deltaTime; this.lockingForTarget(); this.fireIfCan(); this.updateCanUpgrade(deltaTime); }; AbstractAlliance.prototype.updateCanUpgrade = function (deltaTime) { var newValue = this.scene.starCoins >= this.cost; if (newValue && !this.canUpgrade) { this.canUpgrade = true; this.root.addChild(this.upgradeIcon); } else if (!newValue && this.canUpgrade) { this.canUpgrade = false; this.root.removeChild(this.upgradeIcon); } if (!newValue) return; this.upgradeIconKeyFrame += deltaTime / 1000; this.upgradeIconKeyFrame = this.scaleKeyFrame % 1; var t = this.upgradeIconKeyFrame; if (t > 1 / 3) t = 0;else t *= 3 * 3; t = Math.sin(t * 2 * Math.PI) * Math.PI / 8; this.upgradeIcon.rotation = t; }; AbstractAlliance.prototype.canAttackTo = function (target) { if (!target) return false; if (target && target.hp <= 0) return false; var A = new _Vec["default"](this.x, this.y); var B; for (var i = 0; i < target.height; ++i) for (var j = 0; j < target.width; j++) { B = new _Vec["default"](target.x + j, target.y + i); if (A.sub(B).abs() <= this.attackRange) { return true; } } return false; }; AbstractAlliance.prototype.lockingForTarget = function () { if (this.canAttackTo(this.attackTarget)) return; this.attackTarget = null; var nearestEnemy = null; var nearestDist = Infinity; var cur = new _Vec["default"](this.x + 0.5, this.y + 0.5); Object.values(this.scene.enemies).forEach(function (enemy) { var tg = new _Vec["default"](enemy.x + 0.5, enemy.y + 0.5); var dist = tg.sub(cur).abs(); if (dist < nearestDist) { nearestEnemy = enemy; nearestDist = dist; } }); if (this.canAttackTo(nearestEnemy)) this.tryLookingTo(nearestEnemy); }; AbstractAlliance.prototype.tryLookingTo = function (target) { if (this.canAttackTo(target)) { this.attackTarget = target; } }; AbstractAlliance.prototype.dontFireStatic = function (target) { if (this.attackTarget && this.attackTarget.type === 'static') { this.attackTarget = null; this.lockingForTarget(); } }; AbstractAlliance.prototype.fireIfCan = function () { //todo: check can fire if (this.remainBullet <= 0) return; if (this.remainToAttack > 0) return; if (!this.attackTarget) return; if (this.attackTarget.hp < 0) { this.attackTarget = null; return; } this.remainBullet--; if (this.remainBullet > 0) { this.remainToAttack = this.fireDelay; } else { this.remainToAttack = this.attackTime; this.remainBullet = this.attackLevel; } new this.BulletClass(this, this.attackTarget); }; AbstractAlliance.prototype.tryUpgrade = function () { if (this.scene.starCoins >= this.cost) { this.scene.starCoins -= this.cost; this.attackLevel += 1; this.cost += Math.ceil(this.cost * 1.2); this.attackRange += 0.5; } }; AbstractAlliance.prototype.remove = function () { if (this.root.parent) this.root.parent.removeChild(this.root); delete this.scene.alliances[this.id]; }; AbstractAlliance.prototype.isHit = function (point) { var rect = this.getRect(); return rect.containsPoint(point); }; AbstractAlliance.prototype.getRect = function () { return new _Rectangle["default"](this.scene.map.x + this.x * 108, this.scene.map.y + this.y * 108, 108, 108); }; /** * @extends AbstractAlliance * @constructor */ function ANhip() { AbstractAlliance.apply(this, arguments); } (0, _OOP.mixClass)(ANhip, AbstractAlliance); ANhip.prototype.cost = 6; ANhip.prototype.imageRes = 'a_nhip'; ANhip.prototype.attackRange = 1.5; ANhip.prototype.BulletClass = _Bullets.DanMoc; /** * @extends AbstractAlliance * @constructor */ function BauDat() { AbstractAlliance.apply(this, arguments); } (0, _OOP.mixClass)(BauDat, AbstractAlliance); BauDat.prototype.cost = 8; BauDat.prototype.imageRes = 'bau_dat'; BauDat.prototype.BulletClass = _Bullets.DanHoa; /** * @extends AbstractAlliance * @constructor */ function DaoLnHot() { AbstractAlliance.apply(this, arguments); } (0, _OOP.mixClass)(DaoLnHot, AbstractAlliance); DaoLnHot.prototype.cost = 9; DaoLnHot.prototype.imageRes = 'dao_ln_hot'; DaoLnHot.prototype.attackRange = 3.1; DaoLnHot.prototype.BulletClass = _Bullets.DanTho; /** * @extends AbstractAlliance * @constructor */ function AnhTrang() { AbstractAlliance.apply(this, arguments); } (0, _OOP.mixClass)(AnhTrang, AbstractAlliance); AnhTrang.prototype.cost = 9; AnhTrang.prototype.imageRes = 'anh_trang'; AnhTrang.prototype.BulletClass = _Bullets.DanBang; AnhTrang.prototype.attackTime = 3e3; /** * @extends AbstractAlliance * @constructor */ function TiaNang() { AbstractAlliance.apply(this, arguments); } (0, _OOP.mixClass)(TiaNang, AbstractAlliance); TiaNang.prototype.imageRes = 'tia_nang'; TiaNang.prototype.BulletClass = _Bullets.DanHoa; /** * @extends AbstractAlliance * @constructor */ function May() { AbstractAlliance.apply(this, arguments); } (0, _OOP.mixClass)(May, AbstractAlliance); May.prototype.imageRes = 'may'; //fsd May.prototype.BulletClass = _Bullets.DanPhong; ANhip.prototype.cost = 7; ANhip.prototype.attackTime = 1500; ANhip.prototype.attack = 10; ANhip.prototype.attackRange = 1.45; DaoLnHot.prototype.cost = 8; DaoLnHot.prototype.attackTime = 1200; DaoLnHot.prototype.attack = 10; DaoLnHot.prototype.attackRange = 2.4; DaoLnHot.prototype.burnEffect = false; BauDat.prototype.cost = 8; BauDat.prototype.attackTime = 1200; BauDat.prototype.attack = 12; BauDat.prototype.attackRange = 2.5; BauDat.prototype.burnEffect = true; AnhTrang.prototype.cost = 12; AnhTrang.prototype.attackTime = 1100; AnhTrang.prototype.attack = 10; AnhTrang.prototype.attackRange = 3; BauDat.prototype.slowEffect = true; May.prototype.cost = 15; AnhTrang.prototype.attackTime = 1000; AnhTrang.prototype.attack = 15; AnhTrang.prototype.attackRange = 3; /***/ }), /***/ 2422: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var GpuBlendModesToPixi = {}; GpuBlendModesToPixi.normal = { alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" } }; GpuBlendModesToPixi.add = { alpha: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "one", dstFactor: "one", operation: "add" } }; GpuBlendModesToPixi.multiply = { alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "dst", dstFactor: "one-minus-src-alpha", operation: "add" } }; GpuBlendModesToPixi.screen = { alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "one", dstFactor: "one-minus-src", operation: "add" } }; GpuBlendModesToPixi.overlay = { alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "one", dstFactor: "one-minus-src", operation: "add" } }; GpuBlendModesToPixi.none = { alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "zero", dstFactor: "zero", operation: "add" } }; GpuBlendModesToPixi["normal-npm"] = { alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha", operation: "add" } }; GpuBlendModesToPixi["add-npm"] = { alpha: { srcFactor: "one", dstFactor: "one", operation: "add" }, color: { srcFactor: "src-alpha", dstFactor: "one", operation: "add" } }; GpuBlendModesToPixi["screen-npm"] = { alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "src-alpha", dstFactor: "one-minus-src", operation: "add" } }; GpuBlendModesToPixi.erase = { alpha: { srcFactor: "zero", dstFactor: "one-minus-src-alpha", operation: "add" }, color: { srcFactor: "zero", dstFactor: "one-minus-src", operation: "add" } }; GpuBlendModesToPixi.min = { alpha: { srcFactor: "one", dstFactor: "one", operation: "min" }, color: { srcFactor: "one", dstFactor: "one", operation: "min" } }; GpuBlendModesToPixi.max = { alpha: { srcFactor: "one", dstFactor: "one", operation: "max" }, color: { srcFactor: "one", dstFactor: "one", operation: "max" } }; exports.GpuBlendModesToPixi = GpuBlendModesToPixi; /***/ }), /***/ 2441: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Color = __webpack_require__(98828); var Rectangle = __webpack_require__(74731); var CanvasPool = __webpack_require__(88699); var ImageSource = __webpack_require__(80344); var Texture = __webpack_require__(73782); var deprecation = __webpack_require__(11225); var CanvasTextMetrics = __webpack_require__(1635); var fontStringFromTextStyle = __webpack_require__(30145); var getCanvasFillStyle = __webpack_require__(52179); var TextStyle = __webpack_require__(55858); var AbstractBitmapFont = __webpack_require__(17660); var resolveCharacters = __webpack_require__(8448); "use strict"; var _DynamicBitmapFont = /*#__PURE__*/function (_AbstractBitmapFont$A) { /** * @param options - The options for the dynamic bitmap font. */ function _DynamicBitmapFont(options) { var _dynamicOptions$skipK, _dynamicOptions$resol, _dynamicOptions$paddi; var _this; _classCallCheck(this, _DynamicBitmapFont); _this = _callSuper(this, _DynamicBitmapFont); /** * this is a resolution modifier for the font size.. * texture resolution will also be used to scale texture according to its font size also */ _this.resolution = 1; /** The pages of the font. */ _this.pages = []; _this._padding = 0; _this._measureCache = /* @__PURE__ */Object.create(null); _this._currentChars = []; _this._currentX = 0; _this._currentY = 0; _this._currentPageIndex = -1; _this._skipKerning = false; var dynamicOptions = _objectSpread(_objectSpread({}, _DynamicBitmapFont.defaultOptions), options); _this._textureSize = dynamicOptions.textureSize; _this._mipmap = dynamicOptions.mipmap; var style = dynamicOptions.style.clone(); if (dynamicOptions.overrideFill) { style._fill.color = 16777215; style._fill.alpha = 1; style._fill.texture = Texture.Texture.WHITE; style._fill.fill = null; } _this.applyFillAsTint = dynamicOptions.overrideFill; var requestedFontSize = style.fontSize; style.fontSize = _this.baseMeasurementFontSize; var font = fontStringFromTextStyle.fontStringFromTextStyle(style); if (dynamicOptions.overrideSize) { if (style._stroke) { style._stroke.width *= _this.baseRenderedFontSize / requestedFontSize; } } else { style.fontSize = _this.baseRenderedFontSize = requestedFontSize; } _this._style = style; _this._skipKerning = (_dynamicOptions$skipK = dynamicOptions.skipKerning) !== null && _dynamicOptions$skipK !== void 0 ? _dynamicOptions$skipK : false; _this.resolution = (_dynamicOptions$resol = dynamicOptions.resolution) !== null && _dynamicOptions$resol !== void 0 ? _dynamicOptions$resol : 1; _this._padding = (_dynamicOptions$paddi = dynamicOptions.padding) !== null && _dynamicOptions$paddi !== void 0 ? _dynamicOptions$paddi : 4; _this.fontMetrics = CanvasTextMetrics.CanvasTextMetrics.measureFont(font); _this.lineHeight = style.lineHeight || _this.fontMetrics.fontSize || style.fontSize; return _this; } _inherits(_DynamicBitmapFont, _AbstractBitmapFont$A); return _createClass(_DynamicBitmapFont, [{ key: "ensureCharacters", value: function ensureCharacters(chars) { var _this2 = this; var charList = resolveCharacters.resolveCharacters(chars).filter(function (_char) { return !_this2._currentChars.includes(_char); }).filter(function (_char2, index, self) { return self.indexOf(_char2) === index; }); if (!charList.length) return; this._currentChars = [].concat(_toConsumableArray(this._currentChars), _toConsumableArray(charList)); var pageData; if (this._currentPageIndex === -1) { pageData = this._nextPage(); } else { pageData = this.pages[this._currentPageIndex]; } var _pageData$canvasAndCo = pageData.canvasAndContext, canvas = _pageData$canvasAndCo.canvas, context = _pageData$canvasAndCo.context; var textureSource = pageData.texture.source; var style = this._style; var currentX = this._currentX; var currentY = this._currentY; var fontScale = this.baseRenderedFontSize / this.baseMeasurementFontSize; var padding = this._padding * fontScale; var maxCharHeight = 0; var skipTexture = false; var maxTextureWidth = canvas.width / this.resolution; var maxTextureHeight = canvas.height / this.resolution; for (var i = 0; i < charList.length; i++) { var _style$dropShadow$dis, _style$dropShadow, _style$_stroke$width, _style$_stroke; var _char3 = charList[i]; var metrics = CanvasTextMetrics.CanvasTextMetrics.measureText(_char3, style, canvas, false); metrics.lineHeight = metrics.height; var width = metrics.width * fontScale; var textureGlyphWidth = Math.ceil((style.fontStyle === "italic" ? 2 : 1) * width); var height = metrics.height * fontScale; var paddedWidth = textureGlyphWidth + padding * 2; var paddedHeight = height + padding * 2; skipTexture = false; if (_char3 !== "\n" && _char3 !== "\r" && _char3 !== " " && _char3 !== " ") { skipTexture = true; maxCharHeight = Math.ceil(Math.max(paddedHeight, maxCharHeight)); } if (currentX + paddedWidth > maxTextureWidth) { currentY += maxCharHeight; maxCharHeight = paddedHeight; currentX = 0; if (currentY + maxCharHeight > maxTextureHeight) { textureSource.update(); var pageData2 = this._nextPage(); canvas = pageData2.canvasAndContext.canvas; context = pageData2.canvasAndContext.context; textureSource = pageData2.texture.source; currentY = 0; } } var xAdvance = width / fontScale - ((_style$dropShadow$dis = (_style$dropShadow = style.dropShadow) === null || _style$dropShadow === void 0 ? void 0 : _style$dropShadow.distance) !== null && _style$dropShadow$dis !== void 0 ? _style$dropShadow$dis : 0) - ((_style$_stroke$width = (_style$_stroke = style._stroke) === null || _style$_stroke === void 0 ? void 0 : _style$_stroke.width) !== null && _style$_stroke$width !== void 0 ? _style$_stroke$width : 0); this.chars[_char3] = { id: _char3.codePointAt(0), xOffset: -this._padding, yOffset: -this._padding, xAdvance: xAdvance, kerning: {} }; if (skipTexture) { this._drawGlyph(context, metrics, currentX + padding, currentY + padding, fontScale, style); var px = textureSource.width * fontScale; var py = textureSource.height * fontScale; var frame = new Rectangle.Rectangle(currentX / px * textureSource.width, currentY / py * textureSource.height, paddedWidth / px * textureSource.width, paddedHeight / py * textureSource.height); this.chars[_char3].texture = new Texture.Texture({ source: textureSource, frame: frame }); currentX += Math.ceil(paddedWidth); } } textureSource.update(); this._currentX = currentX; this._currentY = currentY; this._skipKerning && this._applyKerning(charList, context); } /** * @deprecated since 8.0.0 * The map of base page textures (i.e., sheets of glyphs). */ }, { key: "pageTextures", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."); return this.pages; } }, { key: "_applyKerning", value: function _applyKerning(newChars, context) { var measureCache = this._measureCache; for (var i = 0; i < newChars.length; i++) { var first = newChars[i]; for (var j = 0; j < this._currentChars.length; j++) { var second = this._currentChars[j]; var c1 = measureCache[first]; if (!c1) c1 = measureCache[first] = context.measureText(first).width; var c2 = measureCache[second]; if (!c2) c2 = measureCache[second] = context.measureText(second).width; var total = context.measureText(first + second).width; var amount = total - (c1 + c2); if (amount) { this.chars[first].kerning[second] = amount; } total = context.measureText(first + second).width; amount = total - (c1 + c2); if (amount) { this.chars[second].kerning[first] = amount; } } } } }, { key: "_nextPage", value: function _nextPage() { this._currentPageIndex++; var textureResolution = this.resolution; var canvasAndContext = CanvasPool.CanvasPool.getOptimalCanvasAndContext(this._textureSize, this._textureSize, textureResolution); this._setupContext(canvasAndContext.context, this._style, textureResolution); var resolution = textureResolution * (this.baseRenderedFontSize / this.baseMeasurementFontSize); var texture = new Texture.Texture({ source: new ImageSource.ImageSource({ resource: canvasAndContext.canvas, resolution: resolution, alphaMode: "premultiply-alpha-on-upload", autoGenerateMipmaps: this._mipmap }) }); var pageData = { canvasAndContext: canvasAndContext, texture: texture }; this.pages[this._currentPageIndex] = pageData; return pageData; } // canvas style! }, { key: "_setupContext", value: function _setupContext(context, style, resolution) { var _stroke$width; style.fontSize = this.baseRenderedFontSize; context.scale(resolution, resolution); context.font = fontStringFromTextStyle.fontStringFromTextStyle(style); style.fontSize = this.baseMeasurementFontSize; context.textBaseline = style.textBaseline; var stroke = style._stroke; var strokeThickness = (_stroke$width = stroke === null || stroke === void 0 ? void 0 : stroke.width) !== null && _stroke$width !== void 0 ? _stroke$width : 0; if (stroke) { context.lineWidth = strokeThickness; context.lineJoin = stroke.join; context.miterLimit = stroke.miterLimit; context.strokeStyle = getCanvasFillStyle.getCanvasFillStyle(stroke, context); } if (style._fill) { context.fillStyle = getCanvasFillStyle.getCanvasFillStyle(style._fill, context); } if (style.dropShadow) { var shadowOptions = style.dropShadow; var rgb = Color.Color.shared.setValue(shadowOptions.color).toArray(); var dropShadowBlur = shadowOptions.blur * resolution; var dropShadowDistance = shadowOptions.distance * resolution; context.shadowColor = "rgba(".concat(rgb[0] * 255, ",").concat(rgb[1] * 255, ",").concat(rgb[2] * 255, ",").concat(shadowOptions.alpha, ")"); context.shadowBlur = dropShadowBlur; context.shadowOffsetX = Math.cos(shadowOptions.angle) * dropShadowDistance; context.shadowOffsetY = Math.sin(shadowOptions.angle) * dropShadowDistance; } else { context.shadowColor = "black"; context.shadowBlur = 0; context.shadowOffsetX = 0; context.shadowOffsetY = 0; } } }, { key: "_drawGlyph", value: function _drawGlyph(context, metrics, x, y, fontScale, style) { var _stroke$width2; var _char4 = metrics.text; var fontProperties = metrics.fontProperties; var stroke = style._stroke; var strokeThickness = ((_stroke$width2 = stroke === null || stroke === void 0 ? void 0 : stroke.width) !== null && _stroke$width2 !== void 0 ? _stroke$width2 : 0) * fontScale; var tx = x + strokeThickness / 2; var ty = y - strokeThickness / 2; var descent = fontProperties.descent * fontScale; var lineHeight = metrics.lineHeight * fontScale; if (style.stroke && strokeThickness) { context.strokeText(_char4, tx, ty + lineHeight - descent); } if (style._fill) { context.fillText(_char4, tx, ty + lineHeight - descent); } } }, { key: "destroy", value: function destroy() { _superPropGet(_DynamicBitmapFont, "destroy", this, 3)([]); for (var i = 0; i < this.pages.length; i++) { var _this$pages$i = this.pages[i], canvasAndContext = _this$pages$i.canvasAndContext, texture = _this$pages$i.texture; CanvasPool.CanvasPool.returnCanvasAndContext(canvasAndContext); texture.destroy(true); } this.pages = null; } }]); }(AbstractBitmapFont.AbstractBitmapFont); _DynamicBitmapFont.defaultOptions = { textureSize: 512, style: new TextStyle.TextStyle(), mipmap: true }; var DynamicBitmapFont = _DynamicBitmapFont; exports.DynamicBitmapFont = DynamicBitmapFont; /***/ }), /***/ 2473: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var adapter = __webpack_require__(72450); var autoDetectEnvironment = __webpack_require__(48444); __webpack_require__(80013); __webpack_require__(61136); "use strict"; exports.DOMAdapter = adapter.DOMAdapter; exports.autoDetectEnvironment = autoDetectEnvironment.autoDetectEnvironment; exports.loadEnvironmentExtensions = autoDetectEnvironment.loadEnvironmentExtensions; /***/ }), /***/ 2505: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var TextureSource = __webpack_require__(55406); var Texture = __webpack_require__(73782); var Container = __webpack_require__(47719); var Graphics = __webpack_require__(82323); var GraphicsContext = __webpack_require__(59244); var Mesh = __webpack_require__(60931); var Sprite = __webpack_require__(27615); var AnimatedSprite = __webpack_require__(39292); var TilingSprite = __webpack_require__(54360); var Text = __webpack_require__(61787); var PrepareBase = __webpack_require__(87661); "use strict"; var PrepareQueue = /*#__PURE__*/function (_PrepareBase$PrepareB) { function PrepareQueue() { _classCallCheck(this, PrepareQueue); return _callSuper(this, PrepareQueue, arguments); } _inherits(PrepareQueue, _PrepareBase$PrepareB); return _createClass(PrepareQueue, [{ key: "resolveQueueItem", value: /** * Resolve the given resource type and return an item for the queue * @param source * @param queue */ function resolveQueueItem(source, queue) { if (source instanceof Container.Container) { this.resolveContainerQueueItem(source, queue); } else if (source instanceof TextureSource.TextureSource || source instanceof Texture.Texture) { queue.push(source.source); } else if (source instanceof GraphicsContext.GraphicsContext) { queue.push(source); } return null; } /** * Resolve the given container and return an item for the queue * @param container * @param queue */ }, { key: "resolveContainerQueueItem", value: function resolveContainerQueueItem(container, queue) { if (container instanceof Sprite.Sprite || container instanceof TilingSprite.TilingSprite || container instanceof Mesh.Mesh) { queue.push(container.texture.source); } else if (container instanceof Text.Text) { queue.push(container); } else if (container instanceof Graphics.Graphics) { queue.push(container.context); } else if (container instanceof AnimatedSprite.AnimatedSprite) { container.textures.forEach(function (textureOrFrame) { if (textureOrFrame.source) { queue.push(textureOrFrame.source); } else { queue.push(textureOrFrame.texture.source); } }); } } /** * Resolve the given graphics context and return an item for the queue * @param graphicsContext */ }, { key: "resolveGraphicsContextQueueItem", value: function resolveGraphicsContextQueueItem(graphicsContext) { this.renderer.graphicsContext.getGpuContext(graphicsContext); var instructions = graphicsContext.instructions; var _iterator = _createForOfIteratorHelper(instructions), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var instruction = _step.value; if (instruction.action === "texture") { var image = instruction.data.image; return image.source; } else if (instruction.action === "fill") { var texture = instruction.data.style.texture; return texture.source; } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } return null; } }]); }(PrepareBase.PrepareBase); exports.PrepareQueue = PrepareQueue; /***/ }), /***/ 2675: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); var testVideoFormat = __webpack_require__(82788); "use strict"; var detectMp4 = { extension: { type: Extensions.ExtensionType.DetectionParser, priority: 0 }, test: function () { var _test = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: return _context.a(2, testVideoFormat.testVideoFormat("video/mp4")); } }, _callee); })); function test() { return _test.apply(this, arguments); } return test; }(), add: function () { var _add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(formats) { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: return _context2.a(2, [].concat(_toConsumableArray(formats), ["mp4", "m4v"])); } }, _callee2); })); function add(_x) { return _add.apply(this, arguments); } return add; }(), remove: function () { var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(formats) { return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: return _context3.a(2, formats.filter(function (f) { return f !== "mp4" && f !== "m4v"; })); } }, _callee3); })); function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() }; exports.detectMp4 = detectMp4; /***/ }), /***/ 2686: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 2737: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.copyImage = copyImage; exports.copyText = copyText; exports.pasteText = pasteText; function copyImage(src) { var ranges, sel; if (window.getSelection) { sel = window.getSelection(); //backup ranges = []; for (var i = 0; i < sel.rangeCount; ++i) { ranges.push(sel.getRangeAt(i)); } //copy var contentdiv = document.createElement('div'); var image = document.createElement('img'); contentdiv.appendChild(image); image.src = src; contentdiv.contentEditable = true; // contentdiv.style.display = 'none'; document.body.appendChild(contentdiv); var range = document.createRange(); range.selectNodeContents(image); sel.removeAllRanges(); sel.addRange(range); document.execCommand('copy'); // contentdiv.remove(); //recover sel.removeAllRanges(); for (var i = 0; i < sel.rangeCount; ++i) { sel.addRange(ranges[i]); } } else { console.error("Not support copy!"); //not support IE } } function fallbackCopyTextToClipboard(text) { return new Promise(function (resolve, reject) { var textArea = document.createElement("textarea"); textArea.value = text; // Avoid scrolling to bottom textArea.style.top = "0"; textArea.style.left = "0"; textArea.style.position = "fixed"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); if (successful) { resolve(); } else { reject(); } } catch (err) { reject(err); } document.body.removeChild(textArea); }); } function copyText(text) { if (!navigator.clipboard) { return fallbackCopyTextToClipboard(text); } return navigator.clipboard.writeText(text); } function fallbackReadTextFromClipboard() { return new Promise(function (resolve, reject) { var textArea = document.createElement("textarea"); // Avoid scrolling to bottom textArea.style.top = "0"; textArea.style.left = "0"; textArea.style.position = "fixed"; document.body.appendChild(textArea); textArea.focus(); try { var successful = document.execCommand('paste'); if (successful) { resolve(textArea.value); } else { reject(); } } catch (err) { reject(err); } document.body.removeChild(textArea); }); } function pasteText() { if (navigator.clipboard) { return navigator.clipboard.readText(); } else { return fallbackReadTextFromClipboard(); } } /***/ }), /***/ 2818: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var pixiToGlMaps = __webpack_require__(77236); "use strict"; function applyStyleParams(style, gl, mipmaps, anisotropicExt, glFunctionName, firstParam, forceClamp, firstCreation) { var castParam = firstParam; if (!firstCreation || style.addressModeU !== "repeat" || style.addressModeV !== "repeat" || style.addressModeW !== "repeat") { var wrapModeS = pixiToGlMaps.wrapModeToGlAddress[forceClamp ? "clamp-to-edge" : style.addressModeU]; var wrapModeT = pixiToGlMaps.wrapModeToGlAddress[forceClamp ? "clamp-to-edge" : style.addressModeV]; var wrapModeR = pixiToGlMaps.wrapModeToGlAddress[forceClamp ? "clamp-to-edge" : style.addressModeW]; gl[glFunctionName](castParam, gl.TEXTURE_WRAP_S, wrapModeS); gl[glFunctionName](castParam, gl.TEXTURE_WRAP_T, wrapModeT); if (gl.TEXTURE_WRAP_R) gl[glFunctionName](castParam, gl.TEXTURE_WRAP_R, wrapModeR); } if (!firstCreation || style.magFilter !== "linear") { gl[glFunctionName](castParam, gl.TEXTURE_MAG_FILTER, pixiToGlMaps.scaleModeToGlFilter[style.magFilter]); } if (mipmaps) { if (!firstCreation || style.mipmapFilter !== "linear") { var glFilterMode = pixiToGlMaps.mipmapScaleModeToGlFilter[style.minFilter][style.mipmapFilter]; gl[glFunctionName](castParam, gl.TEXTURE_MIN_FILTER, glFilterMode); } } else { gl[glFunctionName](castParam, gl.TEXTURE_MIN_FILTER, pixiToGlMaps.scaleModeToGlFilter[style.minFilter]); } if (anisotropicExt && style.maxAnisotropy > 1) { var level = Math.min(style.maxAnisotropy, gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT)); gl[glFunctionName](castParam, anisotropicExt.TEXTURE_MAX_ANISOTROPY_EXT, level); } if (style.compare) { gl[glFunctionName](castParam, gl.TEXTURE_COMPARE_FUNC, pixiToGlMaps.compareModeToGlCompare[style.compare]); } } exports.applyStyleParams = applyStyleParams; /***/ }), /***/ 2898: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var createUboSyncFunction = __webpack_require__(46674); var uboSyncFunctions = __webpack_require__(52029); var generateArraySyncWGSL = __webpack_require__(98954); "use strict"; function createUboSyncFunctionWGSL(uboElements) { return createUboSyncFunction.createUboSyncFunction(uboElements, "uboWgsl", generateArraySyncWGSL.generateArraySyncWGSL, uboSyncFunctions.uboSyncFunctionsWGSL); } exports.createUboSyncFunctionWGSL = createUboSyncFunctionWGSL; /***/ }), /***/ 3061: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var getAttributeInfoFromFormat = __webpack_require__(63421); var mapType = __webpack_require__(63880); "use strict"; function extractAttributesFromGlProgram(program, gl) { var sortAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var attributes = {}; var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES); for (var i = 0; i < totalAttributes; i++) { var attribData = gl.getActiveAttrib(program, i); if (attribData.name.startsWith("gl_")) { continue; } var format = mapType.mapGlToVertexFormat(gl, attribData.type); attributes[attribData.name] = { location: 0, // set further down.. format: format, stride: getAttributeInfoFromFormat.getAttributeInfoFromFormat(format).stride, offset: 0, instance: false, start: 0 }; } var keys = Object.keys(attributes); if (sortAttributes) { keys.sort(function (a, b) { return a > b ? 1 : -1; }); for (var _i = 0; _i < keys.length; _i++) { attributes[keys[_i]].location = _i; gl.bindAttribLocation(program, _i, keys[_i]); } gl.linkProgram(program); } else { for (var _i2 = 0; _i2 < keys.length; _i2++) { attributes[keys[_i2]].location = gl.getAttribLocation(program, keys[_i2]); } } return attributes; } exports.extractAttributesFromGlProgram = extractAttributesFromGlProgram; /***/ }), /***/ 3200: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(57519); "use strict"; function parseKTX(arrayBuffer, supportedFormats) { var dataView = new DataView(arrayBuffer); if (!validate(dataView)) { throw new Error("Invalid KTX identifier in header"); } var _parseKTXHeader = parseKTXHeader(dataView), littleEndian = _parseKTXHeader.littleEndian, glType = _parseKTXHeader.glType, glFormat = _parseKTXHeader.glFormat, glInternalFormat = _parseKTXHeader.glInternalFormat, pixelWidth = _parseKTXHeader.pixelWidth, pixelHeight = _parseKTXHeader.pixelHeight, numberOfMipmapLevels = _parseKTXHeader.numberOfMipmapLevels, offset = _parseKTXHeader.offset; var textureFormat = _const.KTX.INTERNAL_FORMAT_TO_TEXTURE_FORMATS[glInternalFormat]; if (!textureFormat) { throw new Error("Unknown texture format ".concat(glInternalFormat)); } if (!supportedFormats.includes(textureFormat)) { throw new Error("Unsupported texture format: ".concat(textureFormat, ", supportedFormats: ").concat(supportedFormats)); } var imagePixelByteSize = getImagePixelByteSize(glType, glFormat, glInternalFormat); var imageBuffers = getImageBuffers(dataView, glType, imagePixelByteSize, pixelWidth, pixelHeight, offset, numberOfMipmapLevels, littleEndian); return { format: textureFormat, width: pixelWidth, height: pixelHeight, resource: imageBuffers, alphaMode: "no-premultiply-alpha" }; } function getImageBuffers(dataView, glType, imagePixelByteSize, pixelWidth, pixelHeight, offset, numberOfMipmapLevels, littleEndian) { var alignedWidth = pixelWidth + 3 & ~3; var alignedHeight = pixelHeight + 3 & ~3; var imagePixels = pixelWidth * pixelHeight; if (glType === 0) { imagePixels = alignedWidth * alignedHeight; } var mipByteSize = imagePixels * imagePixelByteSize; var mipWidth = pixelWidth; var mipHeight = pixelHeight; var alignedMipWidth = alignedWidth; var alignedMipHeight = alignedHeight; var imageOffset = offset; var imageBuffers = new Array(numberOfMipmapLevels); for (var mipmapLevel = 0; mipmapLevel < numberOfMipmapLevels; mipmapLevel++) { var imageSize = dataView.getUint32(imageOffset, littleEndian); var elementOffset = imageOffset + 4; imageBuffers[mipmapLevel] = new Uint8Array(dataView.buffer, elementOffset, mipByteSize); elementOffset += mipByteSize; imageOffset += imageSize + 4; imageOffset = imageOffset % 4 !== 0 ? imageOffset + 4 - imageOffset % 4 : imageOffset; mipWidth = mipWidth >> 1 || 1; mipHeight = mipHeight >> 1 || 1; alignedMipWidth = mipWidth + 4 - 1 & ~(4 - 1); alignedMipHeight = mipHeight + 4 - 1 & ~(4 - 1); mipByteSize = alignedMipWidth * alignedMipHeight * imagePixelByteSize; } return imageBuffers; } function getImagePixelByteSize(glType, glFormat, glInternalFormat) { var imagePixelByteSize = _const.KTX.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[glInternalFormat]; if (glType !== 0) { if (_const.KTX.TYPES_TO_BYTES_PER_COMPONENT[glType]) { imagePixelByteSize = _const.KTX.TYPES_TO_BYTES_PER_COMPONENT[glType] * _const.KTX.FORMATS_TO_COMPONENTS[glFormat]; } else { imagePixelByteSize = _const.KTX.TYPES_TO_BYTES_PER_PIXEL[glType]; } } if (imagePixelByteSize === void 0) { throw new Error("Unable to resolve the pixel format stored in the *.ktx file!"); } return imagePixelByteSize; } function parseKTXHeader(dataView) { var littleEndian = dataView.getUint32(_const.KTX.FIELDS.ENDIANNESS, true) === _const.KTX.ENDIANNESS; var glType = dataView.getUint32(_const.KTX.FIELDS.GL_TYPE, littleEndian); var glFormat = dataView.getUint32(_const.KTX.FIELDS.GL_FORMAT, littleEndian); var glInternalFormat = dataView.getUint32(_const.KTX.FIELDS.GL_INTERNAL_FORMAT, littleEndian); var pixelWidth = dataView.getUint32(_const.KTX.FIELDS.PIXEL_WIDTH, littleEndian); var pixelHeight = dataView.getUint32(_const.KTX.FIELDS.PIXEL_HEIGHT, littleEndian) || 1; var pixelDepth = dataView.getUint32(_const.KTX.FIELDS.PIXEL_DEPTH, littleEndian) || 1; var numberOfArrayElements = dataView.getUint32(_const.KTX.FIELDS.NUMBER_OF_ARRAY_ELEMENTS, littleEndian) || 1; var numberOfFaces = dataView.getUint32(_const.KTX.FIELDS.NUMBER_OF_FACES, littleEndian); var numberOfMipmapLevels = dataView.getUint32(_const.KTX.FIELDS.NUMBER_OF_MIPMAP_LEVELS, littleEndian); var bytesOfKeyValueData = dataView.getUint32(_const.KTX.FIELDS.BYTES_OF_KEY_VALUE_DATA, littleEndian); if (pixelHeight === 0 || pixelDepth !== 1) { throw new Error("Only 2D textures are supported"); } if (numberOfFaces !== 1) { throw new Error("CubeTextures are not supported by KTXLoader yet!"); } if (numberOfArrayElements !== 1) { throw new Error("WebGL does not support array textures"); } return { littleEndian: littleEndian, glType: glType, glFormat: glFormat, glInternalFormat: glInternalFormat, pixelWidth: pixelWidth, pixelHeight: pixelHeight, numberOfMipmapLevels: numberOfMipmapLevels, offset: _const.KTX.FILE_HEADER_SIZE + bytesOfKeyValueData }; } function validate(dataView) { for (var i = 0; i < _const.KTX.FILE_IDENTIFIER.length; i++) { if (dataView.getUint8(i) !== _const.KTX.FILE_IDENTIFIER[i]) { return false; } } return true; } exports.parseKTX = parseKTX; /***/ }), /***/ 3232: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var ColorDodgeBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function ColorDodgeBlend() { _classCallCheck(this, ColorDodgeBlend); return _callSuper(this, ColorDodgeBlend, [{ gl: { functions: "\n float colorDodge(float base, float blend)\n {\n return base / (1.0 - blend);\n }\n\n vec3 blendColorDodge(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n colorDodge(base.r, blend.r),\n colorDodge(base.g, blend.g),\n colorDodge(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendColorDodge(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn colorDodge(base: f32, blend: f32) -> f32\n {\n return base / (1.0 - blend);\n }\n\n fn blendColorDodge(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n colorDodge(base.r, blend.r),\n colorDodge(base.g, blend.g),\n colorDodge(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendColorDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(ColorDodgeBlend, _BlendModeFilter$Blen); return _createClass(ColorDodgeBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ ColorDodgeBlend.extension = { name: "color-dodge", type: Extensions.ExtensionType.BlendMode }; exports.ColorDodgeBlend = ColorDodgeBlend; /***/ }), /***/ 3281: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var collectRenderablesMixin = { /** * Main method to collect renderables from the container and its children. * It checks the container's properties to decide whether to use a simple or advanced collection method. * @param {InstructionSet} instructionSet - The set of instructions to which the renderables will be added. * @param {Renderer} renderer - The renderer responsible for rendering the scene. * @param {IRenderLayer} currentLayer - The current render layer being processed. * @memberof scene.Container# */ collectRenderables: function collectRenderables(instructionSet, renderer, currentLayer) { if (this.parentRenderLayer && this.parentRenderLayer !== currentLayer || this.globalDisplayStatus < 7 || !this.includeInBuild) return; if (this.sortableChildren) { this.sortChildren(); } if (this.isSimple) { this.collectRenderablesSimple(instructionSet, renderer, currentLayer); } else if (this.renderGroup) { renderer.renderPipes.renderGroup.addRenderGroup(this.renderGroup, instructionSet); } else { this.collectRenderablesWithEffects(instructionSet, renderer, currentLayer); } }, /** * Simple method for collecting renderables from the container's children. * This method is efficient and used when the container is marked as simple. * @param {InstructionSet} instructionSet - The set of instructions to which the renderables will be added. * @param {Renderer} renderer - The renderer responsible for rendering the scene. * @param {IRenderLayer} currentLayer - The current render layer being processed. * @memberof scene.Container# */ collectRenderablesSimple: function collectRenderablesSimple(instructionSet, renderer, currentLayer) { var children = this.children; var length = children.length; for (var i = 0; i < length; i++) { children[i].collectRenderables(instructionSet, renderer, currentLayer); } }, /** * Advanced method for collecting renderables, which handles additional effects. * This method is used when the container has complex processing needs. * @param {InstructionSet} instructionSet - The set of instructions to which the renderables will be added. * @param {Renderer} renderer - The renderer responsible for rendering the scene. * @param {IRenderLayer} currentLayer - The current render layer being processed. * @memberof scene.Container# */ collectRenderablesWithEffects: function collectRenderablesWithEffects(instructionSet, renderer, currentLayer) { var renderPipes = renderer.renderPipes; for (var i = 0; i < this.effects.length; i++) { var effect = this.effects[i]; var pipe = renderPipes[effect.pipe]; pipe.push(effect, this, instructionSet); } this.collectRenderablesSimple(instructionSet, renderer, currentLayer); for (var _i = this.effects.length - 1; _i >= 0; _i--) { var _effect = this.effects[_i]; var _pipe = renderPipes[_effect.pipe]; _pipe.pop(_effect, this, instructionSet); } } }; exports.collectRenderablesMixin = collectRenderablesMixin; /***/ }), /***/ 3418: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["texture", "vertices", "uvs", "indices", "topology"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var definedProps = __webpack_require__(48629); var Mesh = __webpack_require__(60931); var MeshGeometry = __webpack_require__(56451); "use strict"; var MeshSimple = /*#__PURE__*/function (_Mesh$Mesh) { /** * @param options - Options to be used for construction */ function MeshSimple(options) { var _this; _classCallCheck(this, MeshSimple); var texture = options.texture, vertices = options.vertices, uvs = options.uvs, indices = options.indices, topology = options.topology, rest = _objectWithoutProperties(options, _excluded); var geometry = new MeshGeometry.MeshGeometry(definedProps.definedProps({ positions: vertices, uvs: uvs, indices: indices, topology: topology })); _this = _callSuper(this, MeshSimple, [definedProps.definedProps(_objectSpread(_objectSpread({}, rest), {}, { texture: texture, geometry: geometry }))]); _this.autoUpdate = true; _this.onRender = _this._render; return _this; } /** * Collection of vertices data. * @type {Float32Array} */ _inherits(MeshSimple, _Mesh$Mesh); return _createClass(MeshSimple, [{ key: "vertices", get: function get() { return this.geometry.getBuffer("aPosition").data; }, set: function set(value) { this.geometry.getBuffer("aPosition").data = value; } }, { key: "_render", value: function _render() { if (this.autoUpdate) { this.geometry.getBuffer("aPosition").update(); } } }]); }(Mesh.Mesh); exports.MeshSimple = MeshSimple; /***/ }), /***/ 3635: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var browserExt = __webpack_require__(44241); var webworkerExt = __webpack_require__(10829); var Extensions = __webpack_require__(86890); __webpack_require__(28464); __webpack_require__(12980); __webpack_require__(7224); __webpack_require__(4089); __webpack_require__(11519); __webpack_require__(26513); __webpack_require__(30107); __webpack_require__(87328); __webpack_require__(80844); __webpack_require__(2473); __webpack_require__(84860); __webpack_require__(38796); __webpack_require__(22609); __webpack_require__(46038); __webpack_require__(407); __webpack_require__(34979); __webpack_require__(68375); __webpack_require__(61784); __webpack_require__(58208); __webpack_require__(72076); __webpack_require__(36786); __webpack_require__(94813); var AccessibilitySystem = __webpack_require__(21353); var accessibilityTarget = __webpack_require__(58669); var ColorBlend = __webpack_require__(66983); var ColorBurnBlend = __webpack_require__(39992); var ColorDodgeBlend = __webpack_require__(3232); var DarkenBlend = __webpack_require__(47447); var DifferenceBlend = __webpack_require__(5347); var DivideBlend = __webpack_require__(93169); var ExclusionBlend = __webpack_require__(4018); var HardLightBlend = __webpack_require__(57743); var HardMixBlend = __webpack_require__(84853); var LightenBlend = __webpack_require__(80423); var LinearBurnBlend = __webpack_require__(18322); var LinearDodgeBlend = __webpack_require__(35298); var LinearLightBlend = __webpack_require__(60215); var LuminosityBlend = __webpack_require__(43905); var NegationBlend = __webpack_require__(48811); var OverlayBlend = __webpack_require__(24074); var PinLightBlend = __webpack_require__(18229); var SaturationBlend = __webpack_require__(80690); var SoftLightBlend = __webpack_require__(90882); var SubtractBlend = __webpack_require__(20622); var VividLightBlend = __webpack_require__(14394); var Application = __webpack_require__(34453); var ResizePlugin = __webpack_require__(27628); var TickerPlugin = __webpack_require__(47054); var Assets = __webpack_require__(80396); var BackgroundLoader = __webpack_require__(51814); var Cache = __webpack_require__(65278); var cacheTextureArray = __webpack_require__(62997); var detectAvif = __webpack_require__(33634); var detectDefaults = __webpack_require__(51783); var detectMp4 = __webpack_require__(2675); var detectOgv = __webpack_require__(20180); var detectWebm = __webpack_require__(52371); var detectWebp = __webpack_require__(42264); var testImageFormat = __webpack_require__(13714); var testVideoFormat = __webpack_require__(82788); var Loader = __webpack_require__(85898); var LoaderParser = __webpack_require__(96804); var loadJson = __webpack_require__(23962); var loadTxt = __webpack_require__(24778); var loadWebFont = __webpack_require__(43885); var loadSVG = __webpack_require__(10465); var loadTextures = __webpack_require__(7407); var loadVideoTextures = __webpack_require__(7272); var createTexture = __webpack_require__(49698); var WorkerManager = __webpack_require__(4480); var resolveJsonUrl = __webpack_require__(20720); var resolveTextureUrl = __webpack_require__(12435); var Resolver = __webpack_require__(54080); var checkDataUrl = __webpack_require__(36258); var checkExtension = __webpack_require__(59230); var convertToList = __webpack_require__(28097); var copySearchParams = __webpack_require__(16508); var createStringVariations = __webpack_require__(24500); var isSingleItem = __webpack_require__(91208); var Color = __webpack_require__(98828); var detectBasis = __webpack_require__(15698); var loadBasis = __webpack_require__(83123); var createLevelBuffers = __webpack_require__(88842); var gpuFormatToBasisTranscoderFormat = __webpack_require__(73893); var setBasisTranscoderPath = __webpack_require__(9773); var loadBasisOnWorker = __webpack_require__(23237); var _const = __webpack_require__(43021); var loadDDS = __webpack_require__(39779); var parseDDS = __webpack_require__(14432); var loadKTX = __webpack_require__(79259); var parseKTX = __webpack_require__(3200); var _const$1 = __webpack_require__(57519); var loadKTX2 = __webpack_require__(94363); var convertFormatIfRequired = __webpack_require__(16680); var createLevelBuffersFromKTX = __webpack_require__(41960); var getTextureFormatFromKTXTexture = __webpack_require__(87440); var glFormatToGPUFormat = __webpack_require__(59520); var gpuFormatToKTXBasisTranscoderFormat = __webpack_require__(44383); var setKTXTranscoderPath = __webpack_require__(74977); var vkFormatToGPUFormat = __webpack_require__(20780); var loadKTX2onWorker = __webpack_require__(29977); var detectCompressed = __webpack_require__(46492); var resolveCompressedTextureUrl = __webpack_require__(73169); var Culler = __webpack_require__(10541); var CullerPlugin = __webpack_require__(93942); var cullingMixin = __webpack_require__(47827); var adapter = __webpack_require__(72450); var autoDetectEnvironment = __webpack_require__(48444); var BrowserAdapter = __webpack_require__(24509); var WebWorkerAdapter = __webpack_require__(80721); var EventBoundary = __webpack_require__(61435); var EventSystem = __webpack_require__(49556); var EventTicker = __webpack_require__(21623); var FederatedEvent = __webpack_require__(42961); var FederatedEventTarget = __webpack_require__(64996); var FederatedMouseEvent = __webpack_require__(73616); var FederatedPointerEvent = __webpack_require__(58122); var FederatedWheelEvent = __webpack_require__(69288); var blendTemplate = __webpack_require__(1196); var blendTemplate$1 = __webpack_require__(54807); var blendTemplate$2 = __webpack_require__(83873); var hsl = __webpack_require__(74486); var alpha = __webpack_require__(61507); var alpha$1 = __webpack_require__(25082); var blurTemplate = __webpack_require__(82422); var colorMatrixFilter = __webpack_require__(79556); var colorMatrixFilter$1 = __webpack_require__(45001); var defaultFilter = __webpack_require__(78440); var displacement = __webpack_require__(53659); var displacement$1 = __webpack_require__(5144); var displacement$2 = __webpack_require__(70818); var noise = __webpack_require__(55191); var noise$1 = __webpack_require__(83014); var mask = __webpack_require__(6586); var mask$1 = __webpack_require__(72521); var mask$2 = __webpack_require__(56655); var BlendModeFilter = __webpack_require__(8948); var GLhls = __webpack_require__(44064); var GPUhls = __webpack_require__(505); var AlphaFilter = __webpack_require__(60375); var BlurFilter = __webpack_require__(38991); var BlurFilterPass = __webpack_require__(9154); var _const$2 = __webpack_require__(59249); var generateBlurFragSource = __webpack_require__(76421); var generateBlurGlProgram = __webpack_require__(45299); var generateBlurVertSource = __webpack_require__(34278); var generateBlurProgram = __webpack_require__(69177); var ColorMatrixFilter = __webpack_require__(9972); var DisplacementFilter = __webpack_require__(31503); var NoiseFilter = __webpack_require__(50859); var Filter = __webpack_require__(92393); var FilterEffect = __webpack_require__(51856); var FilterPipe = __webpack_require__(43717); var FilterSystem = __webpack_require__(10116); var MaskFilter = __webpack_require__(9012); var groupD8 = __webpack_require__(56018); var Matrix = __webpack_require__(20764); var _const$3 = __webpack_require__(83987); var pow2 = __webpack_require__(52878); var squaredDistanceToLineSegment = __webpack_require__(34060); var ObservablePoint = __webpack_require__(14823); var Point = __webpack_require__(75544); var pointInTriangle = __webpack_require__(89675); var Circle = __webpack_require__(37764); var Ellipse = __webpack_require__(10816); var Polygon = __webpack_require__(53932); var Rectangle = __webpack_require__(74731); var RoundedRectangle = __webpack_require__(54122); var Triangle = __webpack_require__(56400); var PrepareBase = __webpack_require__(87661); var PrepareQueue = __webpack_require__(2505); var PrepareSystem = __webpack_require__(10849); var PrepareUpload = __webpack_require__(75957); var GlBatchAdaptor = __webpack_require__(39062); var checkMaxIfStatementsInShader = __webpack_require__(61751); var maxRecommendedTextures = __webpack_require__(6899); var generateGPULayout = __webpack_require__(14952); var generateLayout = __webpack_require__(58840); var getTextureBatchBindGroup = __webpack_require__(62340); var GpuBatchAdaptor = __webpack_require__(53626); var Batcher = __webpack_require__(55403); var BatcherPipe = __webpack_require__(61087); var BatchGeometry = __webpack_require__(31932); var BatchTextureArray = __webpack_require__(54404); var DefaultBatcher = __webpack_require__(91938); var DefaultShader = __webpack_require__(51080); var compileHighShaderToProgram = __webpack_require__(97754); var compileHighShader = __webpack_require__(14075); var addBits = __webpack_require__(88750); var compileHooks = __webpack_require__(33102); var compileInputs = __webpack_require__(13281); var compileOutputs = __webpack_require__(32012); var formatShader = __webpack_require__(79379); var injectBits = __webpack_require__(22880); var defaultProgramTemplate = __webpack_require__(46484); var colorBit = __webpack_require__(78786); var generateTextureBatchBit = __webpack_require__(96847); var globalUniformsBit = __webpack_require__(31359); var localUniformBit = __webpack_require__(21654); var roundPixelsBit = __webpack_require__(35268); var textureBit = __webpack_require__(37874); var AlphaMask = __webpack_require__(28662); var AlphaMaskPipe = __webpack_require__(89914); var ColorMask = __webpack_require__(37078); var ColorMaskPipe = __webpack_require__(42682); var MaskEffectManager = __webpack_require__(47281); var ScissorMask = __webpack_require__(70854); var StencilMask = __webpack_require__(13798); var StencilMaskPipe = __webpack_require__(28010); var addMaskBounds = __webpack_require__(30597); var addMaskLocalBounds = __webpack_require__(82132); var autoDetectRenderer = __webpack_require__(68556); var _const$4 = __webpack_require__(43265); var GlBuffer = __webpack_require__(59061); var GlBufferSystem = __webpack_require__(46952); var _const$5 = __webpack_require__(63548); var GlContextSystem = __webpack_require__(84344); var GlGeometrySystem = __webpack_require__(85580); var getGlTypeFromFormat = __webpack_require__(74374); var GlBackBufferSystem = __webpack_require__(800); var GlColorMaskSystem = __webpack_require__(38084); var GlEncoderSystem = __webpack_require__(16051); var GlRenderTarget = __webpack_require__(39401); var GlStencilSystem = __webpack_require__(10011); var GlUboSystem = __webpack_require__(68951); var GlRenderTargetAdaptor = __webpack_require__(53310); var GlRenderTargetSystem = __webpack_require__(58002); var GenerateShaderSyncCode = __webpack_require__(70809); var getBatchSamplersUniformGroup = __webpack_require__(72059); var GlProgram = __webpack_require__(23896); var GlProgramData = __webpack_require__(41568); var GlShaderSystem = __webpack_require__(17058); var GlUniformGroupSystem = __webpack_require__(72360); var migrateFragmentFromV7toV8 = __webpack_require__(22380); var compileShader = __webpack_require__(80442); var defaultValue = __webpack_require__(40486); var ensureAttributes = __webpack_require__(85855); var extractAttributesFromGlProgram = __webpack_require__(3061); var generateProgram = __webpack_require__(40559); var getMaxFragmentPrecision = __webpack_require__(56696); var getTestContext = __webpack_require__(25131); var getUboData = __webpack_require__(31216); var getUniformData = __webpack_require__(98192); var logProgramError = __webpack_require__(40474); var mapSize = __webpack_require__(31349); var mapType = __webpack_require__(63880); var addProgramDefines = __webpack_require__(66702); var ensurePrecision = __webpack_require__(57151); var insertVersion = __webpack_require__(30942); var setProgramName = __webpack_require__(55946); var stripVersion = __webpack_require__(20303); var createUboElementsSTD40 = __webpack_require__(86754); var createUboSyncSTD40 = __webpack_require__(2187); var generateArraySyncSTD40 = __webpack_require__(71075); var generateUniformsSync = __webpack_require__(19114); var generateUniformsSyncTypes = __webpack_require__(1761); var GlStateSystem = __webpack_require__(43528); var mapWebGLBlendModesToPixi = __webpack_require__(95822); var _const$6 = __webpack_require__(80176); var GlTexture = __webpack_require__(10485); var GlTextureSystem = __webpack_require__(90216); var glUploadBufferImageResource = __webpack_require__(45394); var glUploadCompressedTextureResource = __webpack_require__(33173); var glUploadImageResource = __webpack_require__(13864); var glUploadVideoResource = __webpack_require__(18410); var applyStyleParams = __webpack_require__(2818); var getSupportedGlCompressedTextureFormats = __webpack_require__(40260); var mapFormatToGlFormat = __webpack_require__(99229); var mapFormatToGlInternalFormat = __webpack_require__(6088); var mapFormatToGlType = __webpack_require__(96230); var pixiToGlMaps = __webpack_require__(77236); var unpremultiplyAlpha = __webpack_require__(88545); var WebGLRenderer = __webpack_require__(15973); var BindGroupSystem = __webpack_require__(95865); var GpuBufferSystem = __webpack_require__(37848); var GpuReadBuffer = __webpack_require__(70001); var UboBatch = __webpack_require__(41581); var GpuColorMaskSystem = __webpack_require__(83432); var GpuDeviceSystem = __webpack_require__(58815); var GpuEncoderSystem = __webpack_require__(59471); var GpuStencilSystem = __webpack_require__(47135); var GpuUboSystem = __webpack_require__(51387); var GpuUniformBatchPipe = __webpack_require__(79236); var PipelineSystem = __webpack_require__(12026); var calculateProjection = __webpack_require__(46415); var GpuRenderTarget = __webpack_require__(46873); var GpuRenderTargetAdaptor = __webpack_require__(64884); var GpuRenderTargetSystem = __webpack_require__(30324); var BindGroup = __webpack_require__(85156); var GpuProgram = __webpack_require__(57974); var GpuShaderSystem = __webpack_require__(82084); var createUboElementsWGSL = __webpack_require__(30008); var createUboSyncFunctionWGSL = __webpack_require__(2898); var extractAttributesFromGpuProgram = __webpack_require__(10494); var extractStructAndGroups = __webpack_require__(23551); var generateArraySyncWGSL = __webpack_require__(98954); var generateGpuLayoutGroups = __webpack_require__(14405); var generateLayoutHash = __webpack_require__(70823); var removeStructAndGroupDuplicates = __webpack_require__(92893); var GpuBlendModesToPixi = __webpack_require__(2422); var GpuStateSystem = __webpack_require__(95120); var GpuStencilModesToPixi = __webpack_require__(25039); var GpuTextureSystem = __webpack_require__(61284); var gpuUploadBufferImageResource = __webpack_require__(52138); var gpuUploadCompressedTextureResource = __webpack_require__(92989); var gpuUploadImageSource = __webpack_require__(37493); var gpuUploadVideoSource = __webpack_require__(28595); var getSupportedGPUCompressedTextureFormats = __webpack_require__(53252); var GpuMipmapGenerator = __webpack_require__(45413); var WebGPURenderer = __webpack_require__(98971); var BackgroundSystem = __webpack_require__(52481); var BlendModePipe = __webpack_require__(73155); var Buffer = __webpack_require__(59832); var BufferResource = __webpack_require__(1484); var _const$7 = __webpack_require__(33843); var fastCopy = __webpack_require__(36243); var ExtractSystem = __webpack_require__(41267); var GenerateTextureSystem = __webpack_require__(66304); var _const$8 = __webpack_require__(43469); var Geometry = __webpack_require__(18964); var buildUvs = __webpack_require__(36262); var ensureIsBuffer = __webpack_require__(9258); var getAttributeInfoFromFormat = __webpack_require__(63421); var getGeometryBounds = __webpack_require__(1021); var transformVertices = __webpack_require__(25835); var InstructionSet = __webpack_require__(15571); var GlobalUniformSystem = __webpack_require__(78115); var isRenderingToScreen = __webpack_require__(33490); var RenderTarget = __webpack_require__(25654); var RenderTargetSystem = __webpack_require__(50827); var viewportFromFrame = __webpack_require__(1336); var SchedulerSystem = __webpack_require__(93381); var _const$9 = __webpack_require__(23448); var Shader = __webpack_require__(27866); var types = __webpack_require__(4386); var UboSystem = __webpack_require__(50626); var UniformGroup = __webpack_require__(34400); var createUboSyncFunction = __webpack_require__(46674); var getDefaultUniformValue = __webpack_require__(15489); var uboSyncFunctions = __webpack_require__(52029); var uniformParsers = __webpack_require__(23845); var HelloSystem = __webpack_require__(34102); var _const$a = __webpack_require__(15068); var getAdjustedBlendModeBlend = __webpack_require__(4794); var State = __webpack_require__(84938); var AbstractRenderer = __webpack_require__(59158); var SharedSystems = __webpack_require__(96406); var SystemRunner = __webpack_require__(70652); var CanvasPool = __webpack_require__(88699); var _const$b = __webpack_require__(18578); var RenderableGCSystem = __webpack_require__(52070); var RenderTexture = __webpack_require__(37314); var BufferImageSource = __webpack_require__(56634); var CanvasSource = __webpack_require__(35879); var CompressedSource = __webpack_require__(49326); var ImageSource = __webpack_require__(80344); var TextureSource = __webpack_require__(55406); var VideoSource = __webpack_require__(19782); var Texture = __webpack_require__(73782); var TextureGCSystem = __webpack_require__(19977); var TextureMatrix = __webpack_require__(82467); var TexturePool = __webpack_require__(53248); var TextureStyle = __webpack_require__(62881); var TextureUvs = __webpack_require__(41136); var generateUID = __webpack_require__(69968); var getCanvasTexture = __webpack_require__(57240); var getSupportedCompressedTextureFormats = __webpack_require__(2081); var getSupportedTextureFormats = __webpack_require__(10144); var textureFrom = __webpack_require__(42268); var createIdFromString = __webpack_require__(79471); var parseFunctionBody = __webpack_require__(45520); var ViewSystem = __webpack_require__(79679); var types$1 = __webpack_require__(9634); var particles = __webpack_require__(92718); var particles$1 = __webpack_require__(10453); var particles$2 = __webpack_require__(27563); var Bounds = __webpack_require__(76631); var getFastGlobalBounds = __webpack_require__(32160); var getGlobalBounds = __webpack_require__(27182); var getLocalBounds = __webpack_require__(81268); var getRenderableBounds = __webpack_require__(36869); var matrixAndBoundsPool = __webpack_require__(22727); var cacheAsTextureMixin = __webpack_require__(21963); var childrenHelperMixin = __webpack_require__(95033); var collectRenderablesMixin = __webpack_require__(3281); var effectsMixin = __webpack_require__(31594); var findMixin = __webpack_require__(24937); var getFastGlobalBoundsMixin = __webpack_require__(86512); var getGlobalMixin = __webpack_require__(62461); var measureMixin = __webpack_require__(44840); var onRenderMixin = __webpack_require__(75327); var sortMixin = __webpack_require__(39244); var toLocalGlobalMixin = __webpack_require__(64373); var Container = __webpack_require__(47719); var CustomRenderPipe = __webpack_require__(7705); var RenderContainer = __webpack_require__(10927); var RenderGroup = __webpack_require__(17019); var RenderGroupPipe = __webpack_require__(93839); var RenderGroupSystem = __webpack_require__(14342); var assignWithIgnore = __webpack_require__(69095); var checkChildrenDidChange = __webpack_require__(5040); var clearList = __webpack_require__(56643); var collectAllRenderables = __webpack_require__(41368); var definedProps = __webpack_require__(48629); var executeInstructions = __webpack_require__(38224); var mixHexColors = __webpack_require__(36007); var multiplyColors = __webpack_require__(79904); var multiplyHexColors = __webpack_require__(6967); var updateLocalTransform = __webpack_require__(98268); var updateRenderGroupTransforms = __webpack_require__(75315); var updateWorldTransform = __webpack_require__(24425); var validateRenderables = __webpack_require__(28085); var GlGraphicsAdaptor = __webpack_require__(22905); var colorToUniform = __webpack_require__(6455); var GpuGraphicsAdaptor = __webpack_require__(71717); var BatchableGraphics = __webpack_require__(84305); var buildAdaptiveBezier = __webpack_require__(80556); var buildAdaptiveQuadratic = __webpack_require__(6417); var buildArc = __webpack_require__(52165); var buildArcTo = __webpack_require__(64564); var buildArcToSvg = __webpack_require__(32680); var buildCircle = __webpack_require__(94641); var buildLine = __webpack_require__(21187); var buildPixelLine = __webpack_require__(22247); var buildPolygon = __webpack_require__(18591); var buildRectangle = __webpack_require__(92828); var buildTriangle = __webpack_require__(96465); var _const$c = __webpack_require__(99799); var FillGradient = __webpack_require__(57315); var FillPattern = __webpack_require__(95745); var Graphics = __webpack_require__(82323); var GraphicsContext = __webpack_require__(59244); var GraphicsContextSystem = __webpack_require__(40545); var GraphicsPipe = __webpack_require__(74199); var GraphicsPath = __webpack_require__(91058); var roundShape = __webpack_require__(6721); var ShapePath = __webpack_require__(71012); var parseSVGDefinitions = __webpack_require__(51274); var parseSVGFloatAttribute = __webpack_require__(99836); var parseSVGPath = __webpack_require__(91281); var parseSVGStyle = __webpack_require__(24185); var SVGParser = __webpack_require__(74704); var extractSvgUrlId = __webpack_require__(45084); var buildContextBatches = __webpack_require__(82847); var buildGeometryFromPath = __webpack_require__(60237); var convertFillInputToFillStyle = __webpack_require__(88129); var generateTextureFillMatrix = __webpack_require__(81004); var getOrientationOfPoints = __webpack_require__(11556); var triangulateWithHoles = __webpack_require__(39333); var RenderLayer = __webpack_require__(2110); var PerspectiveMesh = __webpack_require__(21408); var PerspectivePlaneGeometry = __webpack_require__(83675); var applyProjectiveTransformationToPlane = __webpack_require__(8952); var compute2DProjections = __webpack_require__(10026); var MeshPlane = __webpack_require__(69802); var PlaneGeometry = __webpack_require__(45301); var MeshRope = __webpack_require__(68520); var MeshSimple = __webpack_require__(3418); var RopeGeometry = __webpack_require__(72989); var GlMeshAdaptor = __webpack_require__(5661); var GpuMeshAdapter = __webpack_require__(3851); var BatchableMesh = __webpack_require__(8781); var getTextureDefaultMatrix = __webpack_require__(80657); var Mesh = __webpack_require__(60931); var MeshGeometry = __webpack_require__(56451); var MeshPipe = __webpack_require__(80871); var GlParticleContainerAdaptor = __webpack_require__(54600); var GpuParticleContainerAdaptor = __webpack_require__(98996); var GlParticleContainerPipe = __webpack_require__(61647); var GpuParticleContainerPipe = __webpack_require__(41412); var Particle = __webpack_require__(75313); var ParticleBuffer = __webpack_require__(91743); var ParticleContainer = __webpack_require__(4230); var ParticleContainerPipe = __webpack_require__(52874); var particleData = __webpack_require__(27265); var ParticleShader = __webpack_require__(70026); var createIndicesForQuads = __webpack_require__(33925); var generateParticleUpdateFunction = __webpack_require__(34413); var AnimatedSprite = __webpack_require__(39292); var NineSliceGeometry = __webpack_require__(31598); var NineSliceSprite = __webpack_require__(60583); var NineSliceSpritePipe = __webpack_require__(5699); var tilingBit = __webpack_require__(31054); var TilingSpriteShader = __webpack_require__(47465); var TilingSprite = __webpack_require__(54360); var TilingSpritePipe = __webpack_require__(38468); var applyMatrix = __webpack_require__(23963); var QuadGeometry = __webpack_require__(99539); var setPositions = __webpack_require__(60516); var setUvs = __webpack_require__(43884); var BatchableSprite = __webpack_require__(42517); var Sprite = __webpack_require__(27615); var SpritePipe = __webpack_require__(73707); var AbstractBitmapFont = __webpack_require__(17660); var bitmapFontTextParser = __webpack_require__(89907); var bitmapFontXMLParser = __webpack_require__(75037); var bitmapFontXMLStringParser = __webpack_require__(70868); var loadBitmapFont = __webpack_require__(87115); var BitmapFont = __webpack_require__(79826); var BitmapFontManager = __webpack_require__(30815); var BitmapText = __webpack_require__(84968); var BitmapTextPipe = __webpack_require__(74164); var DynamicBitmapFont = __webpack_require__(2441); var getBitmapTextLayout = __webpack_require__(41914); var resolveCharacters = __webpack_require__(8448); var HTMLText = __webpack_require__(7888); var HTMLTextPipe = __webpack_require__(39148); var HTMLTextRenderData = __webpack_require__(40180); var HTMLTextStyle = __webpack_require__(755); var HTMLTextSystem = __webpack_require__(77693); var extractFontFamilies = __webpack_require__(68618); var getFontCss = __webpack_require__(37368); var getSVGUrl = __webpack_require__(91945); var getTemporaryCanvasFromImage = __webpack_require__(4026); var loadFontAsBase64 = __webpack_require__(78974); var loadFontCSS = __webpack_require__(43382); var loadSVGImage = __webpack_require__(82423); var measureHtmlText = __webpack_require__(54748); var textStyleToCSS = __webpack_require__(85080); var AbstractText = __webpack_require__(93213); var CanvasTextMetrics = __webpack_require__(1635); var CanvasTextPipe = __webpack_require__(22572); var CanvasTextSystem = __webpack_require__(71581); var fontStringFromTextStyle = __webpack_require__(30145); var getCanvasFillStyle = __webpack_require__(52179); var SdfShader = __webpack_require__(10377); var localUniformMSDFBit = __webpack_require__(97018); var mSDFBit = __webpack_require__(85973); var Text = __webpack_require__(61787); var TextStyle = __webpack_require__(55858); var ensureTextStyle = __webpack_require__(56218); var generateTextStyleKey = __webpack_require__(5070); var getPo2TextureFromSource = __webpack_require__(41701); var updateTextBounds = __webpack_require__(38157); var ViewContainer = __webpack_require__(23804); var Spritesheet = __webpack_require__(68216); var spritesheetAsset = __webpack_require__(44622); var _const$d = __webpack_require__(20105); var Ticker = __webpack_require__(6014); var TickerListener = __webpack_require__(83690); var detectVideoAlphaMode = __webpack_require__(29501); var isMobile = __webpack_require__(27126); var isSafari = __webpack_require__(33552); var isWebGLSupported = __webpack_require__(67073); var isWebGPUSupported = __webpack_require__(50132); var unsafeEvalSupported = __webpack_require__(70688); var getCanvasBoundingBox = __webpack_require__(82525); var _const$e = __webpack_require__(22718); var EventEmitter = __webpack_require__(19497); var clean = __webpack_require__(35775); var removeItems = __webpack_require__(6602); var uid = __webpack_require__(90844); var updateQuadBounds = __webpack_require__(28275); var ViewableBuffer = __webpack_require__(73803); var globalHooks = __webpack_require__(28488); var deprecation = __webpack_require__(11225); var logDebugTexture = __webpack_require__(14827); var logScene = __webpack_require__(84189); var warn = __webpack_require__(57371); var NOOP = __webpack_require__(6036); var Transform = __webpack_require__(20806); var getResolutionOfUrl = __webpack_require__(40230); var path = __webpack_require__(30710); var Pool = __webpack_require__(93068); var PoolGroup = __webpack_require__(47505); var sayHello = __webpack_require__(59668); var earcut = __webpack_require__(32231); "use strict"; Extensions.extensions.add(browserExt.browserExt, webworkerExt.webworkerExt); exports.browserExt = browserExt.browserExt; exports.webworkerExt = webworkerExt.webworkerExt; exports.ExtensionType = Extensions.ExtensionType; exports.extensions = Extensions.extensions; exports.normalizeExtensionPriority = Extensions.normalizeExtensionPriority; exports.AccessibilitySystem = AccessibilitySystem.AccessibilitySystem; exports.accessibilityTarget = accessibilityTarget.accessibilityTarget; exports.ColorBlend = ColorBlend.ColorBlend; exports.ColorBurnBlend = ColorBurnBlend.ColorBurnBlend; exports.ColorDodgeBlend = ColorDodgeBlend.ColorDodgeBlend; exports.DarkenBlend = DarkenBlend.DarkenBlend; exports.DifferenceBlend = DifferenceBlend.DifferenceBlend; exports.DivideBlend = DivideBlend.DivideBlend; exports.ExclusionBlend = ExclusionBlend.ExclusionBlend; exports.HardLightBlend = HardLightBlend.HardLightBlend; exports.HardMixBlend = HardMixBlend.HardMixBlend; exports.LightenBlend = LightenBlend.LightenBlend; exports.LinearBurnBlend = LinearBurnBlend.LinearBurnBlend; exports.LinearDodgeBlend = LinearDodgeBlend.LinearDodgeBlend; exports.LinearLightBlend = LinearLightBlend.LinearLightBlend; exports.LuminosityBlend = LuminosityBlend.LuminosityBlend; exports.NegationBlend = NegationBlend.NegationBlend; exports.OverlayBlend = OverlayBlend.OverlayBlend; exports.PinLightBlend = PinLightBlend.PinLightBlend; exports.SaturationBlend = SaturationBlend.SaturationBlend; exports.SoftLightBlend = SoftLightBlend.SoftLightBlend; exports.SubtractBlend = SubtractBlend.SubtractBlend; exports.VividLightBlend = VividLightBlend.VividLightBlend; exports.Application = Application.Application; exports.ResizePlugin = ResizePlugin.ResizePlugin; exports.TickerPlugin = TickerPlugin.TickerPlugin; exports.Assets = Assets.Assets; exports.AssetsClass = Assets.AssetsClass; exports.BackgroundLoader = BackgroundLoader.BackgroundLoader; exports.Cache = Cache.Cache; exports.cacheTextureArray = cacheTextureArray.cacheTextureArray; exports.detectAvif = detectAvif.detectAvif; exports.detectDefaults = detectDefaults.detectDefaults; exports.detectMp4 = detectMp4.detectMp4; exports.detectOgv = detectOgv.detectOgv; exports.detectWebm = detectWebm.detectWebm; exports.detectWebp = detectWebp.detectWebp; exports.testImageFormat = testImageFormat.testImageFormat; exports.testVideoFormat = testVideoFormat.testVideoFormat; exports.Loader = Loader.Loader; exports.LoaderParserPriority = LoaderParser.LoaderParserPriority; exports.loadJson = loadJson.loadJson; exports.loadTxt = loadTxt.loadTxt; exports.getFontFamilyName = loadWebFont.getFontFamilyName; exports.loadWebFont = loadWebFont.loadWebFont; exports.loadSvg = loadSVG.loadSvg; exports.loadImageBitmap = loadTextures.loadImageBitmap; exports.loadTextures = loadTextures.loadTextures; exports.crossOrigin = loadVideoTextures.crossOrigin; exports.determineCrossOrigin = loadVideoTextures.determineCrossOrigin; exports.loadVideoTextures = loadVideoTextures.loadVideoTextures; exports.preloadVideo = loadVideoTextures.preloadVideo; exports.createTexture = createTexture.createTexture; exports.WorkerManager = WorkerManager.WorkerManager; exports.resolveJsonUrl = resolveJsonUrl.resolveJsonUrl; exports.resolveTextureUrl = resolveTextureUrl.resolveTextureUrl; exports.Resolver = Resolver.Resolver; exports.getUrlExtension = Resolver.getUrlExtension; exports.checkDataUrl = checkDataUrl.checkDataUrl; exports.checkExtension = checkExtension.checkExtension; exports.convertToList = convertToList.convertToList; exports.copySearchParams = copySearchParams.copySearchParams; exports.createStringVariations = createStringVariations.createStringVariations; exports.isSingleItem = isSingleItem.isSingleItem; exports.Color = Color.Color; exports.detectBasis = detectBasis.detectBasis; exports.loadBasis = loadBasis.loadBasis; exports.createLevelBuffers = createLevelBuffers.createLevelBuffers; exports.gpuFormatToBasisTranscoderFormat = gpuFormatToBasisTranscoderFormat.gpuFormatToBasisTranscoderFormat; exports.basisTranscoderUrls = setBasisTranscoderPath.basisTranscoderUrls; exports.setBasisTranscoderPath = setBasisTranscoderPath.setBasisTranscoderPath; exports.loadBasisOnWorker = loadBasisOnWorker.loadBasisOnWorker; exports.D3D10_RESOURCE_DIMENSION = _const.D3D10_RESOURCE_DIMENSION; exports.D3DFMT = _const.D3DFMT; exports.DDS = _const.DDS; exports.DXGI_FORMAT = _const.DXGI_FORMAT; exports.DXGI_TO_TEXTURE_FORMAT = _const.DXGI_TO_TEXTURE_FORMAT; exports.FOURCC_TO_TEXTURE_FORMAT = _const.FOURCC_TO_TEXTURE_FORMAT; exports.TEXTURE_FORMAT_BLOCK_SIZE = _const.TEXTURE_FORMAT_BLOCK_SIZE; exports.loadDDS = loadDDS.loadDDS; exports.parseDDS = parseDDS.parseDDS; exports.loadKTX = loadKTX.loadKTX; exports.parseKTX = parseKTX.parseKTX; exports.GL_INTERNAL_FORMAT = _const$1.GL_INTERNAL_FORMAT; exports.KTX = _const$1.KTX; exports.loadKTX2 = loadKTX2.loadKTX2; exports.convertFormatIfRequired = convertFormatIfRequired.convertFormatIfRequired; exports.createLevelBuffersFromKTX = createLevelBuffersFromKTX.createLevelBuffersFromKTX; exports.getTextureFormatFromKTXTexture = getTextureFormatFromKTXTexture.getTextureFormatFromKTXTexture; exports.glFormatToGPUFormat = glFormatToGPUFormat.glFormatToGPUFormat; exports.gpuFormatToKTXBasisTranscoderFormat = gpuFormatToKTXBasisTranscoderFormat.gpuFormatToKTXBasisTranscoderFormat; exports.ktxTranscoderUrls = setKTXTranscoderPath.ktxTranscoderUrls; exports.setKTXTranscoderPath = setKTXTranscoderPath.setKTXTranscoderPath; exports.vkFormatToGPUFormat = vkFormatToGPUFormat.vkFormatToGPUFormat; exports.loadKTX2onWorker = loadKTX2onWorker.loadKTX2onWorker; exports.detectCompressed = detectCompressed.detectCompressed; exports.resolveCompressedTextureUrl = resolveCompressedTextureUrl.resolveCompressedTextureUrl; exports.validFormats = resolveCompressedTextureUrl.validFormats; exports.Culler = Culler.Culler; exports.CullerPlugin = CullerPlugin.CullerPlugin; exports.cullingMixin = cullingMixin.cullingMixin; exports.DOMAdapter = adapter.DOMAdapter; exports.autoDetectEnvironment = autoDetectEnvironment.autoDetectEnvironment; exports.loadEnvironmentExtensions = autoDetectEnvironment.loadEnvironmentExtensions; exports.BrowserAdapter = BrowserAdapter.BrowserAdapter; exports.WebWorkerAdapter = WebWorkerAdapter.WebWorkerAdapter; exports.EventBoundary = EventBoundary.EventBoundary; exports.EventSystem = EventSystem.EventSystem; exports.EventsTicker = EventTicker.EventsTicker; exports.FederatedEvent = FederatedEvent.FederatedEvent; exports.FederatedContainer = FederatedEventTarget.FederatedContainer; exports.FederatedMouseEvent = FederatedMouseEvent.FederatedMouseEvent; exports.FederatedPointerEvent = FederatedPointerEvent.FederatedPointerEvent; exports.FederatedWheelEvent = FederatedWheelEvent.FederatedWheelEvent; exports.blendTemplateFrag = blendTemplate["default"]; exports.blendTemplateVert = blendTemplate$1["default"]; exports.blendTemplateWgsl = blendTemplate$2["default"]; exports.hslWgsl = hsl["default"]; exports.alphaFrag = alpha["default"]; exports.alphaWgsl = alpha$1["default"]; exports.blurTemplateWgsl = blurTemplate["default"]; exports.colorMatrixFilterFrag = colorMatrixFilter["default"]; exports.colorMatrixFilterWgsl = colorMatrixFilter$1["default"]; exports.defaultFilterVert = defaultFilter["default"]; exports.displacementFrag = displacement["default"]; exports.displacementVert = displacement$1["default"]; exports.displacementWgsl = displacement$2["default"]; exports.noiseFrag = noise["default"]; exports.noiseWgsl = noise$1["default"]; exports.maskFrag = mask["default"]; exports.maskVert = mask$1["default"]; exports.maskWgsl = mask$2["default"]; exports.BlendModeFilter = BlendModeFilter.BlendModeFilter; exports.hslgl = GLhls.hslgl; exports.hslgpu = GPUhls.hslgpu; exports.AlphaFilter = AlphaFilter.AlphaFilter; exports.BlurFilter = BlurFilter.BlurFilter; exports.BlurFilterPass = BlurFilterPass.BlurFilterPass; exports.GAUSSIAN_VALUES = _const$2.GAUSSIAN_VALUES; exports.generateBlurFragSource = generateBlurFragSource.generateBlurFragSource; exports.generateBlurGlProgram = generateBlurGlProgram.generateBlurGlProgram; exports.generateBlurVertSource = generateBlurVertSource.generateBlurVertSource; exports.generateBlurProgram = generateBlurProgram.generateBlurProgram; exports.ColorMatrixFilter = ColorMatrixFilter.ColorMatrixFilter; exports.DisplacementFilter = DisplacementFilter.DisplacementFilter; exports.NoiseFilter = NoiseFilter.NoiseFilter; exports.Filter = Filter.Filter; exports.FilterEffect = FilterEffect.FilterEffect; exports.FilterPipe = FilterPipe.FilterPipe; exports.FilterSystem = FilterSystem.FilterSystem; exports.MaskFilter = MaskFilter.MaskFilter; exports.groupD8 = groupD8.groupD8; exports.Matrix = Matrix.Matrix; exports.DEG_TO_RAD = _const$3.DEG_TO_RAD; exports.PI_2 = _const$3.PI_2; exports.RAD_TO_DEG = _const$3.RAD_TO_DEG; exports.isPow2 = pow2.isPow2; exports.log2 = pow2.log2; exports.nextPow2 = pow2.nextPow2; exports.squaredDistanceToLineSegment = squaredDistanceToLineSegment.squaredDistanceToLineSegment; exports.ObservablePoint = ObservablePoint.ObservablePoint; exports.Point = Point.Point; exports.pointInTriangle = pointInTriangle.pointInTriangle; exports.Circle = Circle.Circle; exports.Ellipse = Ellipse.Ellipse; exports.Polygon = Polygon.Polygon; exports.Rectangle = Rectangle.Rectangle; exports.RoundedRectangle = RoundedRectangle.RoundedRectangle; exports.Triangle = Triangle.Triangle; exports.PrepareBase = PrepareBase.PrepareBase; exports.PrepareQueue = PrepareQueue.PrepareQueue; exports.PrepareSystem = PrepareSystem.PrepareSystem; exports.PrepareUpload = PrepareUpload.PrepareUpload; exports.GlBatchAdaptor = GlBatchAdaptor.GlBatchAdaptor; exports.checkMaxIfStatementsInShader = checkMaxIfStatementsInShader.checkMaxIfStatementsInShader; exports.getMaxTexturesPerBatch = maxRecommendedTextures.getMaxTexturesPerBatch; exports.generateGPULayout = generateGPULayout.generateGPULayout; exports.generateLayout = generateLayout.generateLayout; exports.getTextureBatchBindGroup = getTextureBatchBindGroup.getTextureBatchBindGroup; exports.GpuBatchAdaptor = GpuBatchAdaptor.GpuBatchAdaptor; exports.Batch = Batcher.Batch; exports.Batcher = Batcher.Batcher; exports.BatcherPipe = BatcherPipe.BatcherPipe; exports.BatchGeometry = BatchGeometry.BatchGeometry; exports.BatchTextureArray = BatchTextureArray.BatchTextureArray; exports.DefaultBatcher = DefaultBatcher.DefaultBatcher; exports.DefaultShader = DefaultShader.DefaultShader; exports.compileHighShaderGlProgram = compileHighShaderToProgram.compileHighShaderGlProgram; exports.compileHighShaderGpuProgram = compileHighShaderToProgram.compileHighShaderGpuProgram; exports.compileHighShader = compileHighShader.compileHighShader; exports.compileHighShaderGl = compileHighShader.compileHighShaderGl; exports.addBits = addBits.addBits; exports.compileHooks = compileHooks.compileHooks; exports.findHooksRx = compileHooks.findHooksRx; exports.compileInputs = compileInputs.compileInputs; exports.compileOutputs = compileOutputs.compileOutputs; exports.formatShader = formatShader.formatShader; exports.injectBits = injectBits.injectBits; exports.fragmentGPUTemplate = defaultProgramTemplate.fragmentGPUTemplate; exports.fragmentGlTemplate = defaultProgramTemplate.fragmentGlTemplate; exports.vertexGPUTemplate = defaultProgramTemplate.vertexGPUTemplate; exports.vertexGlTemplate = defaultProgramTemplate.vertexGlTemplate; exports.colorBit = colorBit.colorBit; exports.colorBitGl = colorBit.colorBitGl; exports.generateTextureBatchBit = generateTextureBatchBit.generateTextureBatchBit; exports.generateTextureBatchBitGl = generateTextureBatchBit.generateTextureBatchBitGl; exports.globalUniformsBit = globalUniformsBit.globalUniformsBit; exports.globalUniformsBitGl = globalUniformsBit.globalUniformsBitGl; exports.globalUniformsUBOBitGl = globalUniformsBit.globalUniformsUBOBitGl; exports.localUniformBit = localUniformBit.localUniformBit; exports.localUniformBitGl = localUniformBit.localUniformBitGl; exports.localUniformBitGroup2 = localUniformBit.localUniformBitGroup2; exports.roundPixelsBit = roundPixelsBit.roundPixelsBit; exports.roundPixelsBitGl = roundPixelsBit.roundPixelsBitGl; exports.textureBit = textureBit.textureBit; exports.textureBitGl = textureBit.textureBitGl; exports.AlphaMask = AlphaMask.AlphaMask; exports.AlphaMaskPipe = AlphaMaskPipe.AlphaMaskPipe; exports.ColorMask = ColorMask.ColorMask; exports.ColorMaskPipe = ColorMaskPipe.ColorMaskPipe; exports.MaskEffectManager = MaskEffectManager.MaskEffectManager; exports.MaskEffectManagerClass = MaskEffectManager.MaskEffectManagerClass; exports.ScissorMask = ScissorMask.ScissorMask; exports.StencilMask = StencilMask.StencilMask; exports.StencilMaskPipe = StencilMaskPipe.StencilMaskPipe; exports.addMaskBounds = addMaskBounds.addMaskBounds; exports.addMaskLocalBounds = addMaskLocalBounds.addMaskLocalBounds; exports.getMatrixRelativeToParent = addMaskLocalBounds.getMatrixRelativeToParent; exports.autoDetectRenderer = autoDetectRenderer.autoDetectRenderer; exports.BUFFER_TYPE = _const$4.BUFFER_TYPE; exports.GlBuffer = GlBuffer.GlBuffer; exports.GlBufferSystem = GlBufferSystem.GlBufferSystem; exports.CLEAR = _const$5.CLEAR; exports.GlContextSystem = GlContextSystem.GlContextSystem; exports.GlGeometrySystem = GlGeometrySystem.GlGeometrySystem; exports.getGlTypeFromFormat = getGlTypeFromFormat.getGlTypeFromFormat; exports.GlBackBufferSystem = GlBackBufferSystem.GlBackBufferSystem; exports.GlColorMaskSystem = GlColorMaskSystem.GlColorMaskSystem; exports.GlEncoderSystem = GlEncoderSystem.GlEncoderSystem; exports.GlRenderTarget = GlRenderTarget.GlRenderTarget; exports.GlStencilSystem = GlStencilSystem.GlStencilSystem; exports.GlUboSystem = GlUboSystem.GlUboSystem; exports.GlRenderTargetAdaptor = GlRenderTargetAdaptor.GlRenderTargetAdaptor; exports.GlRenderTargetSystem = GlRenderTargetSystem.GlRenderTargetSystem; exports.generateShaderSyncCode = GenerateShaderSyncCode.generateShaderSyncCode; exports.getBatchSamplersUniformGroup = getBatchSamplersUniformGroup.getBatchSamplersUniformGroup; exports.GlProgram = GlProgram.GlProgram; exports.GlProgramData = GlProgramData.GlProgramData; exports.IGLUniformData = GlProgramData.IGLUniformData; exports.GlShaderSystem = GlShaderSystem.GlShaderSystem; exports.GlUniformGroupSystem = GlUniformGroupSystem.GlUniformGroupSystem; exports.migrateFragmentFromV7toV8 = migrateFragmentFromV7toV8.migrateFragmentFromV7toV8; exports.compileShader = compileShader.compileShader; exports.defaultValue = defaultValue.defaultValue; exports.ensureAttributes = ensureAttributes.ensureAttributes; exports.extractAttributesFromGlProgram = extractAttributesFromGlProgram.extractAttributesFromGlProgram; exports.generateProgram = generateProgram.generateProgram; exports.getMaxFragmentPrecision = getMaxFragmentPrecision.getMaxFragmentPrecision; exports.getTestContext = getTestContext.getTestContext; exports.getUboData = getUboData.getUboData; exports.getUniformData = getUniformData.getUniformData; exports.logProgramError = logProgramError.logProgramError; exports.mapSize = mapSize.mapSize; exports.mapGlToVertexFormat = mapType.mapGlToVertexFormat; exports.mapType = mapType.mapType; exports.addProgramDefines = addProgramDefines.addProgramDefines; exports.ensurePrecision = ensurePrecision.ensurePrecision; exports.insertVersion = insertVersion.insertVersion; exports.setProgramName = setProgramName.setProgramName; exports.stripVersion = stripVersion.stripVersion; exports.WGSL_TO_STD40_SIZE = createUboElementsSTD40.WGSL_TO_STD40_SIZE; exports.createUboElementsSTD40 = createUboElementsSTD40.createUboElementsSTD40; exports.createUboSyncFunctionSTD40 = createUboSyncSTD40.createUboSyncFunctionSTD40; exports.generateArraySyncSTD40 = generateArraySyncSTD40.generateArraySyncSTD40; exports.generateUniformsSync = generateUniformsSync.generateUniformsSync; exports.UNIFORM_TO_ARRAY_SETTERS = generateUniformsSyncTypes.UNIFORM_TO_ARRAY_SETTERS; exports.UNIFORM_TO_SINGLE_SETTERS = generateUniformsSyncTypes.UNIFORM_TO_SINGLE_SETTERS; exports.GlStateSystem = GlStateSystem.GlStateSystem; exports.mapWebGLBlendModesToPixi = mapWebGLBlendModesToPixi.mapWebGLBlendModesToPixi; exports.GL_FORMATS = _const$6.GL_FORMATS; exports.GL_TARGETS = _const$6.GL_TARGETS; exports.GL_TYPES = _const$6.GL_TYPES; exports.GL_WRAP_MODES = _const$6.GL_WRAP_MODES; exports.GlTexture = GlTexture.GlTexture; exports.GlTextureSystem = GlTextureSystem.GlTextureSystem; exports.glUploadBufferImageResource = glUploadBufferImageResource.glUploadBufferImageResource; exports.glUploadCompressedTextureResource = glUploadCompressedTextureResource.glUploadCompressedTextureResource; exports.glUploadImageResource = glUploadImageResource.glUploadImageResource; exports.glUploadVideoResource = glUploadVideoResource.glUploadVideoResource; exports.applyStyleParams = applyStyleParams.applyStyleParams; exports.getSupportedGlCompressedTextureFormats = getSupportedGlCompressedTextureFormats.getSupportedGlCompressedTextureFormats; exports.mapFormatToGlFormat = mapFormatToGlFormat.mapFormatToGlFormat; exports.mapFormatToGlInternalFormat = mapFormatToGlInternalFormat.mapFormatToGlInternalFormat; exports.mapFormatToGlType = mapFormatToGlType.mapFormatToGlType; exports.compareModeToGlCompare = pixiToGlMaps.compareModeToGlCompare; exports.mipmapScaleModeToGlFilter = pixiToGlMaps.mipmapScaleModeToGlFilter; exports.scaleModeToGlFilter = pixiToGlMaps.scaleModeToGlFilter; exports.wrapModeToGlAddress = pixiToGlMaps.wrapModeToGlAddress; exports.unpremultiplyAlpha = unpremultiplyAlpha.unpremultiplyAlpha; exports.WebGLRenderer = WebGLRenderer.WebGLRenderer; exports.BindGroupSystem = BindGroupSystem.BindGroupSystem; exports.GpuBufferSystem = GpuBufferSystem.GpuBufferSystem; exports.GpuReadBuffer = GpuReadBuffer.GpuReadBuffer; exports.UboBatch = UboBatch.UboBatch; exports.GpuColorMaskSystem = GpuColorMaskSystem.GpuColorMaskSystem; exports.GpuDeviceSystem = GpuDeviceSystem.GpuDeviceSystem; exports.GpuEncoderSystem = GpuEncoderSystem.GpuEncoderSystem; exports.GpuStencilSystem = GpuStencilSystem.GpuStencilSystem; exports.GpuUboSystem = GpuUboSystem.GpuUboSystem; exports.GpuUniformBatchPipe = GpuUniformBatchPipe.GpuUniformBatchPipe; exports.PipelineSystem = PipelineSystem.PipelineSystem; exports.calculateProjection = calculateProjection.calculateProjection; exports.GpuRenderTarget = GpuRenderTarget.GpuRenderTarget; exports.GpuRenderTargetAdaptor = GpuRenderTargetAdaptor.GpuRenderTargetAdaptor; exports.GpuRenderTargetSystem = GpuRenderTargetSystem.GpuRenderTargetSystem; exports.BindGroup = BindGroup.BindGroup; exports.GpuProgram = GpuProgram.GpuProgram; exports.GpuShaderSystem = GpuShaderSystem.GpuShaderSystem; exports.WGSL_ALIGN_SIZE_DATA = createUboElementsWGSL.WGSL_ALIGN_SIZE_DATA; exports.createUboElementsWGSL = createUboElementsWGSL.createUboElementsWGSL; exports.createUboSyncFunctionWGSL = createUboSyncFunctionWGSL.createUboSyncFunctionWGSL; exports.extractAttributesFromGpuProgram = extractAttributesFromGpuProgram.extractAttributesFromGpuProgram; exports.extractStructAndGroups = extractStructAndGroups.extractStructAndGroups; exports.generateArraySyncWGSL = generateArraySyncWGSL.generateArraySyncWGSL; exports.generateGpuLayoutGroups = generateGpuLayoutGroups.generateGpuLayoutGroups; exports.generateLayoutHash = generateLayoutHash.generateLayoutHash; exports.removeStructAndGroupDuplicates = removeStructAndGroupDuplicates.removeStructAndGroupDuplicates; exports.GpuBlendModesToPixi = GpuBlendModesToPixi.GpuBlendModesToPixi; exports.GpuStateSystem = GpuStateSystem.GpuStateSystem; exports.GpuStencilModesToPixi = GpuStencilModesToPixi.GpuStencilModesToPixi; exports.GpuTextureSystem = GpuTextureSystem.GpuTextureSystem; exports.gpuUploadBufferImageResource = gpuUploadBufferImageResource.gpuUploadBufferImageResource; exports.blockDataMap = gpuUploadCompressedTextureResource.blockDataMap; exports.gpuUploadCompressedTextureResource = gpuUploadCompressedTextureResource.gpuUploadCompressedTextureResource; exports.gpuUploadImageResource = gpuUploadImageSource.gpuUploadImageResource; exports.gpuUploadVideoResource = gpuUploadVideoSource.gpuUploadVideoResource; exports.getSupportedGPUCompressedTextureFormats = getSupportedGPUCompressedTextureFormats.getSupportedGPUCompressedTextureFormats; exports.GpuMipmapGenerator = GpuMipmapGenerator.GpuMipmapGenerator; exports.WebGPURenderer = WebGPURenderer.WebGPURenderer; exports.BackgroundSystem = BackgroundSystem.BackgroundSystem; exports.BlendModePipe = BlendModePipe.BlendModePipe; exports.Buffer = Buffer.Buffer; exports.BufferResource = BufferResource.BufferResource; exports.BufferUsage = _const$7.BufferUsage; exports.fastCopy = fastCopy.fastCopy; exports.ExtractSystem = ExtractSystem.ExtractSystem; exports.GenerateTextureSystem = GenerateTextureSystem.GenerateTextureSystem; exports.DRAW_MODES = _const$8.DRAW_MODES; exports.Geometry = Geometry.Geometry; exports.buildSimpleUvs = buildUvs.buildSimpleUvs; exports.buildUvs = buildUvs.buildUvs; exports.ensureIsBuffer = ensureIsBuffer.ensureIsBuffer; exports.getAttributeInfoFromFormat = getAttributeInfoFromFormat.getAttributeInfoFromFormat; exports.getGeometryBounds = getGeometryBounds.getGeometryBounds; exports.transformVertices = transformVertices.transformVertices; exports.InstructionSet = InstructionSet.InstructionSet; exports.GlobalUniformSystem = GlobalUniformSystem.GlobalUniformSystem; exports.isRenderingToScreen = isRenderingToScreen.isRenderingToScreen; exports.RenderTarget = RenderTarget.RenderTarget; exports.RenderTargetSystem = RenderTargetSystem.RenderTargetSystem; exports.viewportFromFrame = viewportFromFrame.viewportFromFrame; exports.SchedulerSystem = SchedulerSystem.SchedulerSystem; exports.ShaderStage = _const$9.ShaderStage; exports.Shader = Shader.Shader; exports.UNIFORM_TYPES_MAP = types.UNIFORM_TYPES_MAP; exports.UNIFORM_TYPES_VALUES = types.UNIFORM_TYPES_VALUES; exports.UboSystem = UboSystem.UboSystem; exports.UniformGroup = UniformGroup.UniformGroup; exports.createUboSyncFunction = createUboSyncFunction.createUboSyncFunction; exports.getDefaultUniformValue = getDefaultUniformValue.getDefaultUniformValue; exports.uboSyncFunctionsSTD40 = uboSyncFunctions.uboSyncFunctionsSTD40; exports.uboSyncFunctionsWGSL = uboSyncFunctions.uboSyncFunctionsWGSL; exports.uniformParsers = uniformParsers.uniformParsers; exports.HelloSystem = HelloSystem.HelloSystem; exports.BLEND_TO_NPM = _const$a.BLEND_TO_NPM; exports.STENCIL_MODES = _const$a.STENCIL_MODES; exports.getAdjustedBlendModeBlend = getAdjustedBlendModeBlend.getAdjustedBlendModeBlend; exports.State = State.State; exports.AbstractRenderer = AbstractRenderer.AbstractRenderer; exports.SharedRenderPipes = SharedSystems.SharedRenderPipes; exports.SharedSystems = SharedSystems.SharedSystems; exports.SystemRunner = SystemRunner.SystemRunner; exports.CanvasPool = CanvasPool.CanvasPool; exports.CanvasPoolClass = CanvasPool.CanvasPoolClass; exports.DEPRECATED_SCALE_MODES = _const$b.DEPRECATED_SCALE_MODES; exports.DEPRECATED_WRAP_MODES = _const$b.DEPRECATED_WRAP_MODES; exports.MSAA_QUALITY = _const$b.MSAA_QUALITY; exports.SCALE_MODES = _const$b.SCALE_MODES; exports.WRAP_MODES = _const$b.WRAP_MODES; exports.RenderableGCSystem = RenderableGCSystem.RenderableGCSystem; exports.RenderTexture = RenderTexture.RenderTexture; exports.BufferImageSource = BufferImageSource.BufferImageSource; exports.CanvasSource = CanvasSource.CanvasSource; exports.CompressedSource = CompressedSource.CompressedSource; exports.ImageSource = ImageSource.ImageSource; exports.TextureSource = TextureSource.TextureSource; exports.VideoSource = VideoSource.VideoSource; exports.Texture = Texture.Texture; exports.TextureGCSystem = TextureGCSystem.TextureGCSystem; exports.TextureMatrix = TextureMatrix.TextureMatrix; exports.TexturePool = TexturePool.TexturePool; exports.TexturePoolClass = TexturePool.TexturePoolClass; exports.TextureStyle = TextureStyle.TextureStyle; exports.TextureUvs = TextureUvs.TextureUvs; exports.generateUID = generateUID.generateUID; exports.getCanvasTexture = getCanvasTexture.getCanvasTexture; exports.hasCachedCanvasTexture = getCanvasTexture.hasCachedCanvasTexture; exports.getSupportedCompressedTextureFormats = getSupportedCompressedTextureFormats.getSupportedCompressedTextureFormats; exports.getSupportedTextureFormats = getSupportedTextureFormats.getSupportedTextureFormats; exports.nonCompressedFormats = getSupportedTextureFormats.nonCompressedFormats; exports.autoDetectSource = textureFrom.autoDetectSource; exports.resourceToTexture = textureFrom.resourceToTexture; exports.textureFrom = textureFrom.textureFrom; exports.createIdFromString = createIdFromString.createIdFromString; exports.parseFunctionBody = parseFunctionBody.parseFunctionBody; exports.ViewSystem = ViewSystem.ViewSystem; exports.RendererType = types$1.RendererType; exports.particlesFrag = particles["default"]; exports.particlesVert = particles$1["default"]; exports.particlesWgsl = particles$2["default"]; exports.Bounds = Bounds.Bounds; exports.getFastGlobalBounds = getFastGlobalBounds.getFastGlobalBounds; exports._getGlobalBounds = getGlobalBounds._getGlobalBounds; exports.getGlobalBounds = getGlobalBounds.getGlobalBounds; exports.updateTransformBackwards = getGlobalBounds.updateTransformBackwards; exports.getLocalBounds = getLocalBounds.getLocalBounds; exports.getParent = getLocalBounds.getParent; exports.getGlobalRenderableBounds = getRenderableBounds.getGlobalRenderableBounds; exports.boundsPool = matrixAndBoundsPool.boundsPool; exports.matrixPool = matrixAndBoundsPool.matrixPool; exports.cacheAsTextureMixin = cacheAsTextureMixin.cacheAsTextureMixin; exports.childrenHelperMixin = childrenHelperMixin.childrenHelperMixin; exports.collectRenderablesMixin = collectRenderablesMixin.collectRenderablesMixin; exports.effectsMixin = effectsMixin.effectsMixin; exports.findMixin = findMixin.findMixin; exports.getFastGlobalBoundsMixin = getFastGlobalBoundsMixin.getFastGlobalBoundsMixin; exports.bgr2rgb = getGlobalMixin.bgr2rgb; exports.getGlobalMixin = getGlobalMixin.getGlobalMixin; exports.measureMixin = measureMixin.measureMixin; exports.onRenderMixin = onRenderMixin.onRenderMixin; exports.sortMixin = sortMixin.sortMixin; exports.toLocalGlobalMixin = toLocalGlobalMixin.toLocalGlobalMixin; exports.Container = Container.Container; exports.UPDATE_BLEND = Container.UPDATE_BLEND; exports.UPDATE_COLOR = Container.UPDATE_COLOR; exports.UPDATE_TRANSFORM = Container.UPDATE_TRANSFORM; exports.UPDATE_VISIBLE = Container.UPDATE_VISIBLE; exports.CustomRenderPipe = CustomRenderPipe.CustomRenderPipe; exports.RenderContainer = RenderContainer.RenderContainer; exports.RenderGroup = RenderGroup.RenderGroup; exports.RenderGroupPipe = RenderGroupPipe.RenderGroupPipe; exports.RenderGroupSystem = RenderGroupSystem.RenderGroupSystem; exports.assignWithIgnore = assignWithIgnore.assignWithIgnore; exports.checkChildrenDidChange = checkChildrenDidChange.checkChildrenDidChange; exports.clearList = clearList.clearList; exports.collectAllRenderables = collectAllRenderables.collectAllRenderables; exports.definedProps = definedProps.definedProps; exports.executeInstructions = executeInstructions.executeInstructions; exports.mixHexColors = mixHexColors.mixHexColors; exports.multiplyColors = multiplyColors.multiplyColors; exports.multiplyHexColors = multiplyHexColors.multiplyHexColors; exports.updateLocalTransform = updateLocalTransform.updateLocalTransform; exports.updateRenderGroupTransform = updateRenderGroupTransforms.updateRenderGroupTransform; exports.updateRenderGroupTransforms = updateRenderGroupTransforms.updateRenderGroupTransforms; exports.updateTransformAndChildren = updateRenderGroupTransforms.updateTransformAndChildren; exports.updateWorldTransform = updateWorldTransform.updateWorldTransform; exports.validateRenderables = validateRenderables.validateRenderables; exports.GlGraphicsAdaptor = GlGraphicsAdaptor.GlGraphicsAdaptor; exports.color32BitToUniform = colorToUniform.color32BitToUniform; exports.colorToUniform = colorToUniform.colorToUniform; exports.GpuGraphicsAdaptor = GpuGraphicsAdaptor.GpuGraphicsAdaptor; exports.BatchableGraphics = BatchableGraphics.BatchableGraphics; exports.buildAdaptiveBezier = buildAdaptiveBezier.buildAdaptiveBezier; exports.buildAdaptiveQuadratic = buildAdaptiveQuadratic.buildAdaptiveQuadratic; exports.buildArc = buildArc.buildArc; exports.buildArcTo = buildArcTo.buildArcTo; exports.buildArcToSvg = buildArcToSvg.buildArcToSvg; exports.buildCircle = buildCircle.buildCircle; exports.buildEllipse = buildCircle.buildEllipse; exports.buildRoundedRectangle = buildCircle.buildRoundedRectangle; exports.buildLine = buildLine.buildLine; exports.buildPixelLine = buildPixelLine.buildPixelLine; exports.buildPolygon = buildPolygon.buildPolygon; exports.buildRectangle = buildRectangle.buildRectangle; exports.buildTriangle = buildTriangle.buildTriangle; exports.closePointEps = _const$c.closePointEps; exports.curveEps = _const$c.curveEps; exports.FillGradient = FillGradient.FillGradient; exports.FillPattern = FillPattern.FillPattern; exports.Graphics = Graphics.Graphics; exports.GraphicsContext = GraphicsContext.GraphicsContext; exports.GpuGraphicsContext = GraphicsContextSystem.GpuGraphicsContext; exports.GraphicsContextRenderData = GraphicsContextSystem.GraphicsContextRenderData; exports.GraphicsContextSystem = GraphicsContextSystem.GraphicsContextSystem; exports.GraphicsPipe = GraphicsPipe.GraphicsPipe; exports.GraphicsPath = GraphicsPath.GraphicsPath; exports.roundedShapeArc = roundShape.roundedShapeArc; exports.roundedShapeQuadraticCurve = roundShape.roundedShapeQuadraticCurve; exports.ShapePath = ShapePath.ShapePath; exports.parseSVGDefinitions = parseSVGDefinitions.parseSVGDefinitions; exports.parseSVGFloatAttribute = parseSVGFloatAttribute.parseSVGFloatAttribute; exports.parseSVGPath = parseSVGPath.parseSVGPath; exports.parseAttribute = parseSVGStyle.parseAttribute; exports.parseSVGStyle = parseSVGStyle.parseSVGStyle; exports.styleAttributes = parseSVGStyle.styleAttributes; exports.SVGParser = SVGParser.SVGParser; exports.extractSvgUrlId = extractSvgUrlId.extractSvgUrlId; exports.buildContextBatches = buildContextBatches.buildContextBatches; exports.shapeBuilders = buildContextBatches.shapeBuilders; exports.buildGeometryFromPath = buildGeometryFromPath.buildGeometryFromPath; exports.toFillStyle = convertFillInputToFillStyle.toFillStyle; exports.toStrokeStyle = convertFillInputToFillStyle.toStrokeStyle; exports.generateTextureMatrix = generateTextureFillMatrix.generateTextureMatrix; exports.getOrientationOfPoints = getOrientationOfPoints.getOrientationOfPoints; exports.triangulateWithHoles = triangulateWithHoles.triangulateWithHoles; exports.RenderLayer = RenderLayer.RenderLayer; exports.RenderLayerClass = RenderLayer.RenderLayerClass; exports.PerspectiveMesh = PerspectiveMesh.PerspectiveMesh; exports.PerspectivePlaneGeometry = PerspectivePlaneGeometry.PerspectivePlaneGeometry; exports.applyProjectiveTransformationToPlane = applyProjectiveTransformationToPlane.applyProjectiveTransformationToPlane; exports.compute2DProjection = compute2DProjections.compute2DProjection; exports.MeshPlane = MeshPlane.MeshPlane; exports.PlaneGeometry = PlaneGeometry.PlaneGeometry; exports.MeshRope = MeshRope.MeshRope; exports.MeshSimple = MeshSimple.MeshSimple; exports.RopeGeometry = RopeGeometry.RopeGeometry; exports.GlMeshAdaptor = GlMeshAdaptor.GlMeshAdaptor; exports.GpuMeshAdapter = GpuMeshAdapter.GpuMeshAdapter; exports.BatchableMesh = BatchableMesh.BatchableMesh; exports.getTextureDefaultMatrix = getTextureDefaultMatrix.getTextureDefaultMatrix; exports.Mesh = Mesh.Mesh; exports.MeshGeometry = MeshGeometry.MeshGeometry; exports.MeshPipe = MeshPipe.MeshPipe; exports.GlParticleContainerAdaptor = GlParticleContainerAdaptor.GlParticleContainerAdaptor; exports.GpuParticleContainerAdaptor = GpuParticleContainerAdaptor.GpuParticleContainerAdaptor; exports.GlParticleContainerPipe = GlParticleContainerPipe.GlParticleContainerPipe; exports.GpuParticleContainerPipe = GpuParticleContainerPipe.GpuParticleContainerPipe; exports.Particle = Particle.Particle; exports.ParticleBuffer = ParticleBuffer.ParticleBuffer; exports.ParticleContainer = ParticleContainer.ParticleContainer; exports.ParticleContainerPipe = ParticleContainerPipe.ParticleContainerPipe; exports.particleData = particleData.particleData; exports.ParticleShader = ParticleShader.ParticleShader; exports.createIndicesForQuads = createIndicesForQuads.createIndicesForQuads; exports.generateParticleUpdateFunction = generateParticleUpdateFunction.generateParticleUpdateFunction; exports.AnimatedSprite = AnimatedSprite.AnimatedSprite; exports.NineSliceGeometry = NineSliceGeometry.NineSliceGeometry; exports.NineSlicePlane = NineSliceSprite.NineSlicePlane; exports.NineSliceSprite = NineSliceSprite.NineSliceSprite; exports.NineSliceSpritePipe = NineSliceSpritePipe.NineSliceSpritePipe; exports.tilingBit = tilingBit.tilingBit; exports.tilingBitGl = tilingBit.tilingBitGl; exports.TilingSpriteShader = TilingSpriteShader.TilingSpriteShader; exports.TilingSprite = TilingSprite.TilingSprite; exports.TilingSpritePipe = TilingSpritePipe.TilingSpritePipe; exports.applyMatrix = applyMatrix.applyMatrix; exports.QuadGeometry = QuadGeometry.QuadGeometry; exports.setPositions = setPositions.setPositions; exports.setUvs = setUvs.setUvs; exports.BatchableSprite = BatchableSprite.BatchableSprite; exports.Sprite = Sprite.Sprite; exports.SpritePipe = SpritePipe.SpritePipe; exports.AbstractBitmapFont = AbstractBitmapFont.AbstractBitmapFont; exports.bitmapFontTextParser = bitmapFontTextParser.bitmapFontTextParser; exports.bitmapFontXMLParser = bitmapFontXMLParser.bitmapFontXMLParser; exports.bitmapFontXMLStringParser = bitmapFontXMLStringParser.bitmapFontXMLStringParser; exports.bitmapFontCachePlugin = loadBitmapFont.bitmapFontCachePlugin; exports.loadBitmapFont = loadBitmapFont.loadBitmapFont; exports.BitmapFont = BitmapFont.BitmapFont; exports.BitmapFontManager = BitmapFontManager.BitmapFontManager; exports.BitmapText = BitmapText.BitmapText; exports.BitmapTextPipe = BitmapTextPipe.BitmapTextPipe; exports.DynamicBitmapFont = DynamicBitmapFont.DynamicBitmapFont; exports.getBitmapTextLayout = getBitmapTextLayout.getBitmapTextLayout; exports.resolveCharacters = resolveCharacters.resolveCharacters; exports.HTMLText = HTMLText.HTMLText; exports.HTMLTextPipe = HTMLTextPipe.HTMLTextPipe; exports.HTMLTextRenderData = HTMLTextRenderData.HTMLTextRenderData; exports.nssvg = HTMLTextRenderData.nssvg; exports.nsxhtml = HTMLTextRenderData.nsxhtml; exports.HTMLTextStyle = HTMLTextStyle.HTMLTextStyle; exports.HTMLTextSystem = HTMLTextSystem.HTMLTextSystem; exports.extractFontFamilies = extractFontFamilies.extractFontFamilies; exports.FontStylePromiseCache = getFontCss.FontStylePromiseCache; exports.getFontCss = getFontCss.getFontCss; exports.getSVGUrl = getSVGUrl.getSVGUrl; exports.getTemporaryCanvasFromImage = getTemporaryCanvasFromImage.getTemporaryCanvasFromImage; exports.loadFontAsBase64 = loadFontAsBase64.loadFontAsBase64; exports.loadFontCSS = loadFontCSS.loadFontCSS; exports.loadSVGImage = loadSVGImage.loadSVGImage; exports.measureHtmlText = measureHtmlText.measureHtmlText; exports.textStyleToCSS = textStyleToCSS.textStyleToCSS; exports.AbstractText = AbstractText.AbstractText; exports.ensureTextOptions = AbstractText.ensureTextOptions; exports.CanvasTextMetrics = CanvasTextMetrics.CanvasTextMetrics; exports.CanvasTextPipe = CanvasTextPipe.CanvasTextPipe; exports.CanvasTextSystem = CanvasTextSystem.CanvasTextSystem; exports.fontStringFromTextStyle = fontStringFromTextStyle.fontStringFromTextStyle; exports.getCanvasFillStyle = getCanvasFillStyle.getCanvasFillStyle; exports.SdfShader = SdfShader.SdfShader; exports.localUniformMSDFBit = localUniformMSDFBit.localUniformMSDFBit; exports.localUniformMSDFBitGl = localUniformMSDFBit.localUniformMSDFBitGl; exports.mSDFBit = mSDFBit.mSDFBit; exports.mSDFBitGl = mSDFBit.mSDFBitGl; exports.Text = Text.Text; exports.TextStyle = TextStyle.TextStyle; exports.ensureTextStyle = ensureTextStyle.ensureTextStyle; exports.generateTextStyleKey = generateTextStyleKey.generateTextStyleKey; exports.getPo2TextureFromSource = getPo2TextureFromSource.getPo2TextureFromSource; exports.updateTextBounds = updateTextBounds.updateTextBounds; exports.ViewContainer = ViewContainer.ViewContainer; exports.Spritesheet = Spritesheet.Spritesheet; exports.spritesheetAsset = spritesheetAsset.spritesheetAsset; exports.UPDATE_PRIORITY = _const$d.UPDATE_PRIORITY; exports.Ticker = Ticker.Ticker; exports.TickerListener = TickerListener.TickerListener; exports.detectVideoAlphaMode = detectVideoAlphaMode.detectVideoAlphaMode; exports.isMobile = isMobile.isMobile; exports.isSafari = isSafari.isSafari; exports.isWebGLSupported = isWebGLSupported.isWebGLSupported; exports.isWebGPUSupported = isWebGPUSupported.isWebGPUSupported; exports.unsafeEvalSupported = unsafeEvalSupported.unsafeEvalSupported; exports.getCanvasBoundingBox = getCanvasBoundingBox.getCanvasBoundingBox; exports.DATA_URI = _const$e.DATA_URI; exports.VERSION = _const$e.VERSION; exports.EventEmitter = EventEmitter; exports.cleanArray = clean.cleanArray; exports.cleanHash = clean.cleanHash; exports.removeItems = removeItems.removeItems; exports.resetUids = uid.resetUids; exports.uid = uid.uid; exports.updateQuadBounds = updateQuadBounds.updateQuadBounds; exports.ViewableBuffer = ViewableBuffer.ViewableBuffer; exports.ApplicationInitHook = globalHooks.ApplicationInitHook; exports.RendererInitHook = globalHooks.RendererInitHook; exports.deprecation = deprecation.deprecation; exports.v8_0_0 = deprecation.v8_0_0; exports.v8_3_4 = deprecation.v8_3_4; exports.logDebugTexture = logDebugTexture.logDebugTexture; exports.logRenderGroupScene = logScene.logRenderGroupScene; exports.logScene = logScene.logScene; exports.warn = warn.warn; exports.NOOP = NOOP.NOOP; exports.Transform = Transform.Transform; exports.getResolutionOfUrl = getResolutionOfUrl.getResolutionOfUrl; exports.path = path.path; exports.Pool = Pool.Pool; exports.BigPool = PoolGroup.BigPool; exports.PoolGroupClass = PoolGroup.PoolGroupClass; exports.sayHello = sayHello.sayHello; exports.earcut = earcut; /***/ }), /***/ 3851: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var compileHighShaderToProgram = __webpack_require__(97754); var localUniformBit = __webpack_require__(21654); var roundPixelsBit = __webpack_require__(35268); var textureBit = __webpack_require__(37874); var Shader = __webpack_require__(27866); var Texture = __webpack_require__(73782); var warn = __webpack_require__(57371); "use strict"; var GpuMeshAdapter = /*#__PURE__*/function () { function GpuMeshAdapter() { _classCallCheck(this, GpuMeshAdapter); } return _createClass(GpuMeshAdapter, [{ key: "init", value: function init() { var gpuProgram = compileHighShaderToProgram.compileHighShaderGpuProgram({ name: "mesh", bits: [localUniformBit.localUniformBit, textureBit.textureBit, roundPixelsBit.roundPixelsBit] }); this._shader = new Shader.Shader({ gpuProgram: gpuProgram, resources: { uTexture: Texture.Texture.EMPTY._source, uSampler: Texture.Texture.EMPTY._source.style, textureUniforms: { uTextureMatrix: { type: "mat3x3<f32>", value: new Matrix.Matrix() } } } }); } }, { key: "execute", value: function execute(meshPipe, mesh) { var renderer = meshPipe.renderer; var shader = mesh._shader; if (!shader) { shader = this._shader; shader.groups[2] = renderer.texture.getTextureBindGroup(mesh.texture); } else if (!shader.gpuProgram) { warn.warn("Mesh shader has no gpuProgram", mesh.shader); return; } var gpuProgram = shader.gpuProgram; if (gpuProgram.autoAssignGlobalUniforms) { shader.groups[0] = renderer.globalUniforms.bindGroup; } if (gpuProgram.autoAssignLocalUniforms) { var localUniforms = meshPipe.localUniforms; shader.groups[1] = renderer.renderPipes.uniformBatch.getUniformBindGroup(localUniforms, true); } renderer.encoder.draw({ geometry: mesh._geometry, shader: shader, state: mesh.state }); } }, { key: "destroy", value: function destroy() { this._shader.destroy(true); this._shader = null; } }]); }(); /** @ignore */ GpuMeshAdapter.extension = { type: [Extensions.ExtensionType.WebGPUPipesAdaptor], name: "mesh" }; exports.GpuMeshAdapter = GpuMeshAdapter; /***/ }), /***/ 3903: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 4018: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var ExclusionBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function ExclusionBlend() { _classCallCheck(this, ExclusionBlend); return _callSuper(this, ExclusionBlend, [{ gl: { functions: "\n vec3 exclusion(vec3 base, vec3 blend)\n {\n return base + blend - 2.0 * base * blend;\n }\n\n vec3 blendExclusion(vec3 base, vec3 blend, float opacity)\n {\n return (exclusion(base, blend) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendExclusion(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn exclusion(base: vec3<f32>, blend: vec3<f32>) -> vec3<f32>\n {\n return base+blend-2.0*base*blend;\n }\n\n fn blendExclusion(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>\n {\n return (exclusion(base, blend) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendExclusion(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(ExclusionBlend, _BlendModeFilter$Blen); return _createClass(ExclusionBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ ExclusionBlend.extension = { name: "exclusion", type: Extensions.ExtensionType.BlendMode }; exports.ExclusionBlend = ExclusionBlend; /***/ }), /***/ 4026: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var CanvasPool = __webpack_require__(88699); "use strict"; function getTemporaryCanvasFromImage(image, resolution) { var canvasAndContext = CanvasPool.CanvasPool.getOptimalCanvasAndContext(image.width, image.height, resolution); var context = canvasAndContext.context; context.clearRect(0, 0, image.width, image.height); context.drawImage(image, 0, 0); return canvasAndContext; } exports.getTemporaryCanvasFromImage = getTemporaryCanvasFromImage; /***/ }), /***/ 4089: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var ColorBlend = __webpack_require__(66983); var ColorBurnBlend = __webpack_require__(39992); var ColorDodgeBlend = __webpack_require__(3232); var DarkenBlend = __webpack_require__(47447); var DifferenceBlend = __webpack_require__(5347); var DivideBlend = __webpack_require__(93169); var ExclusionBlend = __webpack_require__(4018); var HardLightBlend = __webpack_require__(57743); var HardMixBlend = __webpack_require__(84853); var LightenBlend = __webpack_require__(80423); var LinearBurnBlend = __webpack_require__(18322); var LinearDodgeBlend = __webpack_require__(35298); var LinearLightBlend = __webpack_require__(60215); var LuminosityBlend = __webpack_require__(43905); var NegationBlend = __webpack_require__(48811); var OverlayBlend = __webpack_require__(24074); var PinLightBlend = __webpack_require__(18229); var SaturationBlend = __webpack_require__(80690); var SoftLightBlend = __webpack_require__(90882); var SubtractBlend = __webpack_require__(20622); var VividLightBlend = __webpack_require__(14394); "use strict"; exports.ColorBlend = ColorBlend.ColorBlend; exports.ColorBurnBlend = ColorBurnBlend.ColorBurnBlend; exports.ColorDodgeBlend = ColorDodgeBlend.ColorDodgeBlend; exports.DarkenBlend = DarkenBlend.DarkenBlend; exports.DifferenceBlend = DifferenceBlend.DifferenceBlend; exports.DivideBlend = DivideBlend.DivideBlend; exports.ExclusionBlend = ExclusionBlend.ExclusionBlend; exports.HardLightBlend = HardLightBlend.HardLightBlend; exports.HardMixBlend = HardMixBlend.HardMixBlend; exports.LightenBlend = LightenBlend.LightenBlend; exports.LinearBurnBlend = LinearBurnBlend.LinearBurnBlend; exports.LinearDodgeBlend = LinearDodgeBlend.LinearDodgeBlend; exports.LinearLightBlend = LinearLightBlend.LinearLightBlend; exports.LuminosityBlend = LuminosityBlend.LuminosityBlend; exports.NegationBlend = NegationBlend.NegationBlend; exports.OverlayBlend = OverlayBlend.OverlayBlend; exports.PinLightBlend = PinLightBlend.PinLightBlend; exports.SaturationBlend = SaturationBlend.SaturationBlend; exports.SoftLightBlend = SoftLightBlend.SoftLightBlend; exports.SubtractBlend = SubtractBlend.SubtractBlend; exports.VividLightBlend = VividLightBlend.VividLightBlend; /***/ }), /***/ 4230: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["dynamicProperties", "shader", "roundPixels", "texture", "particles"]; function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Bounds = __webpack_require__(76631); var ViewContainer = __webpack_require__(23804); var particleData = __webpack_require__(27265); "use strict"; var emptyBounds = new Bounds.Bounds(0, 0, 0, 0); var _ParticleContainer = /*#__PURE__*/function (_ViewContainer$ViewCo) { /** * @param options - The options for creating the sprite. */ function _ParticleContainer() { var _options; var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _ParticleContainer); options = _objectSpread(_objectSpread(_objectSpread({}, _ParticleContainer.defaultOptions), options), {}, { dynamicProperties: _objectSpread(_objectSpread({}, _ParticleContainer.defaultOptions.dynamicProperties), (_options = options) === null || _options === void 0 ? void 0 : _options.dynamicProperties) }); var _options2 = options, dynamicProperties = _options2.dynamicProperties, shader = _options2.shader, roundPixels = _options2.roundPixels, texture = _options2.texture, particles = _options2.particles, rest = _objectWithoutProperties(_options2, _excluded); _this = _callSuper(this, _ParticleContainer, [_objectSpread({ label: "ParticleContainer" }, rest)]); /** The unique identifier for the render pipe of this ParticleContainer. */ _this.renderPipeId = "particle"; _this.batched = false; /** Indicates if the children of this ParticleContainer have changed and need to be updated. */ _this._childrenDirty = false; _this.texture = texture || null; _this.shader = shader; _this._properties = {}; for (var key in particleData.particleData) { var property = particleData.particleData[key]; var dynamic = dynamicProperties[key]; _this._properties[key] = _objectSpread(_objectSpread({}, property), {}, { dynamic: dynamic }); } _this.allowChildren = true; _this.roundPixels = roundPixels !== null && roundPixels !== void 0 ? roundPixels : false; _this.particleChildren = particles !== null && particles !== void 0 ? particles : []; return _this; } /** * Adds one or more particles to the container. * * Multiple items can be added like so: `myContainer.addParticle(thingOne, thingTwo, thingThree)` * @param {...IParticle} children - The Particle(s) to add to the container * @returns {IParticle} - The first child that was added. */ _inherits(_ParticleContainer, _ViewContainer$ViewCo); return _createClass(_ParticleContainer, [{ key: "addParticle", value: function addParticle() { for (var i = 0; i < arguments.length; i++) { this.particleChildren.push(i < 0 || arguments.length <= i ? undefined : arguments[i]); } this.onViewUpdate(); return arguments.length <= 0 ? undefined : arguments[0]; } /** * Removes one or more particles from the container. * @param {...IParticle} children - The Particle(s) to remove * @returns {IParticle} The first child that was removed. */ }, { key: "removeParticle", value: function removeParticle() { var didRemove = false; for (var i = 0; i < arguments.length; i++) { var index = this.particleChildren.indexOf(i < 0 || arguments.length <= i ? undefined : arguments[i]); if (index > -1) { this.particleChildren.splice(index, 1); didRemove = true; } } if (didRemove) this.onViewUpdate(); return arguments.length <= 0 ? undefined : arguments[0]; } /** * Updates the particle container. * Please call this when you modify the particleChildren array. * or any static properties of the particles. */ }, { key: "update", value: function update() { this._childrenDirty = true; } }, { key: "onViewUpdate", value: function onViewUpdate() { this._childrenDirty = true; _superPropGet(_ParticleContainer, "onViewUpdate", this, 3)([]); } /** * ParticleContainer does not calculated bounds as it would slow things down, * its up to you to set this via the boundsArea property */ }, { key: "bounds", get: function get() { return emptyBounds; } /** @private */ }, { key: "updateBounds", value: function updateBounds() {} /** * Destroys this sprite renderable and optionally its texture. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the current texture of the renderable as well * @param {boolean} [options.textureSource=false] - Should it destroy the textureSource of the renderable as well */ }, { key: "destroy", value: function destroy() { var _this$shader; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; _superPropGet(_ParticleContainer, "destroy", this, 3)([options]); var destroyTexture = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.texture; if (destroyTexture) { var _this$texture, _this$particleChildre; var destroyTextureSource = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.textureSource; var texture = (_this$texture = this.texture) !== null && _this$texture !== void 0 ? _this$texture : (_this$particleChildre = this.particleChildren[0]) === null || _this$particleChildre === void 0 ? void 0 : _this$particleChildre.texture; if (texture) { texture.destroy(destroyTextureSource); } } this.texture = null; (_this$shader = this.shader) === null || _this$shader === void 0 || _this$shader.destroy(); } /** * Removes all particles from this container that are within the begin and end indexes. * @param beginIndex - The beginning position. * @param endIndex - The ending position. Default value is size of the container. * @returns - List of removed particles */ }, { key: "removeParticles", value: function removeParticles(beginIndex, endIndex) { var children = this.particleChildren.splice(beginIndex, endIndex); this.onViewUpdate(); return children; } /** * Removes a particle from the specified index position. * @param index - The index to get the particle from * @returns The particle that was removed. */ }, { key: "removeParticleAt", value: function removeParticleAt(index) { var child = this.particleChildren.splice(index, 1); this.onViewUpdate(); return child[0]; } /** * Adds a particle to the container at a specified index. If the index is out of bounds an error will be thrown. * If the particle is already in this container, it will be moved to the specified index. * @param {Container} child - The particle to add. * @param {number} index - The absolute index where the particle will be positioned at the end of the operation. * @returns {Container} The particle that was added. */ }, { key: "addParticleAt", value: function addParticleAt(child, index) { this.particleChildren.splice(index, 0, child); this.onViewUpdate(); return child; } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. Please use `ParticleContainer.addParticle()` instead. * @param {...any} _children * @throws {Error} Always throws an error as this method is not available. */ }, { key: "addChild", value: function addChild() { throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()"); } /** * This method is not available in ParticleContainer. * Calling this method will throw an error. Please use `ParticleContainer.removeParticle()` instead. * @param {...any} _children * @throws {Error} Always throws an error as this method is not available. */ }, { key: "removeChild", value: function removeChild() { throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. Please use `ParticleContainer.removeParticles()` instead. * @param {number} [_beginIndex] * @param {number} [_endIndex] * @throws {Error} Always throws an error as this method is not available. */ }, { key: "removeChildren", value: function removeChildren(_beginIndex, _endIndex) { throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. Please use `ParticleContainer.removeParticleAt()` instead. * @param {number} _index * @throws {Error} Always throws an error as this method is not available. */ }, { key: "removeChildAt", value: function removeChildAt(_index) { throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. Please use `ParticleContainer.getParticleAt()` instead. * @param {number} _index * @throws {Error} Always throws an error as this method is not available. */ }, { key: "getChildAt", value: function getChildAt(_index) { throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. Please use `ParticleContainer.setParticleIndex()` instead. * @param {ContainerChild} _child * @param {number} _index * @throws {Error} Always throws an error as this method is not available. */ }, { key: "setChildIndex", value: function setChildIndex(_child, _index) { throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. Please use `ParticleContainer.getParticleIndex()` instead. * @param {ContainerChild} _child * @throws {Error} Always throws an error as this method is not available. */ }, { key: "getChildIndex", value: function getChildIndex(_child) { throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. Please use `ParticleContainer.addParticleAt()` instead. * @param {ContainerChild} _child * @param {number} _index * @throws {Error} Always throws an error as this method is not available. */ }, { key: "addChildAt", value: function addChildAt(_child, _index) { throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. Please use `ParticleContainer.swapParticles()` instead. * @param {ContainerChild} _child * @param {ContainerChild} _child2 */ }, { key: "swapChildren", value: function swapChildren(_child, _child2) { throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. * @param _child - The child to reparent * @throws {Error} Always throws an error as this method is not available. */ }, { key: "reparentChild", value: function reparentChild() { throw new Error("ParticleContainer.reparentChild() is not available with the particle container"); } /** * This method is not available in ParticleContainer. * * Calling this method will throw an error. * @param _child - The child to reparent * @param _index - The index to reparent the child to * @throws {Error} Always throws an error as this method is not available. */ }, { key: "reparentChildAt", value: function reparentChildAt(_child, _index) { throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container"); } }]); }(ViewContainer.ViewContainer); /** * Defines the default options for creating a ParticleContainer. * @property {Record<string, boolean>} dynamicProperties - Specifies which properties are dynamic. * @property {boolean} roundPixels - Indicates if pixels should be rounded. */ _ParticleContainer.defaultOptions = { dynamicProperties: { vertex: false, // Indicates if vertex positions are dynamic. position: true, // Indicates if particle positions are dynamic. rotation: false, // Indicates if particle rotations are dynamic. uvs: false, // Indicates if UV coordinates are dynamic. color: false // Indicates if particle colors are dynamic. }, roundPixels: false // Indicates if pixels should be rounded for rendering. }; var ParticleContainer = _ParticleContainer; exports.ParticleContainer = ParticleContainer; /***/ }), /***/ 4386: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var UNIFORM_TYPES_VALUES = ["f32", "i32", "vec2<f32>", "vec3<f32>", "vec4<f32>", "mat2x2<f32>", "mat3x3<f32>", "mat4x4<f32>", "mat3x2<f32>", "mat4x2<f32>", "mat2x3<f32>", "mat4x3<f32>", "mat2x4<f32>", "mat3x4<f32>", "vec2<i32>", "vec3<i32>", "vec4<i32>"]; var UNIFORM_TYPES_MAP = UNIFORM_TYPES_VALUES.reduce(function (acc, type) { acc[type] = true; return acc; }, {}); exports.UNIFORM_TYPES_MAP = UNIFORM_TYPES_MAP; exports.UNIFORM_TYPES_VALUES = UNIFORM_TYPES_VALUES; /***/ }), /***/ 4411: /***/ ((module) => { "use strict"; /** * When source maps are enabled, `style-loader` uses a link element with a data-uri to * embed the css on the page. This breaks all relative urls because now they are relative to a * bundle instead of the current page. * * One solution is to only use full urls, but that may be impossible. * * Instead, this function "fixes" the relative urls to be absolute according to the current page location. * * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command. * */ module.exports = function (css) { // get current location var location = typeof window !== "undefined" && window.location; if (!location) { throw new Error("fixUrls requires window.location"); } // blank or null? if (!css || typeof css !== "string") { return css; } var baseUrl = location.protocol + "//" + location.host; var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/"); // convert each url(...) /* This regular expression is just a way to recursively match brackets within a string. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens ( = Start a capturing group (?: = Start a non-capturing group [^)(] = Match anything that isn't a parentheses | = OR \( = Match a start parentheses (?: = Start another non-capturing groups [^)(]+ = Match anything that isn't a parentheses | = OR \( = Match a start parentheses [^)(]* = Match anything that isn't a parentheses \) = Match a end parentheses ) = End Group *\) = Match anything and then a close parens ) = Close non-capturing group * = Match anything ) = Close capturing group \) = Match a close parens /gi = Get all matches, not the first. Be case insensitive. */ var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function (fullMatch, origUrl) { // strip quotes (if they exist) var unquotedOrigUrl = origUrl.trim().replace(/^"(.*)"$/, function (o, $1) { return $1; }).replace(/^'(.*)'$/, function (o, $1) { return $1; }); // already a full url? no change if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) { return fullMatch; } // convert the url to a full url var newUrl; if (unquotedOrigUrl.indexOf("//") === 0) { //TODO: should we add protocol? newUrl = unquotedOrigUrl; } else if (unquotedOrigUrl.indexOf("/") === 0) { // path should be relative to the base url newUrl = baseUrl + unquotedOrigUrl; // already starts with '/' } else { // path should be relative to current directory newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './' } // send back the fixed url(...) return "url(" + JSON.stringify(newUrl) + ")"; }); // send back the fixed css return fixedCss; }; /***/ }), /***/ 4480: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var checkImageBitmap_worker = __webpack_require__(81430); var loadImageBitmap_worker = __webpack_require__(35564); "use strict"; var UUID = 0; var MAX_WORKERS; var WorkerManagerClass = /*#__PURE__*/function () { function WorkerManagerClass() { _classCallCheck(this, WorkerManagerClass); this._initialized = false; this._createdWorkers = 0; this._workerPool = []; this._queue = []; this._resolveHash = {}; } return _createClass(WorkerManagerClass, [{ key: "isImageBitmapSupported", value: function isImageBitmapSupported() { if (this._isImageBitmapSupported !== void 0) return this._isImageBitmapSupported; this._isImageBitmapSupported = new Promise(function (resolve) { var _checkImageBitmap_wor = new checkImageBitmap_worker["default"](), worker = _checkImageBitmap_wor.worker; worker.addEventListener("message", function (event) { worker.terminate(); checkImageBitmap_worker["default"].revokeObjectURL(); resolve(event.data); }); }); return this._isImageBitmapSupported; } }, { key: "loadImageBitmap", value: function loadImageBitmap(src, asset) { var _asset$data; return this._run("loadImageBitmap", [src, asset === null || asset === void 0 || (_asset$data = asset.data) === null || _asset$data === void 0 ? void 0 : _asset$data.alphaMode]); } }, { key: "_initWorkers", value: function () { var _initWorkers2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!this._initialized) { _context.n = 1; break; } return _context.a(2); case 1: this._initialized = true; case 2: return _context.a(2); } }, _callee, this); })); function _initWorkers() { return _initWorkers2.apply(this, arguments); } return _initWorkers; }() }, { key: "_getWorker", value: function _getWorker() { var _this = this; if (MAX_WORKERS === void 0) { MAX_WORKERS = navigator.hardwareConcurrency || 4; } var worker = this._workerPool.pop(); if (!worker && this._createdWorkers < MAX_WORKERS) { this._createdWorkers++; worker = new loadImageBitmap_worker["default"]().worker; worker.addEventListener("message", function (event) { _this._complete(event.data); _this._returnWorker(event.target); _this._next(); }); } return worker; } }, { key: "_returnWorker", value: function _returnWorker(worker) { this._workerPool.push(worker); } }, { key: "_complete", value: function _complete(data) { if (data.error !== void 0) { this._resolveHash[data.uuid].reject(data.error); } else { this._resolveHash[data.uuid].resolve(data.data); } this._resolveHash[data.uuid] = null; } }, { key: "_run", value: function () { var _run2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(id, args) { var _this2 = this; var promise; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: _context2.n = 1; return this._initWorkers(); case 1: promise = new Promise(function (resolve, reject) { _this2._queue.push({ id: id, arguments: args, resolve: resolve, reject: reject }); }); this._next(); return _context2.a(2, promise); } }, _callee2, this); })); function _run(_x, _x2) { return _run2.apply(this, arguments); } return _run; }() }, { key: "_next", value: function _next() { if (!this._queue.length) return; var worker = this._getWorker(); if (!worker) { return; } var toDo = this._queue.pop(); var id = toDo.id; this._resolveHash[UUID] = { resolve: toDo.resolve, reject: toDo.reject }; worker.postMessage({ data: toDo.arguments, uuid: UUID++, id: id }); } }]); }(); var WorkerManager = new WorkerManagerClass(); exports.WorkerManager = WorkerManager; /***/ }), /***/ 4794: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(15068); "use strict"; function getAdjustedBlendModeBlend(blendMode, textureSource) { if (textureSource.alphaMode === "no-premultiply-alpha") { return _const.BLEND_TO_NPM[blendMode] || blendMode; } return blendMode; } exports.getAdjustedBlendModeBlend = getAdjustedBlendModeBlend; /***/ }), /***/ 4833: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 5040: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function checkChildrenDidChange(container, previousData) { var children = container.children; for (var i = 0; i < children.length; i++) { var child = children[i]; var uid = child.uid; var didChange = (child._didViewChangeTick & 65535) << 16 | child._didContainerChangeTick & 65535; var index = previousData.index; if (previousData.data[index] !== uid || previousData.data[index + 1] !== didChange) { previousData.data[previousData.index] = uid; previousData.data[previousData.index + 1] = didChange; previousData.didChange = true; } previousData.index = index + 2; if (child.children.length) { checkChildrenDidChange(child, previousData); } } return previousData.didChange; } exports.checkChildrenDidChange = checkChildrenDidChange; /***/ }), /***/ 5070: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Color = __webpack_require__(98828); "use strict"; var valuesToIterateForKeys = ["align", "breakWords", "cssOverrides", "fontVariant", "fontWeight", "leading", "letterSpacing", "lineHeight", "padding", "textBaseline", "trim", "whiteSpace", "wordWrap", "wordWrapWidth", "fontFamily", "fontStyle", "fontSize"]; function generateTextStyleKey(style) { var key = []; var index = 0; for (var i = 0; i < valuesToIterateForKeys.length; i++) { var prop = "_".concat(valuesToIterateForKeys[i]); key[index++] = style[prop]; } index = addFillStyleKey(style._fill, key, index); index = addStokeStyleKey(style._stroke, key, index); index = addDropShadowKey(style.dropShadow, key, index); return key.join("-"); } function addFillStyleKey(fillStyle, key, index) { var _fillStyle$fill; if (!fillStyle) return index; key[index++] = fillStyle.color; key[index++] = fillStyle.alpha; key[index++] = (_fillStyle$fill = fillStyle.fill) === null || _fillStyle$fill === void 0 ? void 0 : _fillStyle$fill.styleKey; return index; } function addStokeStyleKey(strokeStyle, key, index) { if (!strokeStyle) return index; index = addFillStyleKey(strokeStyle, key, index); key[index++] = strokeStyle.width; key[index++] = strokeStyle.alignment; key[index++] = strokeStyle.cap; key[index++] = strokeStyle.join; key[index++] = strokeStyle.miterLimit; return index; } function addDropShadowKey(dropShadow, key, index) { if (!dropShadow) return index; key[index++] = dropShadow.alpha; key[index++] = dropShadow.angle; key[index++] = dropShadow.blur; key[index++] = dropShadow.distance; key[index++] = Color.Color.shared.setValue(dropShadow.color).toNumber(); return index; } exports.generateTextStyleKey = generateTextStyleKey; /***/ }), /***/ 5144: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var vertex = "in vec2 aPosition;\nout vec2 vTextureCoord;\nout vec2 vFilterUv;\n\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nuniform mat3 uFilterMatrix;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvec2 getFilterCoord( void )\n{\n return ( uFilterMatrix * vec3( filterTextureCoord(), 1.0) ).xy;\n}\n\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n vFilterUv = getFilterCoord();\n}\n"; exports["default"] = vertex; /***/ }), /***/ 5229: /***/ ((__unused_webpack_module, exports) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } Object.defineProperty(exports, "__esModule", ({ value: true })); var WORKER_CODE = "(function () {\n 'use strict';\n\n const converters = {\n rgb8unorm: {\n convertedFormat: \"rgba8unorm\",\n convertFunction: convertRGBtoRGBA\n },\n \"rgb8unorm-srgb\": {\n convertedFormat: \"rgba8unorm-srgb\",\n convertFunction: convertRGBtoRGBA\n }\n };\n function convertFormatIfRequired(textureOptions) {\n const format = textureOptions.format;\n if (converters[format]) {\n const convertFunction = converters[format].convertFunction;\n const levelBuffers = textureOptions.resource;\n for (let i = 0; i < levelBuffers.length; i++) {\n levelBuffers[i] = convertFunction(levelBuffers[i]);\n }\n textureOptions.format = converters[format].convertedFormat;\n }\n }\n function convertRGBtoRGBA(levelBuffer) {\n const pixelCount = levelBuffer.byteLength / 3;\n const levelBufferWithAlpha = new Uint32Array(pixelCount);\n for (let i = 0; i < pixelCount; ++i) {\n levelBufferWithAlpha[i] = levelBuffer[i * 3] + (levelBuffer[i * 3 + 1] << 8) + (levelBuffer[i * 3 + 2] << 16) + 4278190080;\n }\n return new Uint8Array(levelBufferWithAlpha.buffer);\n }\n\n function createLevelBuffersFromKTX(ktxTexture) {\n const levelBuffers = [];\n for (let i = 0; i < ktxTexture.numLevels; i++) {\n const imageData = ktxTexture.getImageData(i, 0, 0);\n const levelBuffer = new Uint8Array(imageData.byteLength);\n levelBuffer.set(imageData);\n levelBuffers.push(levelBuffer);\n }\n return levelBuffers;\n }\n\n const glFormatToGPUFormatMap = {\n 6408: \"rgba8unorm\",\n 32856: \"bgra8unorm\",\n //\n 32857: \"rgb10a2unorm\",\n 33189: \"depth16unorm\",\n 33190: \"depth24plus\",\n 33321: \"r8unorm\",\n 33323: \"rg8unorm\",\n 33325: \"r16float\",\n 33326: \"r32float\",\n 33327: \"rg16float\",\n 33328: \"rg32float\",\n 33329: \"r8sint\",\n 33330: \"r8uint\",\n 33331: \"r16sint\",\n 33332: \"r16uint\",\n 33333: \"r32sint\",\n 33334: \"r32uint\",\n 33335: \"rg8sint\",\n 33336: \"rg8uint\",\n 33337: \"rg16sint\",\n 33338: \"rg16uint\",\n 33339: \"rg32sint\",\n 33340: \"rg32uint\",\n 33778: \"bc2-rgba-unorm\",\n 33779: \"bc3-rgba-unorm\",\n 34836: \"rgba32float\",\n 34842: \"rgba16float\",\n 35056: \"depth24plus-stencil8\",\n 35898: \"rg11b10ufloat\",\n 35901: \"rgb9e5ufloat\",\n 35907: \"rgba8unorm-srgb\",\n // bgra8unorm-srgb\n 36012: \"depth32float\",\n 36013: \"depth32float-stencil8\",\n 36168: \"stencil8\",\n 36208: \"rgba32uint\",\n 36214: \"rgba16uint\",\n 36220: \"rgba8uint\",\n 36226: \"rgba32sint\",\n 36232: \"rgba16sint\",\n 36238: \"rgba8sint\",\n 36492: \"bc7-rgba-unorm\",\n 36756: \"r8snorm\",\n 36757: \"rg8snorm\",\n 36759: \"rgba8snorm\",\n 37496: \"etc2-rgba8unorm\",\n 37808: \"astc-4x4-unorm\"\n };\n function glFormatToGPUFormat(glInternalFormat) {\n const format = glFormatToGPUFormatMap[glInternalFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported glInternalFormat: ${glInternalFormat}`);\n }\n\n const vkFormatToGPUFormatMap = {\n 23: \"rgb8unorm\",\n // VK_FORMAT_R8G8B8_UNORM\n 37: \"rgba8unorm\",\n // VK_FORMAT_R8G8B8A8_UNORM\n 43: \"rgba8unorm-srgb\"\n // VK_FORMAT_R8G8B8A8_SRGB\n // TODO add more!\n };\n function vkFormatToGPUFormat(vkFormat) {\n const format = vkFormatToGPUFormatMap[vkFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported VkFormat: ${vkFormat}`);\n }\n\n function getTextureFormatFromKTXTexture(ktxTexture) {\n if (ktxTexture.classId === 2) {\n return vkFormatToGPUFormat(ktxTexture.vkFormat);\n }\n return glFormatToGPUFormat(ktxTexture.glInternalformat);\n }\n\n const gpuFormatToBasisTranscoderFormatMap = {\n \"bc3-rgba-unorm\": \"BC3_RGBA\",\n \"bc7-rgba-unorm\": \"BC7_M5_RGBA\",\n \"etc2-rgba8unorm\": \"ETC2_RGBA\",\n \"astc-4x4-unorm\": \"ASTC_4x4_RGBA\",\n // Uncompressed\n rgba8unorm: \"RGBA32\",\n rg11b10ufloat: \"R11F_G11F_B10F\"\n };\n function gpuFormatToKTXBasisTranscoderFormat(transcoderFormat) {\n const format = gpuFormatToBasisTranscoderFormatMap[transcoderFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported transcoderFormat: ${transcoderFormat}`);\n }\n\n const settings = {\n jsUrl: \"\",\n wasmUrl: \"\"\n };\n let basisTranscoderFormat;\n let basisTranscodedTextureFormat;\n let ktxPromise;\n async function getKTX() {\n if (!ktxPromise) {\n const absoluteJsUrl = new URL(settings.jsUrl, location.origin).href;\n const absoluteWasmUrl = new URL(settings.wasmUrl, location.origin).href;\n importScripts(absoluteJsUrl);\n ktxPromise = new Promise((resolve) => {\n LIBKTX({\n locateFile: (_file) => absoluteWasmUrl\n }).then((libktx) => {\n resolve(libktx);\n });\n });\n }\n return ktxPromise;\n }\n async function fetchKTXTexture(url, ktx) {\n const ktx2Response = await fetch(url);\n if (ktx2Response.ok) {\n const ktx2ArrayBuffer = await ktx2Response.arrayBuffer();\n return new ktx.ktxTexture(new Uint8Array(ktx2ArrayBuffer));\n }\n throw new Error(`Failed to load KTX(2) texture: ${url}`);\n }\n const preferredTranscodedFormat = [\n \"bc7-rgba-unorm\",\n \"astc-4x4-unorm\",\n \"etc2-rgba8unorm\",\n \"bc3-rgba-unorm\",\n \"rgba8unorm\"\n ];\n async function load(url) {\n const ktx = await getKTX();\n const ktxTexture = await fetchKTXTexture(url, ktx);\n let format;\n if (ktxTexture.needsTranscoding) {\n format = basisTranscodedTextureFormat;\n const transcodeFormat = ktx.TranscodeTarget[basisTranscoderFormat];\n const result = ktxTexture.transcodeBasis(transcodeFormat, 0);\n if (result !== ktx.ErrorCode.SUCCESS) {\n throw new Error(\"Unable to transcode basis texture.\");\n }\n } else {\n format = getTextureFormatFromKTXTexture(ktxTexture);\n }\n const levelBuffers = createLevelBuffersFromKTX(ktxTexture);\n const textureOptions = {\n width: ktxTexture.baseWidth,\n height: ktxTexture.baseHeight,\n format,\n mipLevelCount: ktxTexture.numLevels,\n resource: levelBuffers,\n alphaMode: \"no-premultiply-alpha\"\n };\n convertFormatIfRequired(textureOptions);\n return textureOptions;\n }\n async function init(jsUrl, wasmUrl, supportedTextures) {\n if (jsUrl)\n settings.jsUrl = jsUrl;\n if (wasmUrl)\n settings.wasmUrl = wasmUrl;\n basisTranscodedTextureFormat = preferredTranscodedFormat.filter((format) => supportedTextures.includes(format))[0];\n basisTranscoderFormat = gpuFormatToKTXBasisTranscoderFormat(basisTranscodedTextureFormat);\n await getKTX();\n }\n const messageHandlers = {\n init: async (data) => {\n const { jsUrl, wasmUrl, supportedTextures } = data;\n await init(jsUrl, wasmUrl, supportedTextures);\n },\n load: async (data) => {\n try {\n const textureOptions = await load(data.url);\n return {\n type: \"load\",\n url: data.url,\n success: true,\n textureOptions,\n transferables: textureOptions.resource?.map((arr) => arr.buffer)\n };\n } catch (e) {\n throw e;\n }\n }\n };\n self.onmessage = async (messageEvent) => {\n const message = messageEvent.data;\n const response = await messageHandlers[message.type]?.(message);\n if (response) {\n self.postMessage(response, response.transferables);\n }\n };\n\n})();\n"; var WORKER_URL = null; var WorkerInstance = /*#__PURE__*/_createClass(function WorkerInstance() { _classCallCheck(this, WorkerInstance); if (!WORKER_URL) { WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' })); } this.worker = new Worker(WORKER_URL); }); WorkerInstance.revokeObjectURL = function revokeObjectURL() { if (WORKER_URL) { URL.revokeObjectURL(WORKER_URL); WORKER_URL = null; } }; exports["default"] = WorkerInstance; /***/ }), /***/ 5347: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var DifferenceBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function DifferenceBlend() { _classCallCheck(this, DifferenceBlend); return _callSuper(this, DifferenceBlend, [{ gl: { functions: "\n vec3 blendDifference(vec3 base, vec3 blend, float opacity)\n {\n return (abs(blend - base) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendDifference(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn blendDifference(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n return (abs(blend - base) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendDifference(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(DifferenceBlend, _BlendModeFilter$Blen); return _createClass(DifferenceBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ DifferenceBlend.extension = { name: "difference", type: Extensions.ExtensionType.BlendMode }; exports.DifferenceBlend = DifferenceBlend; /***/ }), /***/ 5433: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var conventions = __webpack_require__(86621); var find = conventions.find; var NAMESPACE = conventions.NAMESPACE; /** * A prerequisite for `[].filter`, to drop elements that are empty * @param {string} input * @returns {boolean} */ function notEmptyString(input) { return input !== ''; } /** * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace * @see https://infra.spec.whatwg.org/#ascii-whitespace * * @param {string} input * @returns {string[]} (can be empty) */ function splitOnASCIIWhitespace(input) { // U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : []; } /** * Adds element as a key to current if it is not already present. * * @param {Record<string, boolean | undefined>} current * @param {string} element * @returns {Record<string, boolean | undefined>} */ function orderedSetReducer(current, element) { if (!current.hasOwnProperty(element)) { current[element] = true; } return current; } /** * @see https://infra.spec.whatwg.org/#ordered-set * @param {string} input * @returns {string[]} */ function toOrderedSet(input) { if (!input) return []; var list = splitOnASCIIWhitespace(input); return Object.keys(list.reduce(orderedSetReducer, {})); } /** * Uses `list.indexOf` to implement something like `Array.prototype.includes`, * which we can not rely on being available. * * @param {any[]} list * @returns {function(any): boolean} */ function arrayIncludes(list) { return function (element) { return list && list.indexOf(element) !== -1; }; } function copy(src, dest) { for (var p in src) { if (Object.prototype.hasOwnProperty.call(src, p)) { dest[p] = src[p]; } } } /** ^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));? ^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));? */ function _extends(Class, Super) { var pt = Class.prototype; if (!(pt instanceof Super)) { var t = function t() {}; ; t.prototype = Super.prototype; t = new t(); copy(pt, t); Class.prototype = pt = t; } if (pt.constructor != Class) { if (typeof Class != 'function') { console.error("unknown Class:" + Class); } pt.constructor = Class; } } // Node Types var NodeType = {}; var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1; var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2; var TEXT_NODE = NodeType.TEXT_NODE = 3; var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4; var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5; var ENTITY_NODE = NodeType.ENTITY_NODE = 6; var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7; var COMMENT_NODE = NodeType.COMMENT_NODE = 8; var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9; var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10; var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11; var NOTATION_NODE = NodeType.NOTATION_NODE = 12; // ExceptionCode var ExceptionCode = {}; var ExceptionMessage = {}; var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = (ExceptionMessage[1] = "Index size error", 1); var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = (ExceptionMessage[2] = "DOMString size error", 2); var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = (ExceptionMessage[3] = "Hierarchy request error", 3); var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = (ExceptionMessage[4] = "Wrong document", 4); var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = (ExceptionMessage[5] = "Invalid character", 5); var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = (ExceptionMessage[6] = "No data allowed", 6); var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = (ExceptionMessage[7] = "No modification allowed", 7); var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = (ExceptionMessage[8] = "Not found", 8); var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = (ExceptionMessage[9] = "Not supported", 9); var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = (ExceptionMessage[10] = "Attribute in use", 10); //level2 var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = (ExceptionMessage[11] = "Invalid state", 11); var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = (ExceptionMessage[12] = "Syntax error", 12); var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = (ExceptionMessage[13] = "Invalid modification", 13); var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = (ExceptionMessage[14] = "Invalid namespace", 14); var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15); /** * DOM Level 2 * Object DOMException * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html */ function DOMException(code, message) { if (message instanceof Error) { var error = message; } else { error = this; Error.call(this, ExceptionMessage[code]); this.message = ExceptionMessage[code]; if (Error.captureStackTrace) Error.captureStackTrace(this, DOMException); } error.code = code; if (message) this.message = this.message + ": " + message; return error; } ; DOMException.prototype = Error.prototype; copy(ExceptionCode, DOMException); /** * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177 * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live. * The items in the NodeList are accessible via an integral index, starting from 0. */ function NodeList() {} ; NodeList.prototype = { /** * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive. * @standard level1 */ length: 0, /** * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null. * @standard level1 * @param index unsigned long * Index into the collection. * @return Node * The node at the indexth position in the NodeList, or null if that is not a valid index. */ item: function item(index) { return index >= 0 && index < this.length ? this[index] : null; }, toString: function toString(isHTML, nodeFilter) { for (var buf = [], i = 0; i < this.length; i++) { serializeToString(this[i], buf, isHTML, nodeFilter); } return buf.join(''); }, /** * @private * @param {function (Node):boolean} predicate * @returns {Node[]} */ filter: function filter(predicate) { return Array.prototype.filter.call(this, predicate); }, /** * @private * @param {Node} item * @returns {number} */ indexOf: function indexOf(item) { return Array.prototype.indexOf.call(this, item); } }; function LiveNodeList(node, refresh) { this._node = node; this._refresh = refresh; _updateLiveList(this); } function _updateLiveList(list) { var inc = list._node._inc || list._node.ownerDocument._inc; if (list._inc !== inc) { var ls = list._refresh(list._node); __set__(list, 'length', ls.length); if (!list.$$length || ls.length < list.$$length) { for (var i = ls.length; i in list; i++) { if (Object.prototype.hasOwnProperty.call(list, i)) { delete list[i]; } } } copy(ls, list); list._inc = inc; } } LiveNodeList.prototype.item = function (i) { _updateLiveList(this); return this[i] || null; }; _extends(LiveNodeList, NodeList); /** * Objects implementing the NamedNodeMap interface are used * to represent collections of nodes that can be accessed by name. * Note that NamedNodeMap does not inherit from NodeList; * NamedNodeMaps are not maintained in any particular order. * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, * and does not imply that the DOM specifies an order to these Nodes. * NamedNodeMap objects in the DOM are live. * used for attributes or DocumentType entities */ function NamedNodeMap() {} ; function _findNodeIndex(list, node) { var i = list.length; while (i--) { if (list[i] === node) { return i; } } } function _addNamedNode(el, list, newAttr, oldAttr) { if (oldAttr) { list[_findNodeIndex(list, oldAttr)] = newAttr; } else { list[list.length++] = newAttr; } if (el) { newAttr.ownerElement = el; var doc = el.ownerDocument; if (doc) { oldAttr && _onRemoveAttribute(doc, el, oldAttr); _onAddAttribute(doc, el, newAttr); } } } function _removeNamedNode(el, list, attr) { //console.log('remove attr:'+attr) var i = _findNodeIndex(list, attr); if (i >= 0) { var lastIndex = list.length - 1; while (i < lastIndex) { list[i] = list[++i]; } list.length = lastIndex; if (el) { var doc = el.ownerDocument; if (doc) { _onRemoveAttribute(doc, el, attr); attr.ownerElement = null; } } } else { throw new DOMException(NOT_FOUND_ERR, new Error(el.tagName + '@' + attr)); } } NamedNodeMap.prototype = { length: 0, item: NodeList.prototype.item, getNamedItem: function getNamedItem(key) { // if(key.indexOf(':')>0 || key == 'xmlns'){ // return null; // } //console.log() var i = this.length; while (i--) { var attr = this[i]; //console.log(attr.nodeName,key) if (attr.nodeName == key) { return attr; } } }, setNamedItem: function setNamedItem(attr) { var el = attr.ownerElement; if (el && el != this._ownerElement) { throw new DOMException(INUSE_ATTRIBUTE_ERR); } var oldAttr = this.getNamedItem(attr.nodeName); _addNamedNode(this._ownerElement, this, attr, oldAttr); return oldAttr; }, /* returns Node */ setNamedItemNS: function setNamedItemNS(attr) { // raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR var el = attr.ownerElement, oldAttr; if (el && el != this._ownerElement) { throw new DOMException(INUSE_ATTRIBUTE_ERR); } oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName); _addNamedNode(this._ownerElement, this, attr, oldAttr); return oldAttr; }, /* returns Node */ removeNamedItem: function removeNamedItem(key) { var attr = this.getNamedItem(key); _removeNamedNode(this._ownerElement, this, attr); return attr; }, // raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR //for level2 removeNamedItemNS: function removeNamedItemNS(namespaceURI, localName) { var attr = this.getNamedItemNS(namespaceURI, localName); _removeNamedNode(this._ownerElement, this, attr); return attr; }, getNamedItemNS: function getNamedItemNS(namespaceURI, localName) { var i = this.length; while (i--) { var node = this[i]; if (node.localName == localName && node.namespaceURI == namespaceURI) { return node; } } return null; } }; /** * The DOMImplementation interface represents an object providing methods * which are not dependent on any particular document. * Such an object is returned by the `Document.implementation` property. * * __The individual methods describe the differences compared to the specs.__ * * @constructor * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial) * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard */ function DOMImplementation() {} DOMImplementation.prototype = { /** * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported. * The different implementations fairly diverged in what kind of features were reported. * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use. * * @deprecated It is deprecated and modern browsers return true in all cases. * * @param {string} feature * @param {string} [version] * @returns {boolean} always true * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard */ hasFeature: function hasFeature(feature, version) { return true; }, /** * Creates an XML Document object of the specified type with its document element. * * __It behaves slightly different from the description in the living standard__: * - There is no interface/class `XMLDocument`, it returns a `Document` instance. * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared. * - this implementation is not validating names or qualified names * (when parsing XML strings, the SAX parser takes care of that) * * @param {string|null} namespaceURI * @param {string} qualifiedName * @param {DocumentType=null} doctype * @returns {Document} * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial) * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core * * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names */ createDocument: function createDocument(namespaceURI, qualifiedName, doctype) { var doc = new Document(); doc.implementation = this; doc.childNodes = new NodeList(); doc.doctype = doctype || null; if (doctype) { doc.appendChild(doctype); } if (qualifiedName) { var root = doc.createElementNS(namespaceURI, qualifiedName); doc.appendChild(root); } return doc; }, /** * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`. * * __This behavior is slightly different from the in the specs__: * - this implementation is not validating names or qualified names * (when parsing XML strings, the SAX parser takes care of that) * * @param {string} qualifiedName * @param {string} [publicId] * @param {string} [systemId] * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()` * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard * * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names */ createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) { var node = new DocumentType(); node.name = qualifiedName; node.nodeName = qualifiedName; node.publicId = publicId || ''; node.systemId = systemId || ''; return node; } }; /** * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 */ function Node() {} ; Node.prototype = { firstChild: null, lastChild: null, previousSibling: null, nextSibling: null, attributes: null, parentNode: null, childNodes: null, ownerDocument: null, nodeValue: null, namespaceURI: null, prefix: null, localName: null, // Modified in DOM Level 2: insertBefore: function insertBefore(newChild, refChild) { //raises return _insertBefore(this, newChild, refChild); }, replaceChild: function replaceChild(newChild, oldChild) { //raises _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument); if (oldChild) { this.removeChild(oldChild); } }, removeChild: function removeChild(oldChild) { return _removeChild(this, oldChild); }, appendChild: function appendChild(newChild) { return this.insertBefore(newChild, null); }, hasChildNodes: function hasChildNodes() { return this.firstChild != null; }, cloneNode: function cloneNode(deep) { return _cloneNode(this.ownerDocument || this, this, deep); }, // Modified in DOM Level 2: normalize: function normalize() { var child = this.firstChild; while (child) { var next = child.nextSibling; if (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) { this.removeChild(next); child.appendData(next.data); } else { child.normalize(); child = next; } } }, // Introduced in DOM Level 2: isSupported: function isSupported(feature, version) { return this.ownerDocument.implementation.hasFeature(feature, version); }, // Introduced in DOM Level 2: hasAttributes: function hasAttributes() { return this.attributes.length > 0; }, /** * Look up the prefix associated to the given namespace URI, starting from this node. * **The default namespace declarations are ignored by this method.** * See Namespace Prefix Lookup for details on the algorithm used by this method. * * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._ * * @param {string | null} namespaceURI * @returns {string | null} * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix * @see https://github.com/xmldom/xmldom/issues/322 */ lookupPrefix: function lookupPrefix(namespaceURI) { var el = this; while (el) { var map = el._nsMap; //console.dir(map) if (map) { for (var n in map) { if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) { return n; } } } el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode; } return null; }, // Introduced in DOM Level 3: lookupNamespaceURI: function lookupNamespaceURI(prefix) { var el = this; while (el) { var map = el._nsMap; //console.dir(map) if (map) { if (Object.prototype.hasOwnProperty.call(map, prefix)) { return map[prefix]; } } el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode; } return null; }, // Introduced in DOM Level 3: isDefaultNamespace: function isDefaultNamespace(namespaceURI) { var prefix = this.lookupPrefix(namespaceURI); return prefix == null; } }; function _xmlEncoder(c) { return c == '<' && '<' || c == '>' && '>' || c == '&' && '&' || c == '"' && '"' || '&#' + c.charCodeAt() + ';'; } copy(NodeType, Node); copy(NodeType, Node.prototype); /** * @param callback return true for continue,false for break * @return boolean true: break visit; */ function _visitNode(node, callback) { if (callback(node)) { return true; } if (node = node.firstChild) { do { if (_visitNode(node, callback)) { return true; } } while (node = node.nextSibling); } } function Document() { this.ownerDocument = this; } function _onAddAttribute(doc, el, newAttr) { doc && doc._inc++; var ns = newAttr.namespaceURI; if (ns === NAMESPACE.XMLNS) { //update namespace el._nsMap[newAttr.prefix ? newAttr.localName : ''] = newAttr.value; } } function _onRemoveAttribute(doc, el, newAttr, remove) { doc && doc._inc++; var ns = newAttr.namespaceURI; if (ns === NAMESPACE.XMLNS) { //update namespace delete el._nsMap[newAttr.prefix ? newAttr.localName : '']; } } /** * Updates `el.childNodes`, updating the indexed items and it's `length`. * Passing `newChild` means it will be appended. * Otherwise it's assumed that an item has been removed, * and `el.firstNode` and it's `.nextSibling` are used * to walk the current list of child nodes. * * @param {Document} doc * @param {Node} el * @param {Node} [newChild] * @private */ function _onUpdateChild(doc, el, newChild) { if (doc && doc._inc) { doc._inc++; //update childNodes var cs = el.childNodes; if (newChild) { cs[cs.length++] = newChild; } else { var child = el.firstChild; var i = 0; while (child) { cs[i++] = child; child = child.nextSibling; } cs.length = i; delete cs[cs.length]; } } } /** * Removes the connections between `parentNode` and `child` * and any existing `child.previousSibling` or `child.nextSibling`. * * @see https://github.com/xmldom/xmldom/issues/135 * @see https://github.com/xmldom/xmldom/issues/145 * * @param {Node} parentNode * @param {Node} child * @returns {Node} the child that was removed. * @private */ function _removeChild(parentNode, child) { var previous = child.previousSibling; var next = child.nextSibling; if (previous) { previous.nextSibling = next; } else { parentNode.firstChild = next; } if (next) { next.previousSibling = previous; } else { parentNode.lastChild = previous; } child.parentNode = null; child.previousSibling = null; child.nextSibling = null; _onUpdateChild(parentNode.ownerDocument, parentNode); return child; } /** * Returns `true` if `node` can be a parent for insertion. * @param {Node} node * @returns {boolean} */ function hasValidParentNodeType(node) { return node && (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE); } /** * Returns `true` if `node` can be inserted according to it's `nodeType`. * @param {Node} node * @returns {boolean} */ function hasInsertableNodeType(node) { return node && (isElementNode(node) || isTextNode(node) || isDocTypeNode(node) || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.COMMENT_NODE || node.nodeType === Node.PROCESSING_INSTRUCTION_NODE); } /** * Returns true if `node` is a DOCTYPE node * @param {Node} node * @returns {boolean} */ function isDocTypeNode(node) { return node && node.nodeType === Node.DOCUMENT_TYPE_NODE; } /** * Returns true if the node is an element * @param {Node} node * @returns {boolean} */ function isElementNode(node) { return node && node.nodeType === Node.ELEMENT_NODE; } /** * Returns true if `node` is a text node * @param {Node} node * @returns {boolean} */ function isTextNode(node) { return node && node.nodeType === Node.TEXT_NODE; } /** * Check if en element node can be inserted before `child`, or at the end if child is falsy, * according to the presence and position of a doctype node on the same level. * * @param {Document} doc The document node * @param {Node} child the node that would become the nextSibling if the element would be inserted * @returns {boolean} `true` if an element can be inserted before child * @private * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity */ function isElementInsertionPossible(doc, child) { var parentChildNodes = doc.childNodes || []; if (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) { return false; } var docTypeNode = find(parentChildNodes, isDocTypeNode); return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child)); } /** * Check if en element node can be inserted before `child`, or at the end if child is falsy, * according to the presence and position of a doctype node on the same level. * * @param {Node} doc The document node * @param {Node} child the node that would become the nextSibling if the element would be inserted * @returns {boolean} `true` if an element can be inserted before child * @private * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity */ function isElementReplacementPossible(doc, child) { var parentChildNodes = doc.childNodes || []; function hasElementChildThatIsNotChild(node) { return isElementNode(node) && node !== child; } if (find(parentChildNodes, hasElementChildThatIsNotChild)) { return false; } var docTypeNode = find(parentChildNodes, isDocTypeNode); return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child)); } /** * @private * Steps 1-5 of the checks before inserting and before replacing a child are the same. * * @param {Node} parent the parent node to insert `node` into * @param {Node} node the node to insert * @param {Node=} child the node that should become the `nextSibling` of `node` * @returns {Node} * @throws DOMException for several node combinations that would create a DOM that is not well-formed. * @throws DOMException if `child` is provided but is not a child of `parent`. * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity * @see https://dom.spec.whatwg.org/#concept-node-replace */ function assertPreInsertionValidity1to5(parent, node, child) { // 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a "HierarchyRequestError" DOMException. if (!hasValidParentNodeType(parent)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType); } // 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a "HierarchyRequestError" DOMException. // not implemented! // 3. If `child` is non-null and its parent is not `parent`, then throw a "NotFoundError" DOMException. if (child && child.parentNode !== parent) { throw new DOMException(NOT_FOUND_ERR, 'child not in parent'); } if ( // 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException. !hasInsertableNodeType(node) || // 5. If either `node` is a Text node and `parent` is a document, // the sax parser currently adds top level text nodes, this will be fixed in 0.9.0 // || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE) // or `node` is a doctype and `parent` is not a document, then throw a "HierarchyRequestError" DOMException. isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType); } } /** * @private * Step 6 of the checks before inserting and before replacing a child are different. * * @param {Document} parent the parent node to insert `node` into * @param {Node} node the node to insert * @param {Node | undefined} child the node that should become the `nextSibling` of `node` * @returns {Node} * @throws DOMException for several node combinations that would create a DOM that is not well-formed. * @throws DOMException if `child` is provided but is not a child of `parent`. * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity * @see https://dom.spec.whatwg.org/#concept-node-replace */ function assertPreInsertionValidityInDocument(parent, node, child) { var parentChildNodes = parent.childNodes || []; var nodeChildNodes = node.childNodes || []; // DocumentFragment if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { var nodeChildElements = nodeChildNodes.filter(isElementNode); // If node has more than one element child or has a Text node child. if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment'); } // Otherwise, if `node` has one element child and either `parent` has an element child, // `child` is a doctype, or `child` is non-null and a doctype is following `child`. if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype'); } } // Element if (isElementNode(node)) { // `parent` has an element child, `child` is a doctype, // or `child` is non-null and a doctype is following `child`. if (!isElementInsertionPossible(parent, child)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype'); } } // DocumentType if (isDocTypeNode(node)) { // `parent` has a doctype child, if (find(parentChildNodes, isDocTypeNode)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed'); } var parentElementChild = find(parentChildNodes, isElementNode); // `child` is non-null and an element is preceding `child`, if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element'); } // or `child` is null and `parent` has an element child. if (!child && parentElementChild) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present'); } } } /** * @private * Step 6 of the checks before inserting and before replacing a child are different. * * @param {Document} parent the parent node to insert `node` into * @param {Node} node the node to insert * @param {Node | undefined} child the node that should become the `nextSibling` of `node` * @returns {Node} * @throws DOMException for several node combinations that would create a DOM that is not well-formed. * @throws DOMException if `child` is provided but is not a child of `parent`. * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity * @see https://dom.spec.whatwg.org/#concept-node-replace */ function assertPreReplacementValidityInDocument(parent, node, child) { var parentChildNodes = parent.childNodes || []; var nodeChildNodes = node.childNodes || []; // DocumentFragment if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { var nodeChildElements = nodeChildNodes.filter(isElementNode); // If `node` has more than one element child or has a Text node child. if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment'); } // Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`. if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype'); } } // Element if (isElementNode(node)) { // `parent` has an element child that is not `child` or a doctype is following `child`. if (!isElementReplacementPossible(parent, child)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype'); } } // DocumentType if (isDocTypeNode(node)) { var hasDoctypeChildThatIsNotChild = function hasDoctypeChildThatIsNotChild(node) { return isDocTypeNode(node) && node !== child; }; // `parent` has a doctype child that is not `child`, if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed'); } var parentElementChild = find(parentChildNodes, isElementNode); // or an element is preceding `child`. if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) { throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element'); } } } /** * @private * @param {Node} parent the parent node to insert `node` into * @param {Node} node the node to insert * @param {Node=} child the node that should become the `nextSibling` of `node` * @returns {Node} * @throws DOMException for several node combinations that would create a DOM that is not well-formed. * @throws DOMException if `child` is provided but is not a child of `parent`. * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity */ function _insertBefore(parent, node, child, _inDocumentAssertion) { // To ensure pre-insertion validity of a node into a parent before a child, run these steps: assertPreInsertionValidity1to5(parent, node, child); // If parent is a document, and any of the statements below, switched on the interface node implements, // are true, then throw a "HierarchyRequestError" DOMException. if (parent.nodeType === Node.DOCUMENT_NODE) { (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child); } var cp = node.parentNode; if (cp) { cp.removeChild(node); //remove and update } if (node.nodeType === DOCUMENT_FRAGMENT_NODE) { var newFirst = node.firstChild; if (newFirst == null) { return node; } var newLast = node.lastChild; } else { newFirst = newLast = node; } var pre = child ? child.previousSibling : parent.lastChild; newFirst.previousSibling = pre; newLast.nextSibling = child; if (pre) { pre.nextSibling = newFirst; } else { parent.firstChild = newFirst; } if (child == null) { parent.lastChild = newLast; } else { child.previousSibling = newLast; } do { newFirst.parentNode = parent; } while (newFirst !== newLast && (newFirst = newFirst.nextSibling)); _onUpdateChild(parent.ownerDocument || parent, parent); //console.log(parent.lastChild.nextSibling == null) if (node.nodeType == DOCUMENT_FRAGMENT_NODE) { node.firstChild = node.lastChild = null; } return node; } /** * Appends `newChild` to `parentNode`. * If `newChild` is already connected to a `parentNode` it is first removed from it. * * @see https://github.com/xmldom/xmldom/issues/135 * @see https://github.com/xmldom/xmldom/issues/145 * @param {Node} parentNode * @param {Node} newChild * @returns {Node} * @private */ function _appendSingleChild(parentNode, newChild) { if (newChild.parentNode) { newChild.parentNode.removeChild(newChild); } newChild.parentNode = parentNode; newChild.previousSibling = parentNode.lastChild; newChild.nextSibling = null; if (newChild.previousSibling) { newChild.previousSibling.nextSibling = newChild; } else { parentNode.firstChild = newChild; } parentNode.lastChild = newChild; _onUpdateChild(parentNode.ownerDocument, parentNode, newChild); return newChild; } Document.prototype = { //implementation : null, nodeName: '#document', nodeType: DOCUMENT_NODE, /** * The DocumentType node of the document. * * @readonly * @type DocumentType */ doctype: null, documentElement: null, _inc: 1, insertBefore: function insertBefore(newChild, refChild) { //raises if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) { var child = newChild.firstChild; while (child) { var next = child.nextSibling; this.insertBefore(child, refChild); child = next; } return newChild; } _insertBefore(this, newChild, refChild); newChild.ownerDocument = this; if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) { this.documentElement = newChild; } return newChild; }, removeChild: function removeChild(oldChild) { if (this.documentElement == oldChild) { this.documentElement = null; } return _removeChild(this, oldChild); }, replaceChild: function replaceChild(newChild, oldChild) { //raises _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument); newChild.ownerDocument = this; if (oldChild) { this.removeChild(oldChild); } if (isElementNode(newChild)) { this.documentElement = newChild; } }, // Introduced in DOM Level 2: importNode: function importNode(importedNode, deep) { return _importNode(this, importedNode, deep); }, // Introduced in DOM Level 2: getElementById: function getElementById(id) { var rtv = null; _visitNode(this.documentElement, function (node) { if (node.nodeType == ELEMENT_NODE) { if (node.getAttribute('id') == id) { rtv = node; return true; } } }); return rtv; }, /** * The `getElementsByClassName` method of `Document` interface returns an array-like object * of all child elements which have **all** of the given class name(s). * * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters. * * * Warning: This is a live LiveNodeList. * Changes in the DOM will reflect in the array as the changes occur. * If an element selected by this array no longer qualifies for the selector, * it will automatically be removed. Be aware of this for iteration purposes. * * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace * * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname */ getElementsByClassName: function getElementsByClassName(classNames) { var classNamesSet = toOrderedSet(classNames); return new LiveNodeList(this, function (base) { var ls = []; if (classNamesSet.length > 0) { _visitNode(base.documentElement, function (node) { if (node !== base && node.nodeType === ELEMENT_NODE) { var nodeClassNames = node.getAttribute('class'); // can be null if the attribute does not exist if (nodeClassNames) { // before splitting and iterating just compare them for the most common case var matches = classNames === nodeClassNames; if (!matches) { var nodeClassNamesSet = toOrderedSet(nodeClassNames); matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet)); } if (matches) { ls.push(node); } } } }); } return ls; }); }, //document factory method: createElement: function createElement(tagName) { var node = new Element(); node.ownerDocument = this; node.nodeName = tagName; node.tagName = tagName; node.localName = tagName; node.childNodes = new NodeList(); var attrs = node.attributes = new NamedNodeMap(); attrs._ownerElement = node; return node; }, createDocumentFragment: function createDocumentFragment() { var node = new DocumentFragment(); node.ownerDocument = this; node.childNodes = new NodeList(); return node; }, createTextNode: function createTextNode(data) { var node = new Text(); node.ownerDocument = this; node.appendData(data); return node; }, createComment: function createComment(data) { var node = new Comment(); node.ownerDocument = this; node.appendData(data); return node; }, createCDATASection: function createCDATASection(data) { var node = new CDATASection(); node.ownerDocument = this; node.appendData(data); return node; }, createProcessingInstruction: function createProcessingInstruction(target, data) { var node = new ProcessingInstruction(); node.ownerDocument = this; node.tagName = node.nodeName = node.target = target; node.nodeValue = node.data = data; return node; }, createAttribute: function createAttribute(name) { var node = new Attr(); node.ownerDocument = this; node.name = name; node.nodeName = name; node.localName = name; node.specified = true; return node; }, createEntityReference: function createEntityReference(name) { var node = new EntityReference(); node.ownerDocument = this; node.nodeName = name; return node; }, // Introduced in DOM Level 2: createElementNS: function createElementNS(namespaceURI, qualifiedName) { var node = new Element(); var pl = qualifiedName.split(':'); var attrs = node.attributes = new NamedNodeMap(); node.childNodes = new NodeList(); node.ownerDocument = this; node.nodeName = qualifiedName; node.tagName = qualifiedName; node.namespaceURI = namespaceURI; if (pl.length == 2) { node.prefix = pl[0]; node.localName = pl[1]; } else { //el.prefix = null; node.localName = qualifiedName; } attrs._ownerElement = node; return node; }, // Introduced in DOM Level 2: createAttributeNS: function createAttributeNS(namespaceURI, qualifiedName) { var node = new Attr(); var pl = qualifiedName.split(':'); node.ownerDocument = this; node.nodeName = qualifiedName; node.name = qualifiedName; node.namespaceURI = namespaceURI; node.specified = true; if (pl.length == 2) { node.prefix = pl[0]; node.localName = pl[1]; } else { //el.prefix = null; node.localName = qualifiedName; } return node; } }; _extends(Document, Node); function Element() { this._nsMap = {}; } ; Element.prototype = { nodeType: ELEMENT_NODE, hasAttribute: function hasAttribute(name) { return this.getAttributeNode(name) != null; }, getAttribute: function getAttribute(name) { var attr = this.getAttributeNode(name); return attr && attr.value || ''; }, getAttributeNode: function getAttributeNode(name) { return this.attributes.getNamedItem(name); }, setAttribute: function setAttribute(name, value) { var attr = this.ownerDocument.createAttribute(name); attr.value = attr.nodeValue = "" + value; this.setAttributeNode(attr); }, removeAttribute: function removeAttribute(name) { var attr = this.getAttributeNode(name); attr && this.removeAttributeNode(attr); }, //four real opeartion method appendChild: function appendChild(newChild) { if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) { return this.insertBefore(newChild, null); } else { return _appendSingleChild(this, newChild); } }, setAttributeNode: function setAttributeNode(newAttr) { return this.attributes.setNamedItem(newAttr); }, setAttributeNodeNS: function setAttributeNodeNS(newAttr) { return this.attributes.setNamedItemNS(newAttr); }, removeAttributeNode: function removeAttributeNode(oldAttr) { //console.log(this == oldAttr.ownerElement) return this.attributes.removeNamedItem(oldAttr.nodeName); }, //get real attribute name,and remove it by removeAttributeNode removeAttributeNS: function removeAttributeNS(namespaceURI, localName) { var old = this.getAttributeNodeNS(namespaceURI, localName); old && this.removeAttributeNode(old); }, hasAttributeNS: function hasAttributeNS(namespaceURI, localName) { return this.getAttributeNodeNS(namespaceURI, localName) != null; }, getAttributeNS: function getAttributeNS(namespaceURI, localName) { var attr = this.getAttributeNodeNS(namespaceURI, localName); return attr && attr.value || ''; }, setAttributeNS: function setAttributeNS(namespaceURI, qualifiedName, value) { var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName); attr.value = attr.nodeValue = "" + value; this.setAttributeNode(attr); }, getAttributeNodeNS: function getAttributeNodeNS(namespaceURI, localName) { return this.attributes.getNamedItemNS(namespaceURI, localName); }, getElementsByTagName: function getElementsByTagName(tagName) { return new LiveNodeList(this, function (base) { var ls = []; _visitNode(base, function (node) { if (node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)) { ls.push(node); } }); return ls; }); }, getElementsByTagNameNS: function getElementsByTagNameNS(namespaceURI, localName) { return new LiveNodeList(this, function (base) { var ls = []; _visitNode(base, function (node) { if (node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)) { ls.push(node); } }); return ls; }); } }; Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName; Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS; _extends(Element, Node); function Attr() {} ; Attr.prototype.nodeType = ATTRIBUTE_NODE; _extends(Attr, Node); function CharacterData() {} ; CharacterData.prototype = { data: '', substringData: function substringData(offset, count) { return this.data.substring(offset, offset + count); }, appendData: function appendData(text) { text = this.data + text; this.nodeValue = this.data = text; this.length = text.length; }, insertData: function insertData(offset, text) { this.replaceData(offset, 0, text); }, appendChild: function appendChild(newChild) { throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]); }, deleteData: function deleteData(offset, count) { this.replaceData(offset, count, ""); }, replaceData: function replaceData(offset, count, text) { var start = this.data.substring(0, offset); var end = this.data.substring(offset + count); text = start + text + end; this.nodeValue = this.data = text; this.length = text.length; } }; _extends(CharacterData, Node); function Text() {} ; Text.prototype = { nodeName: "#text", nodeType: TEXT_NODE, splitText: function splitText(offset) { var text = this.data; var newText = text.substring(offset); text = text.substring(0, offset); this.data = this.nodeValue = text; this.length = text.length; var newNode = this.ownerDocument.createTextNode(newText); if (this.parentNode) { this.parentNode.insertBefore(newNode, this.nextSibling); } return newNode; } }; _extends(Text, CharacterData); function Comment() {} ; Comment.prototype = { nodeName: "#comment", nodeType: COMMENT_NODE }; _extends(Comment, CharacterData); function CDATASection() {} ; CDATASection.prototype = { nodeName: "#cdata-section", nodeType: CDATA_SECTION_NODE }; _extends(CDATASection, CharacterData); function DocumentType() {} ; DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE; _extends(DocumentType, Node); function Notation() {} ; Notation.prototype.nodeType = NOTATION_NODE; _extends(Notation, Node); function Entity() {} ; Entity.prototype.nodeType = ENTITY_NODE; _extends(Entity, Node); function EntityReference() {} ; EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE; _extends(EntityReference, Node); function DocumentFragment() {} ; DocumentFragment.prototype.nodeName = "#document-fragment"; DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE; _extends(DocumentFragment, Node); function ProcessingInstruction() {} ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE; _extends(ProcessingInstruction, Node); function XMLSerializer() {} XMLSerializer.prototype.serializeToString = function (node, isHtml, nodeFilter) { return nodeSerializeToString.call(node, isHtml, nodeFilter); }; Node.prototype.toString = nodeSerializeToString; function nodeSerializeToString(isHtml, nodeFilter) { var buf = []; var refNode = this.nodeType == 9 && this.documentElement || this; var prefix = refNode.prefix; var uri = refNode.namespaceURI; if (uri && prefix == null) { //console.log(prefix) var prefix = refNode.lookupPrefix(uri); if (prefix == null) { //isHTML = true; var visibleNamespaces = [{ namespace: uri, prefix: null } //{namespace:uri,prefix:''} ]; } } serializeToString(this, buf, isHtml, nodeFilter, visibleNamespaces); //console.log('###',this.nodeType,uri,prefix,buf.join('')) return buf.join(''); } function needNamespaceDefine(node, isHTML, visibleNamespaces) { var prefix = node.prefix || ''; var uri = node.namespaceURI; // According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) , // and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl : // > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty. // in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using) // and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared : // > [...] Furthermore, the attribute value [...] must not be an empty string. // so serializing empty namespace value like xmlns:ds="" would produce an invalid XML document. if (!uri) { return false; } if (prefix === "xml" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) { return false; } var i = visibleNamespaces.length; while (i--) { var ns = visibleNamespaces[i]; // get namespace prefix if (ns.prefix === prefix) { return ns.namespace !== uri; } } return true; } /** * Well-formed constraint: No < in Attribute Values * > The replacement text of any entity referred to directly or indirectly * > in an attribute value must not contain a <. * @see https://www.w3.org/TR/xml11/#CleanAttrVals * @see https://www.w3.org/TR/xml11/#NT-AttValue * * Literal whitespace other than space that appear in attribute values * are serialized as their entity references, so they will be preserved. * (In contrast to whitespace literals in the input which are normalized to spaces) * @see https://www.w3.org/TR/xml11/#AVNormalize * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes */ function addSerializedAttribute(buf, qualifiedName, value) { buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"'); } function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces) { if (!visibleNamespaces) { visibleNamespaces = []; } if (nodeFilter) { node = nodeFilter(node); if (node) { if (typeof node == 'string') { buf.push(node); return; } } else { return; } //buf.sort.apply(attrs, attributeSorter); } switch (node.nodeType) { case ELEMENT_NODE: var attrs = node.attributes; var len = attrs.length; var child = node.firstChild; var nodeName = node.tagName; isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML; var prefixedNodeName = nodeName; if (!isHTML && !node.prefix && node.namespaceURI) { var defaultNS; // lookup current default ns from `xmlns` attribute for (var ai = 0; ai < attrs.length; ai++) { if (attrs.item(ai).name === 'xmlns') { defaultNS = attrs.item(ai).value; break; } } if (!defaultNS) { // lookup current default ns in visibleNamespaces for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) { var namespace = visibleNamespaces[nsi]; if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) { defaultNS = namespace.namespace; break; } } } if (defaultNS !== node.namespaceURI) { for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) { var namespace = visibleNamespaces[nsi]; if (namespace.namespace === node.namespaceURI) { if (namespace.prefix) { prefixedNodeName = namespace.prefix + ':' + nodeName; } break; } } } } buf.push('<', prefixedNodeName); for (var i = 0; i < len; i++) { // add namespaces for attributes var attr = attrs.item(i); if (attr.prefix == 'xmlns') { visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value }); } else if (attr.nodeName == 'xmlns') { visibleNamespaces.push({ prefix: '', namespace: attr.value }); } } for (var i = 0; i < len; i++) { var attr = attrs.item(i); if (needNamespaceDefine(attr, isHTML, visibleNamespaces)) { var prefix = attr.prefix || ''; var uri = attr.namespaceURI; addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri); visibleNamespaces.push({ prefix: prefix, namespace: uri }); } serializeToString(attr, buf, isHTML, nodeFilter, visibleNamespaces); } // add namespace for current node if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) { var prefix = node.prefix || ''; var uri = node.namespaceURI; addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri); visibleNamespaces.push({ prefix: prefix, namespace: uri }); } if (child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) { buf.push('>'); //if is cdata child node if (isHTML && /^script$/i.test(nodeName)) { while (child) { if (child.data) { buf.push(child.data); } else { serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice()); } child = child.nextSibling; } } else { while (child) { serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice()); child = child.nextSibling; } } buf.push('</', prefixedNodeName, '>'); } else { buf.push('/>'); } // remove added visible namespaces //visibleNamespaces.length = startVisibleNamespaces; return; case DOCUMENT_NODE: case DOCUMENT_FRAGMENT_NODE: var child = node.firstChild; while (child) { serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice()); child = child.nextSibling; } return; case ATTRIBUTE_NODE: return addSerializedAttribute(buf, node.name, node.value); case TEXT_NODE: /** * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. * If they are needed elsewhere, they must be escaped using either numeric character references or the strings * `&` and `<` respectively. * The right angle bracket (>) may be represented using the string " > ", and must, for compatibility, * be escaped using either `>` or a character reference when it appears in the string `]]>` in content, * when that string is not marking the end of a CDATA section. * * In the content of elements, character data is any string of characters * which does not contain the start-delimiter of any markup * and does not include the CDATA-section-close delimiter, `]]>`. * * @see https://www.w3.org/TR/xml/#NT-CharData * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node */ return buf.push(node.data.replace(/[<&>]/g, _xmlEncoder)); case CDATA_SECTION_NODE: return buf.push('<![CDATA[', node.data, ']]>'); case COMMENT_NODE: return buf.push("<!--", node.data, "-->"); case DOCUMENT_TYPE_NODE: var pubid = node.publicId; var sysid = node.systemId; buf.push('<!DOCTYPE ', node.name); if (pubid) { buf.push(' PUBLIC ', pubid); if (sysid && sysid != '.') { buf.push(' ', sysid); } buf.push('>'); } else if (sysid && sysid != '.') { buf.push(' SYSTEM ', sysid, '>'); } else { var sub = node.internalSubset; if (sub) { buf.push(" [", sub, "]"); } buf.push(">"); } return; case PROCESSING_INSTRUCTION_NODE: return buf.push("<?", node.target, " ", node.data, "?>"); case ENTITY_REFERENCE_NODE: return buf.push('&', node.nodeName, ';'); //case ENTITY_NODE: //case NOTATION_NODE: default: buf.push('??', node.nodeName); } } function _importNode(doc, node, deep) { var node2; switch (node.nodeType) { case ELEMENT_NODE: node2 = node.cloneNode(false); node2.ownerDocument = doc; //var attrs = node2.attributes; //var len = attrs.length; //for(var i=0;i<len;i++){ //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep)); //} case DOCUMENT_FRAGMENT_NODE: break; case ATTRIBUTE_NODE: deep = true; break; //case ENTITY_REFERENCE_NODE: //case PROCESSING_INSTRUCTION_NODE: ////case TEXT_NODE: //case CDATA_SECTION_NODE: //case COMMENT_NODE: // deep = false; // break; //case DOCUMENT_NODE: //case DOCUMENT_TYPE_NODE: //cannot be imported. //case ENTITY_NODE: //case NOTATION_NODE: //can not hit in level3 //default:throw e; } if (!node2) { node2 = node.cloneNode(false); //false } node2.ownerDocument = doc; node2.parentNode = null; if (deep) { var child = node.firstChild; while (child) { node2.appendChild(_importNode(doc, child, deep)); child = child.nextSibling; } } return node2; } // //var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1, // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,}; function _cloneNode(doc, node, deep) { var node2 = new node.constructor(); for (var n in node) { if (Object.prototype.hasOwnProperty.call(node, n)) { var v = node[n]; if (_typeof(v) != "object") { if (v != node2[n]) { node2[n] = v; } } } } if (node.childNodes) { node2.childNodes = new NodeList(); } node2.ownerDocument = doc; switch (node2.nodeType) { case ELEMENT_NODE: var attrs = node.attributes; var attrs2 = node2.attributes = new NamedNodeMap(); var len = attrs.length; attrs2._ownerElement = node2; for (var i = 0; i < len; i++) { node2.setAttributeNode(_cloneNode(doc, attrs.item(i), true)); } break; ; case ATTRIBUTE_NODE: deep = true; } if (deep) { var child = node.firstChild; while (child) { node2.appendChild(_cloneNode(doc, child, deep)); child = child.nextSibling; } } return node2; } function __set__(object, key, value) { object[key] = value; } //do dynamic try { if (Object.defineProperty) { var _getTextContent = function getTextContent(node) { switch (node.nodeType) { case ELEMENT_NODE: case DOCUMENT_FRAGMENT_NODE: var buf = []; node = node.firstChild; while (node) { if (node.nodeType !== 7 && node.nodeType !== 8) { buf.push(_getTextContent(node)); } node = node.nextSibling; } return buf.join(''); default: return node.nodeValue; } }; Object.defineProperty(LiveNodeList.prototype, 'length', { get: function get() { _updateLiveList(this); return this.$$length; } }); Object.defineProperty(Node.prototype, 'textContent', { get: function get() { return _getTextContent(this); }, set: function set(data) { switch (this.nodeType) { case ELEMENT_NODE: case DOCUMENT_FRAGMENT_NODE: while (this.firstChild) { this.removeChild(this.firstChild); } if (data || String(data)) { this.appendChild(this.ownerDocument.createTextNode(data)); } break; default: this.data = data; this.value = data; this.nodeValue = data; } } }); __set__ = function __set__(object, key, value) { //console.log(value) object['$$' + key] = value; }; } } catch (e) {//ie8 } //if(typeof require == 'function'){ exports.DocumentType = DocumentType; exports.DOMException = DOMException; exports.DOMImplementation = DOMImplementation; exports.Element = Element; exports.Node = Node; exports.NodeList = NodeList; exports.XMLSerializer = XMLSerializer; //} /***/ }), /***/ 5661: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var compileHighShaderToProgram = __webpack_require__(97754); var localUniformBit = __webpack_require__(21654); var roundPixelsBit = __webpack_require__(35268); var textureBit = __webpack_require__(37874); var Shader = __webpack_require__(27866); var Texture = __webpack_require__(73782); var warn = __webpack_require__(57371); "use strict"; var GlMeshAdaptor = /*#__PURE__*/function () { function GlMeshAdaptor() { _classCallCheck(this, GlMeshAdaptor); } return _createClass(GlMeshAdaptor, [{ key: "init", value: function init() { var glProgram = compileHighShaderToProgram.compileHighShaderGlProgram({ name: "mesh", bits: [localUniformBit.localUniformBitGl, textureBit.textureBitGl, roundPixelsBit.roundPixelsBitGl] }); this._shader = new Shader.Shader({ glProgram: glProgram, resources: { uTexture: Texture.Texture.EMPTY.source, textureUniforms: { uTextureMatrix: { type: "mat3x3<f32>", value: new Matrix.Matrix() } } } }); } }, { key: "execute", value: function execute(meshPipe, mesh) { var renderer = meshPipe.renderer; var shader = mesh._shader; if (!shader) { shader = this._shader; var texture = mesh.texture; var source = texture.source; shader.resources.uTexture = source; shader.resources.uSampler = source.style; shader.resources.textureUniforms.uniforms.uTextureMatrix = texture.textureMatrix.mapCoord; } else if (!shader.glProgram) { warn.warn("Mesh shader has no glProgram", mesh.shader); return; } shader.groups[100] = renderer.globalUniforms.bindGroup; shader.groups[101] = meshPipe.localUniformsBindGroup; renderer.encoder.draw({ geometry: mesh._geometry, shader: shader, state: mesh.state }); } }, { key: "destroy", value: function destroy() { this._shader.destroy(true); this._shader = null; } }]); }(); GlMeshAdaptor.extension = { type: [Extensions.ExtensionType.WebGLPipesAdaptor], name: "mesh" }; exports.GlMeshAdaptor = GlMeshAdaptor; /***/ }), /***/ 5699: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var PoolGroup = __webpack_require__(47505); var BatchableMesh = __webpack_require__(8781); var NineSliceGeometry = __webpack_require__(31598); "use strict"; var NineSliceSpritePipe = /*#__PURE__*/function () { function NineSliceSpritePipe(renderer) { _classCallCheck(this, NineSliceSpritePipe); this._gpuSpriteHash = /* @__PURE__ */Object.create(null); this._destroyRenderableBound = this.destroyRenderable.bind(this); this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_gpuSpriteHash"); } return _createClass(NineSliceSpritePipe, [{ key: "addRenderable", value: function addRenderable(sprite, instructionSet) { var gpuSprite = this._getGpuSprite(sprite); if (sprite.didViewUpdate) this._updateBatchableSprite(sprite, gpuSprite); this._renderer.renderPipes.batch.addToBatch(gpuSprite, instructionSet); } }, { key: "updateRenderable", value: function updateRenderable(sprite) { var gpuSprite = this._gpuSpriteHash[sprite.uid]; if (sprite.didViewUpdate) this._updateBatchableSprite(sprite, gpuSprite); gpuSprite._batcher.updateElement(gpuSprite); } }, { key: "validateRenderable", value: function validateRenderable(sprite) { var gpuSprite = this._getGpuSprite(sprite); return !gpuSprite._batcher.checkAndUpdateTexture(gpuSprite, sprite._texture); } }, { key: "destroyRenderable", value: function destroyRenderable(sprite) { var batchableMesh = this._gpuSpriteHash[sprite.uid]; PoolGroup.BigPool["return"](batchableMesh.geometry); PoolGroup.BigPool["return"](batchableMesh); this._gpuSpriteHash[sprite.uid] = null; sprite.off("destroyed", this._destroyRenderableBound); } }, { key: "_updateBatchableSprite", value: function _updateBatchableSprite(sprite, batchableSprite) { batchableSprite.geometry.update(sprite); batchableSprite.setTexture(sprite._texture); } }, { key: "_getGpuSprite", value: function _getGpuSprite(sprite) { return this._gpuSpriteHash[sprite.uid] || this._initGPUSprite(sprite); } }, { key: "_initGPUSprite", value: function _initGPUSprite(sprite) { var batchableMesh = PoolGroup.BigPool.get(BatchableMesh.BatchableMesh); batchableMesh.geometry = PoolGroup.BigPool.get(NineSliceGeometry.NineSliceGeometry); batchableMesh.renderable = sprite; batchableMesh.transform = sprite.groupTransform; batchableMesh.texture = sprite._texture; batchableMesh.roundPixels = this._renderer._roundPixels | sprite._roundPixels; this._gpuSpriteHash[sprite.uid] = batchableMesh; if (!sprite.didViewUpdate) { this._updateBatchableSprite(sprite, batchableMesh); } sprite.on("destroyed", this._destroyRenderableBound); return batchableMesh; } }, { key: "destroy", value: function destroy() { for (var i in this._gpuSpriteHash) { var batchableMesh = this._gpuSpriteHash[i]; batchableMesh.geometry.destroy(); } this._gpuSpriteHash = null; this._renderer = null; } }]); }(); /** @ignore */ NineSliceSpritePipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "nineSliceSprite" }; exports.NineSliceSpritePipe = NineSliceSpritePipe; /***/ }), /***/ 6014: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var _const = __webpack_require__(20105); var TickerListener = __webpack_require__(83690); "use strict"; var _Ticker = /*#__PURE__*/function () { function _Ticker() { var _this = this; _classCallCheck(this, _Ticker); /** * Whether or not this ticker should invoke the method * {@link ticker.Ticker#start|start} automatically when a listener is added. */ this.autoStart = false; /** * Scalar time value from last frame to this frame. * This value is capped by setting {@link ticker.Ticker#minFPS|minFPS} * and is scaled with {@link ticker.Ticker#speed|speed}. * **Note:** The cap may be exceeded by scaling. */ this.deltaTime = 1; /** * The last time {@link ticker.Ticker#update|update} was invoked. * This value is also reset internally outside of invoking * update, but only when a new animation frame is requested. * If the platform supports DOMHighResTimeStamp, * this value will have a precision of 1 µs. */ this.lastTime = -1; /** * Factor of current {@link ticker.Ticker#deltaTime|deltaTime}. * @example * // Scales ticker.deltaTime to what would be * // the equivalent of approximately 120 FPS * ticker.speed = 2; */ this.speed = 1; /** * Whether or not this ticker has been started. * `true` if {@link ticker.Ticker#start|start} has been called. * `false` if {@link ticker.Ticker#stop|Stop} has been called. * While `false`, this value may change to `true` in the * event of {@link ticker.Ticker#autoStart|autoStart} being `true` * and a listener is added. */ this.started = false; /** Internal current frame request ID */ this._requestId = null; /** * Internal value managed by minFPS property setter and getter. * This is the maximum allowed milliseconds between updates. */ this._maxElapsedMS = 100; /** * Internal value managed by minFPS property setter and getter. * This is the minimum allowed milliseconds between updates. */ this._minElapsedMS = 0; /** If enabled, deleting is disabled.*/ this._protected = false; /** The last time keyframe was executed. Maintains a relatively fixed interval with the previous value. */ this._lastFrame = -1; this._head = new TickerListener.TickerListener(null, null, Infinity); this.deltaMS = 1 / _Ticker.targetFPMS; this.elapsedMS = 1 / _Ticker.targetFPMS; this._tick = function (time) { _this._requestId = null; if (_this.started) { _this.update(time); if (_this.started && _this._requestId === null && _this._head.next) { _this._requestId = requestAnimationFrame(_this._tick); } } }; } /** * Conditionally requests a new animation frame. * If a frame has not already been requested, and if the internal * emitter has listeners, a new frame is requested. * @private */ return _createClass(_Ticker, [{ key: "_requestIfNeeded", value: function _requestIfNeeded() { if (this._requestId === null && this._head.next) { this.lastTime = performance.now(); this._lastFrame = this.lastTime; this._requestId = requestAnimationFrame(this._tick); } } /** * Conditionally cancels a pending animation frame. * @private */ }, { key: "_cancelIfNeeded", value: function _cancelIfNeeded() { if (this._requestId !== null) { cancelAnimationFrame(this._requestId); this._requestId = null; } } /** * Conditionally requests a new animation frame. * If the ticker has been started it checks if a frame has not already * been requested, and if the internal emitter has listeners. If these * conditions are met, a new frame is requested. If the ticker has not * been started, but autoStart is `true`, then the ticker starts now, * and continues with the previous conditions to request a new frame. * @private */ }, { key: "_startIfPossible", value: function _startIfPossible() { if (this.started) { this._requestIfNeeded(); } else if (this.autoStart) { this.start(); } } /** * Register a handler for tick events. Calls continuously unless * it is removed or the ticker is stopped. * @param fn - The listener function to be added for updates * @param context - The listener context * @param {number} [priority=UPDATE_PRIORITY.NORMAL] - The priority for emitting * @returns This instance of a ticker */ }, { key: "add", value: function add(fn, context) { var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.UPDATE_PRIORITY.NORMAL; return this._addListener(new TickerListener.TickerListener(fn, context, priority)); } /** * Add a handler for the tick event which is only execute once. * @param fn - The listener function to be added for one update * @param context - The listener context * @param {number} [priority=UPDATE_PRIORITY.NORMAL] - The priority for emitting * @returns This instance of a ticker */ }, { key: "addOnce", value: function addOnce(fn, context) { var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.UPDATE_PRIORITY.NORMAL; return this._addListener(new TickerListener.TickerListener(fn, context, priority, true)); } /** * Internally adds the event handler so that it can be sorted by priority. * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run * before the rendering. * @private * @param listener - Current listener being added. * @returns This instance of a ticker */ }, { key: "_addListener", value: function _addListener(listener) { var current = this._head.next; var previous = this._head; if (!current) { listener.connect(previous); } else { while (current) { if (listener.priority > current.priority) { listener.connect(previous); break; } previous = current; current = current.next; } if (!listener.previous) { listener.connect(previous); } } this._startIfPossible(); return this; } /** * Removes any handlers matching the function and context parameters. * If no handlers are left after removing, then it cancels the animation frame. * @param fn - The listener function to be removed * @param context - The listener context to be removed * @returns This instance of a ticker */ }, { key: "remove", value: function remove(fn, context) { var listener = this._head.next; while (listener) { if (listener.match(fn, context)) { listener = listener.destroy(); } else { listener = listener.next; } } if (!this._head.next) { this._cancelIfNeeded(); } return this; } /** * The number of listeners on this ticker, calculated by walking through linked list * @readonly * @member {number} */ }, { key: "count", get: function get() { if (!this._head) { return 0; } var count = 0; var current = this._head; while (current = current.next) { count++; } return count; } /** Starts the ticker. If the ticker has listeners a new animation frame is requested at this point. */ }, { key: "start", value: function start() { if (!this.started) { this.started = true; this._requestIfNeeded(); } } /** Stops the ticker. If the ticker has requested an animation frame it is canceled at this point. */ }, { key: "stop", value: function stop() { if (this.started) { this.started = false; this._cancelIfNeeded(); } } /** Destroy the ticker and don't use after this. Calling this method removes all references to internal events. */ }, { key: "destroy", value: function destroy() { if (!this._protected) { this.stop(); var listener = this._head.next; while (listener) { listener = listener.destroy(true); } this._head.destroy(); this._head = null; } } /** * Triggers an update. An update entails setting the * current {@link ticker.Ticker#elapsedMS|elapsedMS}, * the current {@link ticker.Ticker#deltaTime|deltaTime}, * invoking all listeners with current deltaTime, * and then finally setting {@link ticker.Ticker#lastTime|lastTime} * with the value of currentTime that was provided. * This method will be called automatically by animation * frame callbacks if the ticker instance has been started * and listeners are added. * @param {number} [currentTime=performance.now()] - the current time of execution */ }, { key: "update", value: function update() { var currentTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now(); var elapsedMS; if (currentTime > this.lastTime) { elapsedMS = this.elapsedMS = currentTime - this.lastTime; if (elapsedMS > this._maxElapsedMS) { elapsedMS = this._maxElapsedMS; } elapsedMS *= this.speed; if (this._minElapsedMS) { var delta = currentTime - this._lastFrame | 0; if (delta < this._minElapsedMS) { return; } this._lastFrame = currentTime - delta % this._minElapsedMS; } this.deltaMS = elapsedMS; this.deltaTime = this.deltaMS * _Ticker.targetFPMS; var head = this._head; var listener = head.next; while (listener) { listener = listener.emit(this); } if (!head.next) { this._cancelIfNeeded(); } } else { this.deltaTime = this.deltaMS = this.elapsedMS = 0; } this.lastTime = currentTime; } /** * The frames per second at which this ticker is running. * The default is approximately 60 in most modern browsers. * **Note:** This does not factor in the value of * {@link ticker.Ticker#speed|speed}, which is specific * to scaling {@link ticker.Ticker#deltaTime|deltaTime}. * @member {number} * @readonly */ }, { key: "FPS", get: function get() { return 1e3 / this.elapsedMS; } /** * Manages the maximum amount of milliseconds allowed to * elapse between invoking {@link ticker.Ticker#update|update}. * This value is used to cap {@link ticker.Ticker#deltaTime|deltaTime}, * but does not effect the measured value of {@link ticker.Ticker#FPS|FPS}. * When setting this property it is clamped to a value between * `0` and `Ticker.targetFPMS * 1000`. * @member {number} * @default 10 */ }, { key: "minFPS", get: function get() { return 1e3 / this._maxElapsedMS; }, set: function set(fps) { var minFPS = Math.min(this.maxFPS, fps); var minFPMS = Math.min(Math.max(0, minFPS) / 1e3, _Ticker.targetFPMS); this._maxElapsedMS = 1 / minFPMS; } /** * Manages the minimum amount of milliseconds required to * elapse between invoking {@link ticker.Ticker#update|update}. * This will effect the measured value of {@link ticker.Ticker#FPS|FPS}. * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can. * Otherwise it will be at least `minFPS` * @member {number} * @default 0 */ }, { key: "maxFPS", get: function get() { if (this._minElapsedMS) { return Math.round(1e3 / this._minElapsedMS); } return 0; }, set: function set(fps) { if (fps === 0) { this._minElapsedMS = 0; } else { var maxFPS = Math.max(this.minFPS, fps); this._minElapsedMS = 1 / (maxFPS / 1e3); } } /** * The shared ticker instance used by {@link AnimatedSprite} and by * {@link VideoResource} to update animation frames / video textures. * * It may also be used by {@link Application} if created with the `sharedTicker` option property set to true. * * The property {@link ticker.Ticker#autoStart|autoStart} is set to `true` for this instance. * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker. * @example * import { Ticker } from 'pixi.js'; * * const ticker = Ticker.shared; * // Set this to prevent starting this ticker when listeners are added. * // By default this is true only for the Ticker.shared instance. * ticker.autoStart = false; * * // FYI, call this to ensure the ticker is stopped. It should be stopped * // if you have not attempted to render anything yet. * ticker.stop(); * * // Call this when you are ready for a running shared ticker. * ticker.start(); * @example * import { autoDetectRenderer, Container } from 'pixi.js'; * * // You may use the shared ticker to render... * const renderer = autoDetectRenderer(); * const stage = new Container(); * document.body.appendChild(renderer.view); * ticker.add((time) => renderer.render(stage)); * * // Or you can just update it manually. * ticker.autoStart = false; * ticker.stop(); * const animate = (time) => { * ticker.update(time); * renderer.render(stage); * requestAnimationFrame(animate); * }; * animate(performance.now()); * @member {ticker.Ticker} * @readonly * @static */ }], [{ key: "shared", get: function get() { if (!_Ticker._shared) { var shared = _Ticker._shared = new _Ticker(); shared.autoStart = true; shared._protected = true; } return _Ticker._shared; } /** * The system ticker instance used by {@link BasePrepare} for core timing * functionality that shouldn't usually need to be paused, unlike the `shared` * ticker which drives visual animations and rendering which may want to be paused. * * The property {@link ticker.Ticker#autoStart|autoStart} is set to `true` for this instance. * @member {ticker.Ticker} * @readonly * @static */ }, { key: "system", get: function get() { if (!_Ticker._system) { var system = _Ticker._system = new _Ticker(); system.autoStart = true; system._protected = true; } return _Ticker._system; } }]); }(); /** * Target frames per millisecond. * @static */ _Ticker.targetFPMS = 0.06; var Ticker = _Ticker; exports.Ticker = Ticker; /***/ }), /***/ 6036: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var NOOP = function NOOP() {}; exports.NOOP = NOOP; /***/ }), /***/ 6088: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var adapter = __webpack_require__(72450); "use strict"; function mapFormatToGlInternalFormat(gl, extensions) { var srgb = {}; var bgra8unorm = gl.RGBA; if (!(gl instanceof adapter.DOMAdapter.get().getWebGLRenderingContext())) { srgb = { "rgba8unorm-srgb": gl.SRGB8_ALPHA8, "bgra8unorm-srgb": gl.SRGB8_ALPHA8 }; bgra8unorm = gl.RGBA8; } else if (extensions.srgb) { srgb = { "rgba8unorm-srgb": extensions.srgb.SRGB8_ALPHA8_EXT, "bgra8unorm-srgb": extensions.srgb.SRGB8_ALPHA8_EXT }; } return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({ // 8-bit formats r8unorm: gl.R8, r8snorm: gl.R8_SNORM, r8uint: gl.R8UI, r8sint: gl.R8I, // 16-bit formats r16uint: gl.R16UI, r16sint: gl.R16I, r16float: gl.R16F, rg8unorm: gl.RG8, rg8snorm: gl.RG8_SNORM, rg8uint: gl.RG8UI, rg8sint: gl.RG8I, // 32-bit formats r32uint: gl.R32UI, r32sint: gl.R32I, r32float: gl.R32F, rg16uint: gl.RG16UI, rg16sint: gl.RG16I, rg16float: gl.RG16F, rgba8unorm: gl.RGBA }, srgb), {}, { // Packed 32-bit formats rgba8snorm: gl.RGBA8_SNORM, rgba8uint: gl.RGBA8UI, rgba8sint: gl.RGBA8I, bgra8unorm: bgra8unorm, rgb9e5ufloat: gl.RGB9_E5, rgb10a2unorm: gl.RGB10_A2, rg11b10ufloat: gl.R11F_G11F_B10F, // 64-bit formats rg32uint: gl.RG32UI, rg32sint: gl.RG32I, rg32float: gl.RG32F, rgba16uint: gl.RGBA16UI, rgba16sint: gl.RGBA16I, rgba16float: gl.RGBA16F, // 128-bit formats rgba32uint: gl.RGBA32UI, rgba32sint: gl.RGBA32I, rgba32float: gl.RGBA32F, // Depth/stencil formats stencil8: gl.STENCIL_INDEX8, depth16unorm: gl.DEPTH_COMPONENT16, depth24plus: gl.DEPTH_COMPONENT24, "depth24plus-stencil8": gl.DEPTH24_STENCIL8, depth32float: gl.DEPTH_COMPONENT32F, "depth32float-stencil8": gl.DEPTH32F_STENCIL8 }, extensions.s3tc ? { "bc1-rgba-unorm": extensions.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT, "bc2-rgba-unorm": extensions.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT, "bc3-rgba-unorm": extensions.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT } : {}), extensions.s3tc_sRGB ? { "bc1-rgba-unorm-srgb": extensions.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, "bc2-rgba-unorm-srgb": extensions.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, "bc3-rgba-unorm-srgb": extensions.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT } : {}), extensions.rgtc ? { "bc4-r-unorm": extensions.rgtc.COMPRESSED_RED_RGTC1_EXT, "bc4-r-snorm": extensions.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT, "bc5-rg-unorm": extensions.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT, "bc5-rg-snorm": extensions.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT } : {}), extensions.bptc ? { "bc6h-rgb-float": extensions.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, "bc6h-rgb-ufloat": extensions.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, "bc7-rgba-unorm": extensions.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT, "bc7-rgba-unorm-srgb": extensions.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT } : {}), extensions.etc ? { "etc2-rgb8unorm": extensions.etc.COMPRESSED_RGB8_ETC2, "etc2-rgb8unorm-srgb": extensions.etc.COMPRESSED_SRGB8_ETC2, "etc2-rgb8a1unorm": extensions.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, "etc2-rgb8a1unorm-srgb": extensions.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, "etc2-rgba8unorm": extensions.etc.COMPRESSED_RGBA8_ETC2_EAC, "etc2-rgba8unorm-srgb": extensions.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, "eac-r11unorm": extensions.etc.COMPRESSED_R11_EAC, // 'eac-r11snorm' "eac-rg11unorm": extensions.etc.COMPRESSED_SIGNED_RG11_EAC // 'eac-rg11snorm' } : {}), extensions.astc ? { "astc-4x4-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_4x4_KHR, "astc-4x4-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, "astc-5x4-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_5x4_KHR, "astc-5x4-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, "astc-5x5-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_5x5_KHR, "astc-5x5-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, "astc-6x5-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_6x5_KHR, "astc-6x5-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, "astc-6x6-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_6x6_KHR, "astc-6x6-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, "astc-8x5-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_8x5_KHR, "astc-8x5-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, "astc-8x6-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_8x6_KHR, "astc-8x6-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, "astc-8x8-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_8x8_KHR, "astc-8x8-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, "astc-10x5-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_10x5_KHR, "astc-10x5-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, "astc-10x6-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_10x6_KHR, "astc-10x6-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, "astc-10x8-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_10x8_KHR, "astc-10x8-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, "astc-10x10-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_10x10_KHR, "astc-10x10-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, "astc-12x10-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_12x10_KHR, "astc-12x10-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, "astc-12x12-unorm": extensions.astc.COMPRESSED_RGBA_ASTC_12x12_KHR, "astc-12x12-unorm-srgb": extensions.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR } : {}); } exports.mapFormatToGlInternalFormat = mapFormatToGlInternalFormat; /***/ }), /***/ 6417: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var GraphicsContextSystem = __webpack_require__(40545); "use strict"; var RECURSION_LIMIT = 8; var FLT_EPSILON = 11920929e-14; var PATH_DISTANCE_EPSILON = 1; var curveAngleToleranceEpsilon = 0.01; var mAngleTolerance = 0; function buildAdaptiveQuadratic(points, sX, sY, cp1x, cp1y, eX, eY, smoothness) { var scale = 1; var smoothing = Math.min(0.99, // a value of 1.0 actually inverts smoothing, so we cap it at 0.99 Math.max(0, smoothness !== null && smoothness !== void 0 ? smoothness : GraphicsContextSystem.GraphicsContextSystem.defaultOptions.bezierSmoothness)); var distanceTolerance = (PATH_DISTANCE_EPSILON - smoothing) / scale; distanceTolerance *= distanceTolerance; begin(sX, sY, cp1x, cp1y, eX, eY, points, distanceTolerance); return points; } function begin(sX, sY, cp1x, cp1y, eX, eY, points, distanceTolerance) { recursive(points, sX, sY, cp1x, cp1y, eX, eY, distanceTolerance, 0); points.push(eX, eY); } function recursive(points, x1, y1, x2, y2, x3, y3, distanceTolerance, level) { if (level > RECURSION_LIMIT) { return; } var pi = Math.PI; var x12 = (x1 + x2) / 2; var y12 = (y1 + y2) / 2; var x23 = (x2 + x3) / 2; var y23 = (y2 + y3) / 2; var x123 = (x12 + x23) / 2; var y123 = (y12 + y23) / 2; var dx = x3 - x1; var dy = y3 - y1; var d = Math.abs((x2 - x3) * dy - (y2 - y3) * dx); if (d > FLT_EPSILON) { if (d * d <= distanceTolerance * (dx * dx + dy * dy)) { if (mAngleTolerance < curveAngleToleranceEpsilon) { points.push(x123, y123); return; } var da = Math.abs(Math.atan2(y3 - y2, x3 - x2) - Math.atan2(y2 - y1, x2 - x1)); if (da >= pi) da = 2 * pi - da; if (da < mAngleTolerance) { points.push(x123, y123); return; } } } else { dx = x123 - (x1 + x3) / 2; dy = y123 - (y1 + y3) / 2; if (dx * dx + dy * dy <= distanceTolerance) { points.push(x123, y123); return; } } recursive(points, x1, y1, x12, y12, x123, y123, distanceTolerance, level + 1); recursive(points, x123, y123, x23, y23, x3, y3, distanceTolerance, level + 1); } exports.buildAdaptiveQuadratic = buildAdaptiveQuadratic; /***/ }), /***/ 6455: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function colorToUniform(rgb, alpha, out, offset) { out[offset++] = (rgb >> 16 & 255) / 255; out[offset++] = (rgb >> 8 & 255) / 255; out[offset++] = (rgb & 255) / 255; out[offset++] = alpha; } function color32BitToUniform(abgr, out, offset) { var alpha = (abgr >> 24 & 255) / 255; out[offset++] = (abgr & 255) / 255 * alpha; out[offset++] = (abgr >> 8 & 255) / 255 * alpha; out[offset++] = (abgr >> 16 & 255) / 255 * alpha; out[offset++] = alpha; } exports.color32BitToUniform = color32BitToUniform; exports.colorToUniform = colorToUniform; /***/ }), /***/ 6586: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var fragment = "in vec2 vMaskCoord;\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform sampler2D uMaskTexture;\n\nuniform float uAlpha;\nuniform vec4 uMaskClamp;\nuniform float uInverse;\n\nout vec4 finalColor;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(uMaskClamp.x, vMaskCoord.x) +\n step(uMaskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, uMaskClamp.z) +\n step(vMaskCoord.y, uMaskClamp.w));\n\n // TODO look into why this is needed\n float npmAlpha = uAlpha;\n vec4 original = texture(uTexture, vTextureCoord);\n vec4 masky = texture(uMaskTexture, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n float a = alphaMul * masky.r * npmAlpha * clip;\n\n if (uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n finalColor = original * a;\n}\n"; exports["default"] = fragment; /***/ }), /***/ 6602: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function removeItems(arr, startIdx, removeCount) { var length = arr.length; var i; if (startIdx >= length || removeCount === 0) { return; } removeCount = startIdx + removeCount > length ? length - startIdx : removeCount; var len = length - removeCount; for (i = startIdx; i < len; ++i) { arr[i] = arr[i + removeCount]; } arr.length = len; } exports.removeItems = removeItems; /***/ }), /***/ 6721: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function roundedShapeArc(g, points, radius) { var vecFrom = function vecFrom(p, pp) { var x = pp.x - p.x; var y = pp.y - p.y; var len = Math.sqrt(x * x + y * y); var nx = x / len; var ny = y / len; return { len: len, nx: nx, ny: ny }; }; var sharpCorner = function sharpCorner(i, p) { if (i === 0) { g.moveTo(p.x, p.y); } else { g.lineTo(p.x, p.y); } }; var p1 = points[points.length - 1]; for (var i = 0; i < points.length; i++) { var _p2$radius; var p2 = points[i % points.length]; var pRadius = (_p2$radius = p2.radius) !== null && _p2$radius !== void 0 ? _p2$radius : radius; if (pRadius <= 0) { sharpCorner(i, p2); p1 = p2; continue; } var p3 = points[(i + 1) % points.length]; var v1 = vecFrom(p2, p1); var v2 = vecFrom(p2, p3); if (v1.len < 1e-4 || v2.len < 1e-4) { sharpCorner(i, p2); p1 = p2; continue; } var angle = Math.asin(v1.nx * v2.ny - v1.ny * v2.nx); var radDirection = 1; var drawDirection = false; if (v1.nx * v2.nx - v1.ny * -v2.ny < 0) { if (angle < 0) { angle = Math.PI + angle; } else { angle = Math.PI - angle; radDirection = -1; drawDirection = true; } } else if (angle > 0) { radDirection = -1; drawDirection = true; } var halfAngle = angle / 2; var cRadius = void 0; var lenOut = Math.abs(Math.cos(halfAngle) * pRadius / Math.sin(halfAngle)); if (lenOut > Math.min(v1.len / 2, v2.len / 2)) { lenOut = Math.min(v1.len / 2, v2.len / 2); cRadius = Math.abs(lenOut * Math.sin(halfAngle) / Math.cos(halfAngle)); } else { cRadius = pRadius; } var cX = p2.x + v2.nx * lenOut + -v2.ny * cRadius * radDirection; var cY = p2.y + v2.ny * lenOut + v2.nx * cRadius * radDirection; var startAngle = Math.atan2(v1.ny, v1.nx) + Math.PI / 2 * radDirection; var endAngle = Math.atan2(v2.ny, v2.nx) - Math.PI / 2 * radDirection; if (i === 0) { g.moveTo(cX + Math.cos(startAngle) * cRadius, cY + Math.sin(startAngle) * cRadius); } g.arc(cX, cY, cRadius, startAngle, endAngle, drawDirection); p1 = p2; } } function roundedShapeQuadraticCurve(g, points, radius, smoothness) { var distance = function distance(p1, p2) { return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); }; var pointLerp = function pointLerp(p1, p2, t) { return { x: p1.x + (p2.x - p1.x) * t, y: p1.y + (p2.y - p1.y) * t }; }; var numPoints = points.length; for (var i = 0; i < numPoints; i++) { var _thisPoint$radius; var thisPoint = points[(i + 1) % numPoints]; var pRadius = (_thisPoint$radius = thisPoint.radius) !== null && _thisPoint$radius !== void 0 ? _thisPoint$radius : radius; if (pRadius <= 0) { if (i === 0) { g.moveTo(thisPoint.x, thisPoint.y); } else { g.lineTo(thisPoint.x, thisPoint.y); } continue; } var lastPoint = points[i]; var nextPoint = points[(i + 2) % numPoints]; var lastEdgeLength = distance(lastPoint, thisPoint); var start = void 0; if (lastEdgeLength < 1e-4) { start = thisPoint; } else { var lastOffsetDistance = Math.min(lastEdgeLength / 2, pRadius); start = pointLerp(thisPoint, lastPoint, lastOffsetDistance / lastEdgeLength); } var nextEdgeLength = distance(nextPoint, thisPoint); var end = void 0; if (nextEdgeLength < 1e-4) { end = thisPoint; } else { var nextOffsetDistance = Math.min(nextEdgeLength / 2, pRadius); end = pointLerp(thisPoint, nextPoint, nextOffsetDistance / nextEdgeLength); } if (i === 0) { g.moveTo(start.x, start.y); } else { g.lineTo(start.x, start.y); } g.quadraticCurveTo(thisPoint.x, thisPoint.y, end.x, end.y, smoothness); } } exports.roundedShapeArc = roundedShapeArc; exports.roundedShapeQuadraticCurve = roundedShapeQuadraticCurve; /***/ }), /***/ 6899: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var getTestContext = __webpack_require__(25131); var checkMaxIfStatementsInShader = __webpack_require__(61751); "use strict"; var maxTexturesPerBatchCache = null; function getMaxTexturesPerBatch() { var _gl$getExtension; if (maxTexturesPerBatchCache) return maxTexturesPerBatchCache; var gl = getTestContext.getTestContext(); maxTexturesPerBatchCache = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); maxTexturesPerBatchCache = checkMaxIfStatementsInShader.checkMaxIfStatementsInShader(maxTexturesPerBatchCache, gl); (_gl$getExtension = gl.getExtension("WEBGL_lose_context")) === null || _gl$getExtension === void 0 || _gl$getExtension.loseContext(); return maxTexturesPerBatchCache; } exports.getMaxTexturesPerBatch = getMaxTexturesPerBatch; /***/ }), /***/ 6967: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function multiplyHexColors(color1, color2) { if (color1 === 16777215 || !color2) return color2; if (color2 === 16777215 || !color1) return color1; var r1 = color1 >> 16 & 255; var g1 = color1 >> 8 & 255; var b1 = color1 & 255; var r2 = color2 >> 16 & 255; var g2 = color2 >> 8 & 255; var b2 = color2 & 255; var r = r1 * r2 / 255 | 0; var g = g1 * g2 / 255 | 0; var b = b1 * b2 / 255 | 0; return (r << 16) + (g << 8) + b; } exports.multiplyHexColors = multiplyHexColors; /***/ }), /***/ 7107: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 7224: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var AccessibilitySystem = __webpack_require__(21353); var accessibilityTarget = __webpack_require__(58669); "use strict"; exports.AccessibilitySystem = AccessibilitySystem.AccessibilitySystem; exports.accessibilityTarget = accessibilityTarget.accessibilityTarget; /***/ }), /***/ 7272: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); var VideoSource = __webpack_require__(19782); var detectVideoAlphaMode = __webpack_require__(29501); var getResolutionOfUrl = __webpack_require__(40230); var checkDataUrl = __webpack_require__(36258); var checkExtension = __webpack_require__(59230); var createTexture = __webpack_require__(49698); "use strict"; var validVideoExtensions = [".mp4", ".m4v", ".webm", ".ogg", ".ogv", ".h264", ".avi", ".mov"]; var validVideoMIMEs = validVideoExtensions.map(function (ext) { return "video/".concat(ext.substring(1)); }); function crossOrigin(element, url, crossorigin) { if (crossorigin === void 0 && !url.startsWith("data:")) { element.crossOrigin = determineCrossOrigin(url); } else if (crossorigin !== false) { element.crossOrigin = typeof crossorigin === "string" ? crossorigin : "anonymous"; } } function preloadVideo(element) { return new Promise(function (resolve, reject) { element.addEventListener("canplaythrough", loaded); element.addEventListener("error", error); element.load(); function loaded() { cleanup(); resolve(); } function error(err) { cleanup(); reject(err); } function cleanup() { element.removeEventListener("canplaythrough", loaded); element.removeEventListener("error", error); } }); } function determineCrossOrigin(url) { var loc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalThis.location; if (url.startsWith("data:")) { return ""; } loc || (loc = globalThis.location); var parsedUrl = new URL(url, document.baseURI); if (parsedUrl.hostname !== loc.hostname || parsedUrl.port !== loc.port || parsedUrl.protocol !== loc.protocol) { return "anonymous"; } return ""; } var loadVideoTextures = { name: "loadVideo", extension: { type: Extensions.ExtensionType.LoadParser, name: "loadVideo" }, test: function test(url) { var isValidDataUrl = checkDataUrl.checkDataUrl(url, validVideoMIMEs); var isValidExtension = checkExtension.checkExtension(url, validVideoExtensions); return isValidDataUrl || isValidExtension; }, load: function load(url, asset, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() { var _asset$data, _asset$data2; var options, videoElement, attributeMap, sourceElement, mime, ext, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: _t = _objectSpread; _t2 = _objectSpread({}, VideoSource.VideoSource.defaultOptions); _t3 = {}; _t4 = ((_asset$data = asset.data) === null || _asset$data === void 0 ? void 0 : _asset$data.resolution) || getResolutionOfUrl.getResolutionOfUrl(url); _t5 = (_asset$data2 = asset.data) === null || _asset$data2 === void 0 ? void 0 : _asset$data2.alphaMode; if (_t5) { _context2.n = 2; break; } _context2.n = 1; return detectVideoAlphaMode.detectVideoAlphaMode(); case 1: _t5 = _context2.v; case 2: _t6 = _t5; _t7 = { resolution: _t4, alphaMode: _t6 }; _t8 = asset.data; options = _t(_t2, _t3, _t7, _t8); videoElement = document.createElement("video"); attributeMap = { preload: options.autoLoad !== false ? "auto" : void 0, "webkit-playsinline": options.playsinline !== false ? "" : void 0, playsinline: options.playsinline !== false ? "" : void 0, muted: options.muted === true ? "" : void 0, loop: options.loop === true ? "" : void 0, autoplay: options.autoPlay !== false ? "" : void 0 }; Object.keys(attributeMap).forEach(function (key) { var value = attributeMap[key]; if (value !== void 0) videoElement.setAttribute(key, value); }); if (options.muted === true) { videoElement.muted = true; } crossOrigin(videoElement, url, options.crossorigin); sourceElement = document.createElement("source"); if (url.startsWith("data:")) { mime = url.slice(5, url.indexOf(";")); } else if (!url.startsWith("blob:")) { ext = url.split("?")[0].slice(url.lastIndexOf(".") + 1).toLowerCase(); mime = VideoSource.VideoSource.MIME_TYPES[ext] || "video/".concat(ext); } sourceElement.src = url; if (mime) { sourceElement.type = mime; } return _context2.a(2, new Promise(function (resolve) { var _onCanPlay = /*#__PURE__*/function () { var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var base; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: base = new VideoSource.VideoSource(_objectSpread(_objectSpread({}, options), {}, { resource: videoElement })); videoElement.removeEventListener("canplay", _onCanPlay); if (!asset.data.preload) { _context.n = 1; break; } _context.n = 1; return preloadVideo(videoElement); case 1: resolve(createTexture.createTexture(base, loader, url)); case 2: return _context.a(2); } }, _callee); })); return function onCanPlay() { return _ref.apply(this, arguments); }; }(); videoElement.addEventListener("canplay", _onCanPlay); videoElement.appendChild(sourceElement); })); } }, _callee2); }))(); }, unload: function unload(texture) { texture.destroy(true); } }; exports.crossOrigin = crossOrigin; exports.determineCrossOrigin = determineCrossOrigin; exports.loadVideoTextures = loadVideoTextures; exports.preloadVideo = preloadVideo; /***/ }), /***/ 7407: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var ImageSource = __webpack_require__(80344); var getResolutionOfUrl = __webpack_require__(40230); var checkDataUrl = __webpack_require__(36258); var checkExtension = __webpack_require__(59230); var WorkerManager = __webpack_require__(4480); var LoaderParser = __webpack_require__(96804); var createTexture = __webpack_require__(49698); "use strict"; var validImageExtensions = [".jpeg", ".jpg", ".png", ".webp", ".avif"]; var validImageMIMEs = ["image/jpeg", "image/png", "image/webp", "image/avif"]; function loadImageBitmap(_x, _x2) { return _loadImageBitmap.apply(this, arguments); } function _loadImageBitmap() { _loadImageBitmap = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url, asset) { var _asset$data2; var response, imageBlob; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: _context2.n = 1; return adapter.DOMAdapter.get().fetch(url); case 1: response = _context2.v; if (response.ok) { _context2.n = 2; break; } throw new Error("[loadImageBitmap] Failed to fetch ".concat(url, ": ").concat(response.status, " ").concat(response.statusText)); case 2: _context2.n = 3; return response.blob(); case 3: imageBlob = _context2.v; return _context2.a(2, (asset === null || asset === void 0 || (_asset$data2 = asset.data) === null || _asset$data2 === void 0 ? void 0 : _asset$data2.alphaMode) === "premultiplied-alpha" ? createImageBitmap(imageBlob, { premultiplyAlpha: "none" }) : createImageBitmap(imageBlob)); } }, _callee2); })); return _loadImageBitmap.apply(this, arguments); } var loadTextures = { name: "loadTextures", extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.High, name: "loadTextures" }, config: { preferWorkers: true, preferCreateImageBitmap: true, crossOrigin: "anonymous" }, test: function test(url) { return checkDataUrl.checkDataUrl(url, validImageMIMEs) || checkExtension.checkExtension(url, validImageExtensions); }, load: function load(url, asset, loader) { var _this = this; return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var _asset$data; var src, base, _t; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: src = null; if (!(globalThis.createImageBitmap && _this.config.preferCreateImageBitmap)) { _context.n = 7; break; } _t = _this.config.preferWorkers; if (!_t) { _context.n = 2; break; } _context.n = 1; return WorkerManager.WorkerManager.isImageBitmapSupported(); case 1: _t = _context.v; case 2: if (!_t) { _context.n = 4; break; } _context.n = 3; return WorkerManager.WorkerManager.loadImageBitmap(url, asset); case 3: src = _context.v; _context.n = 6; break; case 4: _context.n = 5; return loadImageBitmap(url, asset); case 5: src = _context.v; case 6: _context.n = 9; break; case 7: _context.n = 8; return new Promise(function (resolve, reject) { src = new Image(); src.crossOrigin = _this.config.crossOrigin; src.src = url; if (src.complete) { resolve(src); } else { src.onload = function () { resolve(src); }; src.onerror = reject; } }); case 8: src = _context.v; case 9: base = new ImageSource.ImageSource(_objectSpread({ resource: src, alphaMode: "premultiply-alpha-on-upload", resolution: ((_asset$data = asset.data) === null || _asset$data === void 0 ? void 0 : _asset$data.resolution) || getResolutionOfUrl.getResolutionOfUrl(url) }, asset.data)); return _context.a(2, createTexture.createTexture(base, loader, url)); } }, _callee); }))(); }, unload: function unload(texture) { texture.destroy(true); } }; exports.loadImageBitmap = loadImageBitmap; exports.loadTextures = loadTextures; /***/ }), /***/ 7705: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var CustomRenderPipe = /*#__PURE__*/function () { function CustomRenderPipe(renderer) { _classCallCheck(this, CustomRenderPipe); this._renderer = renderer; } return _createClass(CustomRenderPipe, [{ key: "updateRenderable", value: function updateRenderable() {} }, { key: "destroyRenderable", value: function destroyRenderable() {} }, { key: "validateRenderable", value: function validateRenderable() { return false; } }, { key: "addRenderable", value: function addRenderable(container, instructionSet) { this._renderer.renderPipes.batch["break"](instructionSet); instructionSet.add(container); } }, { key: "execute", value: function execute(container) { if (!container.isRenderable) return; container.render(this._renderer); } }, { key: "destroy", value: function destroy() { this._renderer = null; } }]); }(); CustomRenderPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "customRender" }; exports.CustomRenderPipe = CustomRenderPipe; /***/ }), /***/ 7888: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var AbstractText = __webpack_require__(93213); var HTMLTextStyle = __webpack_require__(755); var measureHtmlText = __webpack_require__(54748); "use strict"; var HTMLText = /*#__PURE__*/function (_AbstractText$Abstrac) { function HTMLText() { var _this; _classCallCheck(this, HTMLText); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var options = AbstractText.ensureTextOptions(args, "HtmlText"); _this = _callSuper(this, HTMLText, [options, HTMLTextStyle.HTMLTextStyle]); _this.renderPipeId = "htmlText"; return _this; } /** @private */ _inherits(HTMLText, _AbstractText$Abstrac); return _createClass(HTMLText, [{ key: "updateBounds", value: function updateBounds() { var bounds = this._bounds; var anchor = this._anchor; var htmlMeasurement = measureHtmlText.measureHtmlText(this.text, this._style); var width = htmlMeasurement.width, height = htmlMeasurement.height; bounds.minX = -anchor._x * width; bounds.maxX = bounds.minX + width; bounds.minY = -anchor._y * height; bounds.maxY = bounds.minY + height; } }]); }(AbstractText.AbstractText); exports.HTMLText = HTMLText; /***/ }), /***/ 8448: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function resolveCharacters(chars) { if (chars === "") { return []; } if (typeof chars === "string") { chars = [chars]; } var result = []; for (var i = 0, j = chars.length; i < j; i++) { var item = chars[i]; if (Array.isArray(item)) { if (item.length !== 2) { throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got ".concat(item.length, ".")); } if (item[0].length === 0 || item[1].length === 0) { throw new Error("[BitmapFont]: Invalid character delimiter."); } var startCode = item[0].charCodeAt(0); var endCode = item[1].charCodeAt(0); if (endCode < startCode) { throw new Error("[BitmapFont]: Invalid character range."); } for (var i2 = startCode, j2 = endCode; i2 <= j2; i2++) { result.push(String.fromCharCode(i2)); } } else { result.push.apply(result, _toConsumableArray(Array.from(item))); } } if (result.length === 0) { throw new Error("[BitmapFont]: Empty set when resolving characters."); } return result; } exports.resolveCharacters = resolveCharacters; /***/ }), /***/ 8781: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BatchableMesh = /*#__PURE__*/function () { function BatchableMesh() { _classCallCheck(this, BatchableMesh); this.batcherName = "default"; this.packAsQuad = false; this.indexOffset = 0; this.attributeOffset = 0; this.roundPixels = 0; this._batcher = null; this._batch = null; this._textureMatrixUpdateId = -1; this._uvUpdateId = -1; } return _createClass(BatchableMesh, [{ key: "blendMode", get: function get() { return this.renderable.groupBlendMode; } }, { key: "topology", get: function get() { return this._topology || this.geometry.topology; }, set: function set(value) { this._topology = value; } }, { key: "reset", value: function reset() { this.renderable = null; this.texture = null; this._batcher = null; this._batch = null; this.geometry = null; this._uvUpdateId = -1; this._textureMatrixUpdateId = -1; } /** * Sets the texture for the batchable mesh. * As it does so, it resets the texture matrix update ID. * this is to ensure that the texture matrix is recalculated when the uvs are referenced * @param value - The texture to set. */ }, { key: "setTexture", value: function setTexture(value) { if (this.texture === value) return; this.texture = value; this._textureMatrixUpdateId = -1; } }, { key: "uvs", get: function get() { var geometry = this.geometry; var uvBuffer = geometry.getBuffer("aUV"); var uvs = uvBuffer.data; var transformedUvs = uvs; var textureMatrix = this.texture.textureMatrix; if (!textureMatrix.isSimple) { transformedUvs = this._transformedUvs; if (this._textureMatrixUpdateId !== textureMatrix._updateID || this._uvUpdateId !== uvBuffer._updateID) { if (!transformedUvs || transformedUvs.length < uvs.length) { transformedUvs = this._transformedUvs = new Float32Array(uvs.length); } this._textureMatrixUpdateId = textureMatrix._updateID; this._uvUpdateId = uvBuffer._updateID; textureMatrix.multiplyUvs(uvs, transformedUvs); } } return transformedUvs; } }, { key: "positions", get: function get() { return this.geometry.positions; } }, { key: "indices", get: function get() { return this.geometry.indices; } }, { key: "color", get: function get() { return this.renderable.groupColorAlpha; } }, { key: "groupTransform", get: function get() { return this.renderable.groupTransform; } }, { key: "attributeSize", get: function get() { return this.geometry.positions.length / 2; } }, { key: "indexSize", get: function get() { return this.geometry.indices.length; } }]); }(); exports.BatchableMesh = BatchableMesh; /***/ }), /***/ 8948: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var UniformGroup = __webpack_require__(34400); var Texture = __webpack_require__(73782); var Filter = __webpack_require__(92393); var blendTemplate$1 = __webpack_require__(1196); var blendTemplate$2 = __webpack_require__(54807); var blendTemplate = __webpack_require__(83873); "use strict"; var BlendModeFilter = /*#__PURE__*/function (_Filter$Filter) { function BlendModeFilter(options) { _classCallCheck(this, BlendModeFilter); var gpuOptions = options.gpu; var gpuSource = compileBlendModeShader(_objectSpread({ source: blendTemplate["default"] }, gpuOptions)); var gpuProgram = GpuProgram.GpuProgram.from({ vertex: { source: gpuSource, entryPoint: "mainVertex" }, fragment: { source: gpuSource, entryPoint: "mainFragment" } }); var glOptions = options.gl; var glSource = compileBlendModeShader(_objectSpread({ source: blendTemplate$1["default"] }, glOptions)); var glProgram = GlProgram.GlProgram.from({ vertex: blendTemplate$2["default"], fragment: glSource }); var uniformGroup = new UniformGroup.UniformGroup({ uBlend: { value: 1, type: "f32" } }); return _callSuper(this, BlendModeFilter, [{ gpuProgram: gpuProgram, glProgram: glProgram, blendRequired: true, resources: { blendUniforms: uniformGroup, uBackTexture: Texture.Texture.EMPTY } }]); } _inherits(BlendModeFilter, _Filter$Filter); return _createClass(BlendModeFilter); }(Filter.Filter); function compileBlendModeShader(options) { var source = options.source, functions = options.functions, main = options.main; return source.replace("{FUNCTIONS}", functions).replace("{MAIN}", main); } exports.BlendModeFilter = BlendModeFilter; /***/ }), /***/ 8952: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function applyProjectiveTransformationToPlane(width, height, geometry, transformationMatrix) { var buffer = geometry.buffers[0]; var vertices = buffer.data; var verticesX = geometry.verticesX, verticesY = geometry.verticesY; var sizeX = width / (verticesX - 1); var sizeY = height / (verticesY - 1); var index = 0; var a00 = transformationMatrix[0]; var a01 = transformationMatrix[1]; var a02 = transformationMatrix[2]; var a10 = transformationMatrix[3]; var a11 = transformationMatrix[4]; var a12 = transformationMatrix[5]; var a20 = transformationMatrix[6]; var a21 = transformationMatrix[7]; var a22 = transformationMatrix[8]; for (var i = 0; i < vertices.length; i += 2) { var x = index % verticesX * sizeX; var y = (index / verticesX | 0) * sizeY; var newX = a00 * x + a01 * y + a02; var newY = a10 * x + a11 * y + a12; var w = a20 * x + a21 * y + a22; vertices[i] = newX / w; vertices[i + 1] = newY / w; index++; } buffer.update(); } exports.applyProjectiveTransformationToPlane = applyProjectiveTransformationToPlane; /***/ }), /***/ 9012: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["sprite"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Matrix = __webpack_require__(20764); var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var UniformGroup = __webpack_require__(34400); var TextureMatrix = __webpack_require__(82467); var Filter = __webpack_require__(92393); var mask$2 = __webpack_require__(6586); var mask$1 = __webpack_require__(72521); var mask = __webpack_require__(56655); "use strict"; var MaskFilter = /*#__PURE__*/function (_Filter$Filter) { function MaskFilter(options) { var _this; _classCallCheck(this, MaskFilter); var sprite = options.sprite, rest = _objectWithoutProperties(options, _excluded); var textureMatrix = new TextureMatrix.TextureMatrix(sprite.texture); var filterUniforms = new UniformGroup.UniformGroup({ uFilterMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uMaskClamp: { value: textureMatrix.uClampFrame, type: "vec4<f32>" }, uAlpha: { value: 1, type: "f32" }, uInverse: { value: options.inverse ? 1 : 0, type: "f32" } }); var gpuProgram = GpuProgram.GpuProgram.from({ vertex: { source: mask["default"], entryPoint: "mainVertex" }, fragment: { source: mask["default"], entryPoint: "mainFragment" } }); var glProgram = GlProgram.GlProgram.from({ vertex: mask$1["default"], fragment: mask$2["default"], name: "mask-filter" }); _this = _callSuper(this, MaskFilter, [_objectSpread(_objectSpread({}, rest), {}, { gpuProgram: gpuProgram, glProgram: glProgram, resources: { filterUniforms: filterUniforms, uMaskTexture: sprite.texture.source } })]); _this.sprite = sprite; _this._textureMatrix = textureMatrix; return _this; } _inherits(MaskFilter, _Filter$Filter); return _createClass(MaskFilter, [{ key: "inverse", get: function get() { return this.resources.filterUniforms.uniforms.uInverse === 1; }, set: function set(value) { this.resources.filterUniforms.uniforms.uInverse = value ? 1 : 0; } }, { key: "apply", value: function apply(filterManager, input, output, clearMode) { this._textureMatrix.texture = this.sprite.texture; filterManager.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix, this.sprite).prepend(this._textureMatrix.mapCoord); this.resources.uMaskTexture = this.sprite.texture.source; filterManager.applyFilter(this, input, output, clearMode); } }]); }(Filter.Filter); exports.MaskFilter = MaskFilter; /***/ }), /***/ 9154: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var TexturePool = __webpack_require__(53248); var types = __webpack_require__(9634); var Filter = __webpack_require__(92393); var generateBlurGlProgram = __webpack_require__(45299); var generateBlurProgram = __webpack_require__(69177); "use strict"; var _BlurFilterPass = /*#__PURE__*/function (_Filter$Filter) { /** * @param options * @param options.horizontal - Do pass along the x-axis (`true`) or y-axis (`false`). * @param options.strength - The strength of the blur filter. * @param options.quality - The quality of the blur filter. * @param options.kernelSize - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15. */ function _BlurFilterPass(options) { var _this; _classCallCheck(this, _BlurFilterPass); options = _objectSpread(_objectSpread({}, _BlurFilterPass.defaultOptions), options); var glProgram = generateBlurGlProgram.generateBlurGlProgram(options.horizontal, options.kernelSize); var gpuProgram = generateBlurProgram.generateBlurProgram(options.horizontal, options.kernelSize); _this = _callSuper(this, _BlurFilterPass, [_objectSpread({ glProgram: glProgram, gpuProgram: gpuProgram, resources: { blurUniforms: { uStrength: { value: 0, type: "f32" } } } }, options)]); _this.horizontal = options.horizontal; _this._quality = 0; _this.quality = options.quality; _this.blur = options.strength; _this._uniforms = _this.resources.blurUniforms.uniforms; return _this; } /** * Applies the filter. * @param filterManager - The manager. * @param input - The input target. * @param output - The output target. * @param clearMode - How to clear */ _inherits(_BlurFilterPass, _Filter$Filter); return _createClass(_BlurFilterPass, [{ key: "apply", value: function apply(filterManager, input, output, clearMode) { this._uniforms.uStrength = this.strength / this.passes; if (this.passes === 1) { filterManager.applyFilter(this, input, output, clearMode); } else { var tempTexture = TexturePool.TexturePool.getSameSizeTexture(input); var flip = input; var flop = tempTexture; this._state.blend = false; var shouldClear = filterManager.renderer.type === types.RendererType.WEBGPU; for (var i = 0; i < this.passes - 1; i++) { filterManager.applyFilter(this, flip, flop, i === 0 ? true : shouldClear); var temp = flop; flop = flip; flip = temp; } this._state.blend = true; filterManager.applyFilter(this, flip, output, clearMode); TexturePool.TexturePool.returnTexture(tempTexture); } } /** * Sets the strength of both the blur. * @default 16 */ }, { key: "blur", get: function get() { return this.strength; }, set: function set(value) { this.padding = 1 + Math.abs(value) * 2; this.strength = value; } /** * Sets the quality of the blur by modifying the number of passes. More passes means higher * quality blurring but the lower the performance. * @default 4 */ }, { key: "quality", get: function get() { return this._quality; }, set: function set(value) { this._quality = value; this.passes = value; } }]); }(Filter.Filter); /** Default blur filter pass options */ _BlurFilterPass.defaultOptions = { /** The strength of the blur filter. */ strength: 8, /** The quality of the blur filter. */ quality: 4, /** The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15. */ kernelSize: 5 }; var BlurFilterPass = _BlurFilterPass; exports.BlurFilterPass = BlurFilterPass; /***/ }), /***/ 9258: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(59832); var _const = __webpack_require__(33843); "use strict"; function ensureIsBuffer(buffer, index) { if (!(buffer instanceof Buffer.Buffer)) { var usage = index ? _const.BufferUsage.INDEX : _const.BufferUsage.VERTEX; if (buffer instanceof Array) { if (index) { buffer = new Uint32Array(buffer); usage = _const.BufferUsage.INDEX | _const.BufferUsage.COPY_DST; } else { buffer = new Float32Array(buffer); usage = _const.BufferUsage.VERTEX | _const.BufferUsage.COPY_DST; } } buffer = new Buffer.Buffer({ data: buffer, label: index ? "index-mesh-buffer" : "vertex-mesh-buffer", usage: usage }); } return buffer; } exports.ensureIsBuffer = ensureIsBuffer; /***/ }), /***/ 9634: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var RendererType = /* @__PURE__ */function (RendererType2) { RendererType2[RendererType2["WEBGL"] = 1] = "WEBGL"; RendererType2[RendererType2["WEBGPU"] = 2] = "WEBGPU"; RendererType2[RendererType2["BOTH"] = 3] = "BOTH"; return RendererType2; }(RendererType || {}); exports.RendererType = RendererType; /***/ }), /***/ 9773: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var basisTranscoderUrls = { jsUrl: "https://files.pixijs.download/transcoders/basis/basis_transcoder.js", wasmUrl: "https://files.pixijs.download/transcoders/basis/basis_transcoder.wasm" }; function setBasisTranscoderPath(config) { Object.assign(basisTranscoderUrls, config); } exports.basisTranscoderUrls = basisTranscoderUrls; exports.setBasisTranscoderPath = setBasisTranscoderPath; /***/ }), /***/ 9972: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Color = __webpack_require__(98828); var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var UniformGroup = __webpack_require__(34400); var Filter = __webpack_require__(92393); var defaultFilter = __webpack_require__(78440); var colorMatrixFilter$1 = __webpack_require__(79556); var colorMatrixFilter = __webpack_require__(45001); "use strict"; var ColorMatrixFilter = /*#__PURE__*/function (_Filter$Filter) { function ColorMatrixFilter() { var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, ColorMatrixFilter); var colorMatrixUniforms = new UniformGroup.UniformGroup({ uColorMatrix: { value: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], type: "f32", size: 20 }, uAlpha: { value: 1, type: "f32" } }); var gpuProgram = GpuProgram.GpuProgram.from({ vertex: { source: colorMatrixFilter["default"], entryPoint: "mainVertex" }, fragment: { source: colorMatrixFilter["default"], entryPoint: "mainFragment" } }); var glProgram = GlProgram.GlProgram.from({ vertex: defaultFilter["default"], fragment: colorMatrixFilter$1["default"], name: "color-matrix-filter" }); _this = _callSuper(this, ColorMatrixFilter, [_objectSpread(_objectSpread({}, options), {}, { gpuProgram: gpuProgram, glProgram: glProgram, resources: { colorMatrixUniforms: colorMatrixUniforms } })]); _this.alpha = 1; return _this; } /** * Transforms current matrix and set the new one * @param {number[]} matrix - 5x4 matrix * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ _inherits(ColorMatrixFilter, _Filter$Filter); return _createClass(ColorMatrixFilter, [{ key: "_loadMatrix", value: function _loadMatrix(matrix) { var multiply = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var newMatrix = matrix; if (multiply) { this._multiply(newMatrix, this.matrix, matrix); newMatrix = this._colorMatrix(newMatrix); } this.resources.colorMatrixUniforms.uniforms.uColorMatrix = newMatrix; this.resources.colorMatrixUniforms.update(); } /** * Multiplies two mat5's * @private * @param out - 5x4 matrix the receiving matrix * @param a - 5x4 matrix the first operand * @param b - 5x4 matrix the second operand * @returns {number[]} 5x4 matrix */ }, { key: "_multiply", value: function _multiply(out, a, b) { out[0] = a[0] * b[0] + a[1] * b[5] + a[2] * b[10] + a[3] * b[15]; out[1] = a[0] * b[1] + a[1] * b[6] + a[2] * b[11] + a[3] * b[16]; out[2] = a[0] * b[2] + a[1] * b[7] + a[2] * b[12] + a[3] * b[17]; out[3] = a[0] * b[3] + a[1] * b[8] + a[2] * b[13] + a[3] * b[18]; out[4] = a[0] * b[4] + a[1] * b[9] + a[2] * b[14] + a[3] * b[19] + a[4]; out[5] = a[5] * b[0] + a[6] * b[5] + a[7] * b[10] + a[8] * b[15]; out[6] = a[5] * b[1] + a[6] * b[6] + a[7] * b[11] + a[8] * b[16]; out[7] = a[5] * b[2] + a[6] * b[7] + a[7] * b[12] + a[8] * b[17]; out[8] = a[5] * b[3] + a[6] * b[8] + a[7] * b[13] + a[8] * b[18]; out[9] = a[5] * b[4] + a[6] * b[9] + a[7] * b[14] + a[8] * b[19] + a[9]; out[10] = a[10] * b[0] + a[11] * b[5] + a[12] * b[10] + a[13] * b[15]; out[11] = a[10] * b[1] + a[11] * b[6] + a[12] * b[11] + a[13] * b[16]; out[12] = a[10] * b[2] + a[11] * b[7] + a[12] * b[12] + a[13] * b[17]; out[13] = a[10] * b[3] + a[11] * b[8] + a[12] * b[13] + a[13] * b[18]; out[14] = a[10] * b[4] + a[11] * b[9] + a[12] * b[14] + a[13] * b[19] + a[14]; out[15] = a[15] * b[0] + a[16] * b[5] + a[17] * b[10] + a[18] * b[15]; out[16] = a[15] * b[1] + a[16] * b[6] + a[17] * b[11] + a[18] * b[16]; out[17] = a[15] * b[2] + a[16] * b[7] + a[17] * b[12] + a[18] * b[17]; out[18] = a[15] * b[3] + a[16] * b[8] + a[17] * b[13] + a[18] * b[18]; out[19] = a[15] * b[4] + a[16] * b[9] + a[17] * b[14] + a[18] * b[19] + a[19]; return out; } /** * Create a Float32 Array and normalize the offset component to 0-1 * @param {number[]} matrix - 5x4 matrix * @returns {number[]} 5x4 matrix with all values between 0-1 */ }, { key: "_colorMatrix", value: function _colorMatrix(matrix) { var m = new Float32Array(matrix); m[4] /= 255; m[9] /= 255; m[14] /= 255; m[19] /= 255; return m; } /** * Adjusts brightness * @param b - value of the brightness (0-1, where 0 is black) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "brightness", value: function brightness(b, multiply) { var matrix = [b, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Sets each channel on the diagonal of the color matrix. * This can be used to achieve a tinting effect on Containers similar to the tint field of some * display objects like Sprite, Text, Graphics, and Mesh. * @param color - Color of the tint. This is a hex value. * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "tint", value: function tint(color, multiply) { var _Color$Color$shared$s = Color.Color.shared.setValue(color).toArray(), _Color$Color$shared$s2 = _slicedToArray(_Color$Color$shared$s, 3), r = _Color$Color$shared$s2[0], g = _Color$Color$shared$s2[1], b = _Color$Color$shared$s2[2]; var matrix = [r, 0, 0, 0, 0, 0, g, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Set the matrices in grey scales * @param scale - value of the grey (0-1, where 0 is black) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "greyscale", value: function greyscale(scale, multiply) { var matrix = [scale, scale, scale, 0, 0, scale, scale, scale, 0, 0, scale, scale, scale, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * for our american friends! * @param scale * @param multiply */ }, { key: "grayscale", value: function grayscale(scale, multiply) { this.greyscale(scale, multiply); } /** * Set the black and white matrice. * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "blackAndWhite", value: function blackAndWhite(multiply) { var matrix = [0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Set the hue property of the color * @param rotation - in degrees * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "hue", value: function hue(rotation, multiply) { rotation = (rotation || 0) / 180 * Math.PI; var cosR = Math.cos(rotation); var sinR = Math.sin(rotation); var sqrt = Math.sqrt; var w = 1 / 3; var sqrW = sqrt(w); var a00 = cosR + (1 - cosR) * w; var a01 = w * (1 - cosR) - sqrW * sinR; var a02 = w * (1 - cosR) + sqrW * sinR; var a10 = w * (1 - cosR) + sqrW * sinR; var a11 = cosR + w * (1 - cosR); var a12 = w * (1 - cosR) - sqrW * sinR; var a20 = w * (1 - cosR) - sqrW * sinR; var a21 = w * (1 - cosR) + sqrW * sinR; var a22 = cosR + w * (1 - cosR); var matrix = [a00, a01, a02, 0, 0, a10, a11, a12, 0, 0, a20, a21, a22, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Set the contrast matrix, increase the separation between dark and bright * Increase contrast : shadows darker and highlights brighter * Decrease contrast : bring the shadows up and the highlights down * @param amount - value of the contrast (0-1) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "contrast", value: function contrast(amount, multiply) { var v = (amount || 0) + 1; var o = -0.5 * (v - 1); var matrix = [v, 0, 0, 0, o, 0, v, 0, 0, o, 0, 0, v, 0, o, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Set the saturation matrix, increase the separation between colors * Increase saturation : increase contrast, brightness, and sharpness * @param amount - The saturation amount (0-1) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "saturate", value: function saturate() { var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var multiply = arguments.length > 1 ? arguments[1] : undefined; var x = amount * 2 / 3 + 1; var y = (x - 1) * -0.5; var matrix = [x, y, y, 0, 0, y, x, y, 0, 0, y, y, x, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** Desaturate image (remove color) Call the saturate function */ }, { key: "desaturate", value: function desaturate() { this.saturate(-1); } /** * Negative image (inverse of classic rgb matrix) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "negative", value: function negative(multiply) { var matrix = [-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Sepia image * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "sepia", value: function sepia(multiply) { var matrix = [0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Color motion picture process invented in 1916 (thanks Dominic Szablewski) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "technicolor", value: function technicolor(multiply) { var matrix = [1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Polaroid filter * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "polaroid", value: function polaroid(multiply) { var matrix = [1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Filter who transforms : Red -> Blue and Blue -> Red * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "toBGR", value: function toBGR(multiply) { var matrix = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "kodachrome", value: function kodachrome(multiply) { var matrix = [1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Brown delicious browni filter (thanks Dominic Szablewski) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "browni", value: function browni(multiply) { var matrix = [0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Vintage filter (thanks Dominic Szablewski) * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "vintage", value: function vintage(multiply) { var matrix = [0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * We don't know exactly what it does, kind of gradient map, but funny to play with! * @param desaturation - Tone values. * @param toned - Tone values. * @param lightColor - Tone values, example: `0xFFE580` * @param darkColor - Tone values, example: `0xFFE580` * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "colorTone", value: function colorTone(desaturation, toned, lightColor, darkColor, multiply) { desaturation || (desaturation = 0.2); toned || (toned = 0.15); lightColor || (lightColor = 16770432); darkColor || (darkColor = 3375104); var temp = Color.Color.shared; var _temp$setValue$toArra = temp.setValue(lightColor).toArray(), _temp$setValue$toArra2 = _slicedToArray(_temp$setValue$toArra, 3), lR = _temp$setValue$toArra2[0], lG = _temp$setValue$toArra2[1], lB = _temp$setValue$toArra2[2]; var _temp$setValue$toArra3 = temp.setValue(darkColor).toArray(), _temp$setValue$toArra4 = _slicedToArray(_temp$setValue$toArra3, 3), dR = _temp$setValue$toArra4[0], dG = _temp$setValue$toArra4[1], dB = _temp$setValue$toArra4[2]; var matrix = [0.3, 0.59, 0.11, 0, 0, lR, lG, lB, desaturation, 0, dR, dG, dB, toned, 0, lR - dR, lG - dG, lB - dB, 0, 0]; this._loadMatrix(matrix, multiply); } /** * Night effect * @param intensity - The intensity of the night effect. * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "night", value: function night(intensity, multiply) { intensity || (intensity = 0.1); var matrix = [intensity * -2, -intensity, 0, 0, 0, -intensity, 0, intensity, 0, 0, 0, intensity, intensity * 2, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * Predator effect * * Erase the current matrix by setting a new independent one * @param amount - how much the predator feels his future victim * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "predator", value: function predator(amount, multiply) { var matrix = [ // row 1 11.224130630493164 * amount, -4.794486999511719 * amount, -2.8746118545532227 * amount, 0 * amount, 0.40342438220977783 * amount, // row 2 -3.6330697536468506 * amount, 9.193157196044922 * amount, -2.951810836791992 * amount, 0 * amount, -1.316135048866272 * amount, // row 3 -3.2184197902679443 * amount, -4.2375030517578125 * amount, 7.476448059082031 * amount, 0 * amount, 0.8044459223747253 * amount, // row 4 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** * LSD effect * * Multiply the current matrix * @param multiply - if true, current matrix and matrix are multiplied. If false, * just set the current matrix with @param matrix */ }, { key: "lsd", value: function lsd(multiply) { var matrix = [2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, multiply); } /** Erase the current matrix by setting the default one. */ }, { key: "reset", value: function reset() { var matrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]; this._loadMatrix(matrix, false); } /** * The matrix of the color matrix filter * @member {number[]} * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] */ }, { key: "matrix", get: function get() { return this.resources.colorMatrixUniforms.uniforms.uColorMatrix; }, set: function set(value) { this.resources.colorMatrixUniforms.uniforms.uColorMatrix = value; } /** * The opacity value to use when mixing the original and resultant colors. * * When the value is 0, the original color is used without modification. * When the value is 1, the result color is used. * When in the range (0, 1) the color is interpolated between the original and result by this amount. * @default 1 */ }, { key: "alpha", get: function get() { return this.resources.colorMatrixUniforms.uniforms.uAlpha; }, set: function set(value) { this.resources.colorMatrixUniforms.uniforms.uAlpha = value; } }]); }(Filter.Filter); exports.ColorMatrixFilter = ColorMatrixFilter; /***/ }), /***/ 10011: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var GpuStencilModesToPixi = __webpack_require__(25039); var _const = __webpack_require__(15068); "use strict"; var GlStencilSystem = /*#__PURE__*/function () { function GlStencilSystem(renderer) { _classCallCheck(this, GlStencilSystem); this._stencilCache = { enabled: false, stencilReference: 0, stencilMode: _const.STENCIL_MODES.NONE }; this._renderTargetStencilState = /* @__PURE__ */Object.create(null); renderer.renderTarget.onRenderTargetChange.add(this); } return _createClass(GlStencilSystem, [{ key: "contextChange", value: function contextChange(gl) { this._gl = gl; this._comparisonFuncMapping = { always: gl.ALWAYS, never: gl.NEVER, equal: gl.EQUAL, "not-equal": gl.NOTEQUAL, less: gl.LESS, "less-equal": gl.LEQUAL, greater: gl.GREATER, "greater-equal": gl.GEQUAL }; this._stencilOpsMapping = { keep: gl.KEEP, zero: gl.ZERO, replace: gl.REPLACE, invert: gl.INVERT, "increment-clamp": gl.INCR, "decrement-clamp": gl.DECR, "increment-wrap": gl.INCR_WRAP, "decrement-wrap": gl.DECR_WRAP }; this.resetState(); } }, { key: "onRenderTargetChange", value: function onRenderTargetChange(renderTarget) { if (this._activeRenderTarget === renderTarget) return; this._activeRenderTarget = renderTarget; var stencilState = this._renderTargetStencilState[renderTarget.uid]; if (!stencilState) { stencilState = this._renderTargetStencilState[renderTarget.uid] = { stencilMode: _const.STENCIL_MODES.DISABLED, stencilReference: 0 }; } this.setStencilMode(stencilState.stencilMode, stencilState.stencilReference); } }, { key: "resetState", value: function resetState() { this._stencilCache.enabled = false; this._stencilCache.stencilMode = _const.STENCIL_MODES.NONE; this._stencilCache.stencilReference = 0; } }, { key: "setStencilMode", value: function setStencilMode(stencilMode, stencilReference) { var stencilState = this._renderTargetStencilState[this._activeRenderTarget.uid]; var gl = this._gl; var mode = GpuStencilModesToPixi.GpuStencilModesToPixi[stencilMode]; var _stencilCache = this._stencilCache; stencilState.stencilMode = stencilMode; stencilState.stencilReference = stencilReference; if (stencilMode === _const.STENCIL_MODES.DISABLED) { if (this._stencilCache.enabled) { this._stencilCache.enabled = false; gl.disable(gl.STENCIL_TEST); } return; } if (!this._stencilCache.enabled) { this._stencilCache.enabled = true; gl.enable(gl.STENCIL_TEST); } if (stencilMode !== _stencilCache.stencilMode || _stencilCache.stencilReference !== stencilReference) { _stencilCache.stencilMode = stencilMode; _stencilCache.stencilReference = stencilReference; gl.stencilFunc(this._comparisonFuncMapping[mode.stencilBack.compare], stencilReference, 255); gl.stencilOp(gl.KEEP, gl.KEEP, this._stencilOpsMapping[mode.stencilBack.passOp]); } } }]); }(); /** @ignore */ GlStencilSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "stencil" }; exports.GlStencilSystem = GlStencilSystem; /***/ }), /***/ 10026: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function computeAdjugate(out, matrix) { var a00 = matrix[0]; var a01 = matrix[1]; var a02 = matrix[2]; var a10 = matrix[3]; var a11 = matrix[4]; var a12 = matrix[5]; var a20 = matrix[6]; var a21 = matrix[7]; var a22 = matrix[8]; out[0] = a11 * a22 - a12 * a21; out[1] = a02 * a21 - a01 * a22; out[2] = a01 * a12 - a02 * a11; out[3] = a12 * a20 - a10 * a22; out[4] = a00 * a22 - a02 * a20; out[5] = a02 * a10 - a00 * a12; out[6] = a10 * a21 - a11 * a20; out[7] = a01 * a20 - a00 * a21; out[8] = a00 * a11 - a01 * a10; return out; } function multiplyMatrix3x3(out, a, b) { var a00 = a[0]; var a01 = a[1]; var a02 = a[2]; var a10 = a[3]; var a11 = a[4]; var a12 = a[5]; var a20 = a[6]; var a21 = a[7]; var a22 = a[8]; var b00 = b[0]; var b01 = b[1]; var b02 = b[2]; var b10 = b[3]; var b11 = b[4]; var b12 = b[5]; var b20 = b[6]; var b21 = b[7]; var b22 = b[8]; out[0] = b00 * a00 + b01 * a10 + b02 * a20; out[1] = b00 * a01 + b01 * a11 + b02 * a21; out[2] = b00 * a02 + b01 * a12 + b02 * a22; out[3] = b10 * a00 + b11 * a10 + b12 * a20; out[4] = b10 * a01 + b11 * a11 + b12 * a21; out[5] = b10 * a02 + b11 * a12 + b12 * a22; out[6] = b20 * a00 + b21 * a10 + b22 * a20; out[7] = b20 * a01 + b21 * a11 + b22 * a21; out[8] = b20 * a02 + b21 * a12 + b22 * a22; return out; } function multiplyMatrixAndVector(out, m, v) { var x = v[0]; var y = v[1]; var z = v[2]; out[0] = m[0] * x + m[1] * y + m[2] * z; out[1] = m[3] * x + m[4] * y + m[5] * z; out[2] = m[6] * x + m[7] * y + m[8] * z; return out; } var tempMatrix = [0, 0, 0, 0, 0, 0, 0, 0, 0]; var tempVec = [0, 0, 0]; var tempVec2 = [0, 0, 0]; function generateBasisToPointsMatrix(out, x1, y1, x2, y2, x3, y3, x4, y4) { var m = tempMatrix; m[0] = x1; m[1] = x2; m[2] = x3; m[3] = y1; m[4] = y2; m[5] = y3; m[6] = 1; m[7] = 1; m[8] = 1; var adjugateM = computeAdjugate(out, // reusing out as adjugateM is only used once m); tempVec2[0] = x4; tempVec2[1] = y4; tempVec2[2] = 1; var v = multiplyMatrixAndVector(tempVec, adjugateM, tempVec2); var diagonalMatrix = out; out[0] = v[0]; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = v[1]; out[5] = 0; out[6] = 0; out[7] = 0; out[8] = v[2]; return multiplyMatrix3x3(out, diagonalMatrix, m); } var tempSourceMatrix = [0, 0, 0, 0, 0, 0, 0, 0, 0]; var tempDestinationMatrix = [0, 0, 0, 0, 0, 0, 0, 0, 0]; function compute2DProjection(out, x1s, y1s, x1d, y1d, x2s, y2s, x2d, y2d, x3s, y3s, x3d, y3d, x4s, y4s, x4d, y4d) { var sourceMatrix = generateBasisToPointsMatrix(tempSourceMatrix, x1s, y1s, x2s, y2s, x3s, y3s, x4s, y4s); var destinationMatrix = generateBasisToPointsMatrix(tempDestinationMatrix, x1d, y1d, x2d, y2d, x3d, y3d, x4d, y4d); return multiplyMatrix3x3(out, computeAdjugate(sourceMatrix, sourceMatrix), destinationMatrix); } exports.compute2DProjection = compute2DProjection; /***/ }), /***/ 10116: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var Point = __webpack_require__(75544); var BindGroup = __webpack_require__(85156); var Geometry = __webpack_require__(18964); var UniformGroup = __webpack_require__(34400); var Texture = __webpack_require__(73782); var TexturePool = __webpack_require__(53248); var types = __webpack_require__(9634); var Bounds = __webpack_require__(76631); var getRenderableBounds = __webpack_require__(36869); var warn = __webpack_require__(57371); "use strict"; var quadGeometry = new Geometry.Geometry({ attributes: { aPosition: { buffer: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), format: "float32x2", stride: 2 * 4, offset: 0 } }, indexBuffer: new Uint32Array([0, 1, 2, 0, 2, 3]) }); var FilterSystem = /*#__PURE__*/function () { function FilterSystem(renderer) { _classCallCheck(this, FilterSystem); this._filterStackIndex = 0; this._filterStack = []; this._filterGlobalUniforms = new UniformGroup.UniformGroup({ uInputSize: { value: new Float32Array(4), type: "vec4<f32>" }, uInputPixel: { value: new Float32Array(4), type: "vec4<f32>" }, uInputClamp: { value: new Float32Array(4), type: "vec4<f32>" }, uOutputFrame: { value: new Float32Array(4), type: "vec4<f32>" }, uGlobalFrame: { value: new Float32Array(4), type: "vec4<f32>" }, uOutputTexture: { value: new Float32Array(4), type: "vec4<f32>" } }); this._globalFilterBindGroup = new BindGroup.BindGroup({}); this.renderer = renderer; } /** * The back texture of the currently active filter. Requires the filter to have `blendRequired` set to true. * @readonly */ return _createClass(FilterSystem, [{ key: "activeBackTexture", get: function get() { var _this$_activeFilterDa; return (_this$_activeFilterDa = this._activeFilterData) === null || _this$_activeFilterDa === void 0 ? void 0 : _this$_activeFilterDa.backTexture; } }, { key: "push", value: function push(instruction) { var renderer = this.renderer; var filters = instruction.filterEffect.filters; if (!this._filterStack[this._filterStackIndex]) { this._filterStack[this._filterStackIndex] = this._getFilterData(); } var filterData = this._filterStack[this._filterStackIndex]; this._filterStackIndex++; if (filters.length === 0) { filterData.skip = true; return; } var bounds = filterData.bounds; if (instruction.renderables) { getRenderableBounds.getGlobalRenderableBounds(instruction.renderables, bounds); } else if (instruction.filterEffect.filterArea) { bounds.clear(); bounds.addRect(instruction.filterEffect.filterArea); bounds.applyMatrix(instruction.container.worldTransform); } else { instruction.container.getFastGlobalBounds(true, bounds); } if (instruction.container) { var renderGroup = instruction.container.renderGroup || instruction.container.parentRenderGroup; var filterFrameTransform = renderGroup.cacheToLocalTransform; if (filterFrameTransform) { bounds.applyMatrix(filterFrameTransform); } } var colorTextureSource = renderer.renderTarget.renderTarget.colorTexture.source; var resolution = Infinity; var padding = 0; var antialias = true; var blendRequired = false; var enabled = false; var clipToViewport = true; for (var i = 0; i < filters.length; i++) { var _renderer$backBuffer$, _renderer$backBuffer; var filter = filters[i]; resolution = Math.min(resolution, filter.resolution === "inherit" ? colorTextureSource._resolution : filter.resolution); padding += filter.padding; if (filter.antialias === "off") { antialias = false; } else if (filter.antialias === "inherit") { antialias && (antialias = colorTextureSource.antialias); } if (!filter.clipToViewport) { clipToViewport = false; } var isCompatible = !!(filter.compatibleRenderers & renderer.type); if (!isCompatible) { enabled = false; break; } if (filter.blendRequired && !((_renderer$backBuffer$ = (_renderer$backBuffer = renderer.backBuffer) === null || _renderer$backBuffer === void 0 ? void 0 : _renderer$backBuffer.useBackBuffer) !== null && _renderer$backBuffer$ !== void 0 ? _renderer$backBuffer$ : true)) { warn.warn("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."); enabled = false; break; } enabled = filter.enabled || enabled; blendRequired || (blendRequired = filter.blendRequired); } if (!enabled) { filterData.skip = true; return; } if (clipToViewport) { var viewPort = renderer.renderTarget.rootViewPort; var rootResolution = renderer.renderTarget.renderTarget.resolution; bounds.fitBounds(0, viewPort.width / rootResolution, 0, viewPort.height / rootResolution); } bounds.scale(resolution).ceil().scale(1 / resolution).pad(padding | 0); if (!bounds.isPositive) { filterData.skip = true; return; } filterData.skip = false; filterData.bounds = bounds; filterData.blendRequired = blendRequired; filterData.container = instruction.container; filterData.filterEffect = instruction.filterEffect; filterData.previousRenderSurface = renderer.renderTarget.renderSurface; filterData.inputTexture = TexturePool.TexturePool.getOptimalTexture(bounds.width, bounds.height, resolution, antialias); renderer.renderTarget.bind(filterData.inputTexture, true); renderer.globalUniforms.push({ offset: bounds }); } }, { key: "pop", value: function pop() { var renderer = this.renderer; this._filterStackIndex--; var filterData = this._filterStack[this._filterStackIndex]; if (filterData.skip) { return; } this._activeFilterData = filterData; var inputTexture = filterData.inputTexture; var bounds = filterData.bounds; var backTexture = Texture.Texture.EMPTY; renderer.renderTarget.finishRenderPass(); if (filterData.blendRequired) { var previousBounds = this._filterStackIndex > 0 ? this._filterStack[this._filterStackIndex - 1].bounds : null; var renderTarget = renderer.renderTarget.getRenderTarget(filterData.previousRenderSurface); backTexture = this.getBackTexture(renderTarget, bounds, previousBounds); } filterData.backTexture = backTexture; var filters = filterData.filterEffect.filters; this._globalFilterBindGroup.setResource(inputTexture.source.style, 2); this._globalFilterBindGroup.setResource(backTexture.source, 3); renderer.globalUniforms.pop(); if (filters.length === 1) { filters[0].apply(this, inputTexture, filterData.previousRenderSurface, false); TexturePool.TexturePool.returnTexture(inputTexture); } else { var flip = filterData.inputTexture; var flop = TexturePool.TexturePool.getOptimalTexture(bounds.width, bounds.height, flip.source._resolution, false); var i = 0; for (i = 0; i < filters.length - 1; ++i) { var filter = filters[i]; filter.apply(this, flip, flop, true); var t = flip; flip = flop; flop = t; } filters[i].apply(this, flip, filterData.previousRenderSurface, false); TexturePool.TexturePool.returnTexture(flip); TexturePool.TexturePool.returnTexture(flop); } if (filterData.blendRequired) { TexturePool.TexturePool.returnTexture(backTexture); } } }, { key: "getBackTexture", value: function getBackTexture(lastRenderSurface, bounds, previousBounds) { var backgroundResolution = lastRenderSurface.colorTexture.source._resolution; var backTexture = TexturePool.TexturePool.getOptimalTexture(bounds.width, bounds.height, backgroundResolution, false); var x = bounds.minX; var y = bounds.minY; if (previousBounds) { x -= previousBounds.minX; y -= previousBounds.minY; } x = Math.floor(x * backgroundResolution); y = Math.floor(y * backgroundResolution); var width = Math.ceil(bounds.width * backgroundResolution); var height = Math.ceil(bounds.height * backgroundResolution); this.renderer.renderTarget.copyToTexture(lastRenderSurface, backTexture, { x: x, y: y }, { width: width, height: height }, { x: 0, y: 0 }); return backTexture; } }, { key: "applyFilter", value: function applyFilter(filter, input, output, clear) { var renderer = this.renderer; var filterData = this._filterStack[this._filterStackIndex]; var bounds = filterData.bounds; var offset = Point.Point.shared; var previousRenderSurface = filterData.previousRenderSurface; var isFinalTarget = previousRenderSurface === output; var resolution = this.renderer.renderTarget.rootRenderTarget.colorTexture.source._resolution; var currentIndex = this._filterStackIndex - 1; while (currentIndex > 0 && this._filterStack[currentIndex].skip) { --currentIndex; } if (currentIndex > 0) { resolution = this._filterStack[currentIndex].inputTexture.source._resolution; } var filterUniforms = this._filterGlobalUniforms; var uniforms = filterUniforms.uniforms; var outputFrame = uniforms.uOutputFrame; var inputSize = uniforms.uInputSize; var inputPixel = uniforms.uInputPixel; var inputClamp = uniforms.uInputClamp; var globalFrame = uniforms.uGlobalFrame; var outputTexture = uniforms.uOutputTexture; if (isFinalTarget) { var lastIndex = this._filterStackIndex; while (lastIndex > 0) { lastIndex--; var filterData2 = this._filterStack[this._filterStackIndex - 1]; if (!filterData2.skip) { offset.x = filterData2.bounds.minX; offset.y = filterData2.bounds.minY; break; } } outputFrame[0] = bounds.minX - offset.x; outputFrame[1] = bounds.minY - offset.y; } else { outputFrame[0] = 0; outputFrame[1] = 0; } outputFrame[2] = input.frame.width; outputFrame[3] = input.frame.height; inputSize[0] = input.source.width; inputSize[1] = input.source.height; inputSize[2] = 1 / inputSize[0]; inputSize[3] = 1 / inputSize[1]; inputPixel[0] = input.source.pixelWidth; inputPixel[1] = input.source.pixelHeight; inputPixel[2] = 1 / inputPixel[0]; inputPixel[3] = 1 / inputPixel[1]; inputClamp[0] = 0.5 * inputPixel[2]; inputClamp[1] = 0.5 * inputPixel[3]; inputClamp[2] = input.frame.width * inputSize[2] - 0.5 * inputPixel[2]; inputClamp[3] = input.frame.height * inputSize[3] - 0.5 * inputPixel[3]; var rootTexture = this.renderer.renderTarget.rootRenderTarget.colorTexture; globalFrame[0] = offset.x * resolution; globalFrame[1] = offset.y * resolution; globalFrame[2] = rootTexture.source.width * resolution; globalFrame[3] = rootTexture.source.height * resolution; var renderTarget = this.renderer.renderTarget.getRenderTarget(output); renderer.renderTarget.bind(output, !!clear); if (output instanceof Texture.Texture) { outputTexture[0] = output.frame.width; outputTexture[1] = output.frame.height; } else { outputTexture[0] = renderTarget.width; outputTexture[1] = renderTarget.height; } outputTexture[2] = renderTarget.isRoot ? -1 : 1; filterUniforms.update(); if (renderer.renderPipes.uniformBatch) { var batchUniforms = renderer.renderPipes.uniformBatch.getUboResource(filterUniforms); this._globalFilterBindGroup.setResource(batchUniforms, 0); } else { this._globalFilterBindGroup.setResource(filterUniforms, 0); } this._globalFilterBindGroup.setResource(input.source, 1); this._globalFilterBindGroup.setResource(input.source.style, 2); filter.groups[0] = this._globalFilterBindGroup; renderer.encoder.draw({ geometry: quadGeometry, shader: filter, state: filter._state, topology: "triangle-list" }); if (renderer.type === types.RendererType.WEBGL) { renderer.renderTarget.finishRenderPass(); } } }, { key: "_getFilterData", value: function _getFilterData() { return { skip: false, inputTexture: null, bounds: new Bounds.Bounds(), container: null, filterEffect: null, blendRequired: false, previousRenderSurface: null }; } /** * Multiply _input normalized coordinates_ to this matrix to get _sprite texture normalized coordinates_. * * Use `outputMatrix * vTextureCoord` in the shader. * @param outputMatrix - The matrix to output to. * @param {Sprite} sprite - The sprite to map to. * @returns The mapped matrix. */ }, { key: "calculateSpriteMatrix", value: function calculateSpriteMatrix(outputMatrix, sprite) { var data = this._activeFilterData; var mappedMatrix = outputMatrix.set(data.inputTexture._source.width, 0, 0, data.inputTexture._source.height, data.bounds.minX, data.bounds.minY); var worldTransform = sprite.worldTransform.copyTo(Matrix.Matrix.shared); var renderGroup = sprite.renderGroup || sprite.parentRenderGroup; if (renderGroup && renderGroup.cacheToLocalTransform) { worldTransform.prepend(renderGroup.cacheToLocalTransform); } worldTransform.invert(); mappedMatrix.prepend(worldTransform); mappedMatrix.scale(1 / sprite.texture.frame.width, 1 / sprite.texture.frame.height); mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y); return mappedMatrix; } }]); }(); /** @ignore */ FilterSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem], name: "filter" }; exports.FilterSystem = FilterSystem; /***/ }), /***/ 10144: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var getSupportedCompressedTextureFormats = __webpack_require__(2081); "use strict"; var nonCompressedFormats = [ // 8-bit formats "r8unorm", "r8snorm", "r8uint", "r8sint", // 16-bit formats "r16uint", "r16sint", "r16float", "rg8unorm", "rg8snorm", "rg8uint", "rg8sint", // 32-bit formats "r32uint", "r32sint", "r32float", "rg16uint", "rg16sint", "rg16float", "rgba8unorm", "rgba8unorm-srgb", "rgba8snorm", "rgba8uint", "rgba8sint", "bgra8unorm", "bgra8unorm-srgb", // Packed 32-bit formats "rgb9e5ufloat", "rgb10a2unorm", "rg11b10ufloat", // 64-bit formats "rg32uint", "rg32sint", "rg32float", "rgba16uint", "rgba16sint", "rgba16float", // 128-bit formats "rgba32uint", "rgba32sint", "rgba32float", // Depth/stencil formats "stencil8", "depth16unorm", "depth24plus", "depth24plus-stencil8", "depth32float", // "depth32float-stencil8" feature "depth32float-stencil8"]; var supportedTextureFormats; function getSupportedTextureFormats() { return _getSupportedTextureFormats.apply(this, arguments); } function _getSupportedTextureFormats() { _getSupportedTextureFormats = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var compressedTextureFormats; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!(supportedTextureFormats !== void 0)) { _context.n = 1; break; } return _context.a(2, supportedTextureFormats); case 1: _context.n = 2; return getSupportedCompressedTextureFormats.getSupportedCompressedTextureFormats(); case 2: compressedTextureFormats = _context.v; supportedTextureFormats = [].concat(nonCompressedFormats, _toConsumableArray(compressedTextureFormats)); return _context.a(2, supportedTextureFormats); } }, _callee); })); return _getSupportedTextureFormats.apply(this, arguments); } exports.getSupportedTextureFormats = getSupportedTextureFormats; exports.nonCompressedFormats = nonCompressedFormats; /***/ }), /***/ 10377: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Matrix = __webpack_require__(20764); var maxRecommendedTextures = __webpack_require__(6899); var compileHighShaderToProgram = __webpack_require__(97754); var colorBit = __webpack_require__(78786); var generateTextureBatchBit = __webpack_require__(96847); var roundPixelsBit = __webpack_require__(35268); var getBatchSamplersUniformGroup = __webpack_require__(72059); var Shader = __webpack_require__(27866); var UniformGroup = __webpack_require__(34400); var localUniformMSDFBit = __webpack_require__(97018); var mSDFBit = __webpack_require__(85973); "use strict"; var gpuProgram; var glProgram; var SdfShader = /*#__PURE__*/function (_Shader$Shader) { function SdfShader() { _classCallCheck(this, SdfShader); var uniforms = new UniformGroup.UniformGroup({ uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" }, uTransformMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uDistance: { value: 4, type: "f32" }, uRound: { value: 0, type: "f32" } }); var maxTextures = maxRecommendedTextures.getMaxTexturesPerBatch(); gpuProgram !== null && gpuProgram !== void 0 ? gpuProgram : gpuProgram = compileHighShaderToProgram.compileHighShaderGpuProgram({ name: "sdf-shader", bits: [colorBit.colorBit, generateTextureBatchBit.generateTextureBatchBit(maxTextures), localUniformMSDFBit.localUniformMSDFBit, mSDFBit.mSDFBit, roundPixelsBit.roundPixelsBit] }); glProgram !== null && glProgram !== void 0 ? glProgram : glProgram = compileHighShaderToProgram.compileHighShaderGlProgram({ name: "sdf-shader", bits: [colorBit.colorBitGl, generateTextureBatchBit.generateTextureBatchBitGl(maxTextures), localUniformMSDFBit.localUniformMSDFBitGl, mSDFBit.mSDFBitGl, roundPixelsBit.roundPixelsBitGl] }); return _callSuper(this, SdfShader, [{ glProgram: glProgram, gpuProgram: gpuProgram, resources: { localUniforms: uniforms, batchSamplers: getBatchSamplersUniformGroup.getBatchSamplersUniformGroup(maxTextures) } }]); } _inherits(SdfShader, _Shader$Shader); return _createClass(SdfShader); }(Shader.Shader); exports.SdfShader = SdfShader; /***/ }), /***/ 10453: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var vertex = "attribute vec2 aVertex;\nattribute vec2 aUV;\nattribute vec4 aColor;\n\nattribute vec2 aPosition;\nattribute float aRotation;\n\nuniform mat3 uTranslationMatrix;\nuniform float uRound;\nuniform vec2 uResolution;\nuniform vec4 uColor;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n\nvec2 roundPixels(vec2 position, vec2 targetSize)\n{ \n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void){\n float cosRotation = cos(aRotation);\n float sinRotation = sin(aRotation);\n float x = aVertex.x * cosRotation - aVertex.y * sinRotation;\n float y = aVertex.x * sinRotation + aVertex.y * cosRotation;\n\n vec2 v = vec2(x, y);\n v = v + aPosition;\n\n gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n if(uRound == 1.0)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n\n vUV = aUV;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;\n}\n"; exports["default"] = vertex; /***/ }), /***/ 10465: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["parseAsGraphicsContext"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var ImageSource = __webpack_require__(80344); var GraphicsContext = __webpack_require__(59244); var getResolutionOfUrl = __webpack_require__(40230); var checkDataUrl = __webpack_require__(36258); var checkExtension = __webpack_require__(59230); var LoaderParser = __webpack_require__(96804); var createTexture = __webpack_require__(49698); "use strict"; var validSVGExtension = ".svg"; var validSVGMIME = "image/svg+xml"; var loadSvg = { extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.Low, name: "loadSVG" }, name: "loadSVG", config: { crossOrigin: "anonymous", parseAsGraphicsContext: false }, test: function test(url) { return checkDataUrl.checkDataUrl(url, validSVGMIME) || checkExtension.checkExtension(url, validSVGExtension); }, load: function load(url, asset, loader) { var _this = this; return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var _asset$data$parseAsGr, _asset$data; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!((_asset$data$parseAsGr = (_asset$data = asset.data) === null || _asset$data === void 0 ? void 0 : _asset$data.parseAsGraphicsContext) !== null && _asset$data$parseAsGr !== void 0 ? _asset$data$parseAsGr : _this.config.parseAsGraphicsContext)) { _context.n = 1; break; } return _context.a(2, loadAsGraphics(url)); case 1: return _context.a(2, loadAsTexture(url, asset, loader, _this.config.crossOrigin)); } }, _callee); }))(); }, unload: function unload(asset) { asset.destroy(true); } }; function loadAsTexture(_x, _x2, _x3, _x4) { return _loadAsTexture.apply(this, arguments); } function _loadAsTexture() { _loadAsTexture = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url, asset, loader, crossOrigin) { var _asset$data2, _asset$data$width, _asset$data3, _asset$data$height, _asset$data4, _asset$data5; var response, blob, blobUrl, image, canvas, context, resolution, width, height, _ref, _p, rest, base; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: _context2.n = 1; return adapter.DOMAdapter.get().fetch(url); case 1: response = _context2.v; _context2.n = 2; return response.blob(); case 2: blob = _context2.v; blobUrl = URL.createObjectURL(blob); image = new Image(); image.src = blobUrl; image.crossOrigin = crossOrigin; _context2.n = 3; return image.decode(); case 3: URL.revokeObjectURL(blobUrl); canvas = document.createElement("canvas"); context = canvas.getContext("2d"); resolution = ((_asset$data2 = asset.data) === null || _asset$data2 === void 0 ? void 0 : _asset$data2.resolution) || getResolutionOfUrl.getResolutionOfUrl(url); width = (_asset$data$width = (_asset$data3 = asset.data) === null || _asset$data3 === void 0 ? void 0 : _asset$data3.width) !== null && _asset$data$width !== void 0 ? _asset$data$width : image.width; height = (_asset$data$height = (_asset$data4 = asset.data) === null || _asset$data4 === void 0 ? void 0 : _asset$data4.height) !== null && _asset$data$height !== void 0 ? _asset$data$height : image.height; canvas.width = width * resolution; canvas.height = height * resolution; context.drawImage(image, 0, 0, width * resolution, height * resolution); _ref = (_asset$data5 = asset.data) !== null && _asset$data5 !== void 0 ? _asset$data5 : {}, _p = _ref.parseAsGraphicsContext, rest = _objectWithoutProperties(_ref, _excluded); base = new ImageSource.ImageSource(_objectSpread({ resource: canvas, alphaMode: "premultiply-alpha-on-upload", resolution: resolution }, rest)); return _context2.a(2, createTexture.createTexture(base, loader, url)); } }, _callee2); })); return _loadAsTexture.apply(this, arguments); } function loadAsGraphics(_x5) { return _loadAsGraphics.apply(this, arguments); } function _loadAsGraphics() { _loadAsGraphics = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(url) { var response, svgSource, context; return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: _context3.n = 1; return adapter.DOMAdapter.get().fetch(url); case 1: response = _context3.v; _context3.n = 2; return response.text(); case 2: svgSource = _context3.v; context = new GraphicsContext.GraphicsContext(); context.svg(svgSource); return _context3.a(2, context); } }, _callee3); })); return _loadAsGraphics.apply(this, arguments); } exports.loadSvg = loadSvg; /***/ }), /***/ 10485: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } var _const = __webpack_require__(80176); "use strict"; var GlTexture = /*#__PURE__*/_createClass(function GlTexture(texture) { _classCallCheck(this, GlTexture); this.target = _const.GL_TARGETS.TEXTURE_2D; this.texture = texture; this.width = -1; this.height = -1; this.type = _const.GL_TYPES.UNSIGNED_BYTE; this.internalFormat = _const.GL_FORMATS.RGBA; this.format = _const.GL_FORMATS.RGBA; this.samplerType = 0; }); exports.GlTexture = GlTexture; /***/ }), /***/ 10494: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var getAttributeInfoFromFormat = __webpack_require__(63421); "use strict"; var WGSL_TO_VERTEX_TYPES = { f32: "float32", "vec2<f32>": "float32x2", "vec3<f32>": "float32x3", "vec4<f32>": "float32x4", vec2f: "float32x2", vec3f: "float32x3", vec4f: "float32x4", i32: "sint32", "vec2<i32>": "sint32x2", "vec3<i32>": "sint32x3", "vec4<i32>": "sint32x4", u32: "uint32", "vec2<u32>": "uint32x2", "vec3<u32>": "uint32x3", "vec4<u32>": "uint32x4", bool: "uint32", "vec2<bool>": "uint32x2", "vec3<bool>": "uint32x3", "vec4<bool>": "uint32x4" }; function extractAttributesFromGpuProgram(_ref) { var source = _ref.source, entryPoint = _ref.entryPoint; var results = {}; var mainVertStart = source.indexOf("fn ".concat(entryPoint)); if (mainVertStart !== -1) { var arrowFunctionStart = source.indexOf("->", mainVertStart); if (arrowFunctionStart !== -1) { var functionArgsSubstring = source.substring(mainVertStart, arrowFunctionStart); var inputsRegex = /@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g; var match; while ((match = inputsRegex.exec(functionArgsSubstring)) !== null) { var _WGSL_TO_VERTEX_TYPES; var format = (_WGSL_TO_VERTEX_TYPES = WGSL_TO_VERTEX_TYPES[match[3]]) !== null && _WGSL_TO_VERTEX_TYPES !== void 0 ? _WGSL_TO_VERTEX_TYPES : "float32"; results[match[2]] = { location: parseInt(match[1], 10), format: format, stride: getAttributeInfoFromFormat.getAttributeInfoFromFormat(format).stride, offset: 0, instance: false, start: 0 }; } } } return results; } exports.extractAttributesFromGpuProgram = extractAttributesFromGpuProgram; /***/ }), /***/ 10541: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Bounds = __webpack_require__(76631); var getGlobalBounds = __webpack_require__(27182); "use strict"; var tempBounds = new Bounds.Bounds(); var _Culler = /*#__PURE__*/function () { function _Culler() { _classCallCheck(this, _Culler); } return _createClass(_Culler, [{ key: "cull", value: /** * Culls the children of a specific container based on the given view. This will also cull items that are not * being explicitly managed by the culler. * @param container - The container to cull. * @param view - The view rectangle. * @param skipUpdateTransform - Whether to skip updating the transform. */ function cull(container, view) { var skipUpdateTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; this._cullRecursive(container, view, skipUpdateTransform); } }, { key: "_cullRecursive", value: function _cullRecursive(container, view) { var skipUpdateTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; if (container.cullable && container.measurable && container.includeInBuild) { var _container$cullArea; var bounds = (_container$cullArea = container.cullArea) !== null && _container$cullArea !== void 0 ? _container$cullArea : getGlobalBounds.getGlobalBounds(container, skipUpdateTransform, tempBounds); container.culled = bounds.x >= view.x + view.width || bounds.y >= view.y + view.height || bounds.x + bounds.width <= view.x || bounds.y + bounds.height <= view.y; } else { container.culled = false; } if (!container.cullableChildren || container.culled || !container.renderable || !container.measurable || !container.includeInBuild) return; for (var i = 0; i < container.children.length; i++) { this._cullRecursive(container.children[i], view, skipUpdateTransform); } } }]); }(); /** A shared instance of the Culler class. */ _Culler.shared = new _Culler(); var Culler = _Culler; exports.Culler = Culler; /***/ }), /***/ 10816: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Rectangle = __webpack_require__(74731); "use strict"; var Ellipse = /*#__PURE__*/function () { /** * @param x - The X coordinate of the center of this ellipse * @param y - The Y coordinate of the center of this ellipse * @param halfWidth - The half width of this ellipse * @param halfHeight - The half height of this ellipse */ function Ellipse() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var halfWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var halfHeight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; _classCallCheck(this, Ellipse); /** * The type of the object, mainly used to avoid `instanceof` checks * @default 'ellipse' */ this.type = "ellipse"; this.x = x; this.y = y; this.halfWidth = halfWidth; this.halfHeight = halfHeight; } /** * Creates a clone of this Ellipse instance * @returns {Ellipse} A copy of the ellipse */ return _createClass(Ellipse, [{ key: "clone", value: function clone() { return new Ellipse(this.x, this.y, this.halfWidth, this.halfHeight); } /** * Checks whether the x and y coordinates given are contained within this ellipse * @param x - The X coordinate of the point to test * @param y - The Y coordinate of the point to test * @returns Whether the x/y coords are within this ellipse */ }, { key: "contains", value: function contains(x, y) { if (this.halfWidth <= 0 || this.halfHeight <= 0) { return false; } var normx = (x - this.x) / this.halfWidth; var normy = (y - this.y) / this.halfHeight; normx *= normx; normy *= normy; return normx + normy <= 1; } /** * Checks whether the x and y coordinates given are contained within this ellipse including stroke * @param x - The X coordinate of the point to test * @param y - The Y coordinate of the point to test * @param strokeWidth - The width of the line to check * @param alignment - The alignment of the stroke * @returns Whether the x/y coords are within this ellipse */ }, { key: "strokeContains", value: function strokeContains(x, y, strokeWidth) { var alignment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5; var halfWidth = this.halfWidth, halfHeight = this.halfHeight; if (halfWidth <= 0 || halfHeight <= 0) { return false; } var strokeOuterWidth = strokeWidth * (1 - alignment); var strokeInnerWidth = strokeWidth - strokeOuterWidth; var innerHorizontal = halfWidth - strokeInnerWidth; var innerVertical = halfHeight - strokeInnerWidth; var outerHorizontal = halfWidth + strokeOuterWidth; var outerVertical = halfHeight + strokeOuterWidth; var normalizedX = x - this.x; var normalizedY = y - this.y; var innerEllipse = normalizedX * normalizedX / (innerHorizontal * innerHorizontal) + normalizedY * normalizedY / (innerVertical * innerVertical); var outerEllipse = normalizedX * normalizedX / (outerHorizontal * outerHorizontal) + normalizedY * normalizedY / (outerVertical * outerVertical); return innerEllipse > 1 && outerEllipse <= 1; } /** * Returns the framing rectangle of the ellipse as a Rectangle object * @param out * @returns The framing rectangle */ }, { key: "getBounds", value: function getBounds(out) { out || (out = new Rectangle.Rectangle()); out.x = this.x - this.halfWidth; out.y = this.y - this.halfHeight; out.width = this.halfWidth * 2; out.height = this.halfHeight * 2; return out; } /** * Copies another ellipse to this one. * @param ellipse - The ellipse to copy from. * @returns Returns itself. */ }, { key: "copyFrom", value: function copyFrom(ellipse) { this.x = ellipse.x; this.y = ellipse.y; this.halfWidth = ellipse.halfWidth; this.halfHeight = ellipse.halfHeight; return this; } /** * Copies this ellipse to another one. * @param ellipse - The ellipse to copy to. * @returns Returns given parameter. */ }, { key: "copyTo", value: function copyTo(ellipse) { ellipse.copyFrom(this); return ellipse; } }, { key: "toString", value: function toString() { return "[pixi.js/math:Ellipse x=".concat(this.x, " y=").concat(this.y, " halfWidth=").concat(this.halfWidth, " halfHeight=").concat(this.halfHeight, "]"); } }]); }(); exports.Ellipse = Ellipse; /***/ }), /***/ 10829: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); "use strict"; var webworkerExt = { extension: { type: Extensions.ExtensionType.Environment, name: "webworker", priority: 0 }, test: function test() { return typeof self !== "undefined" && self.WorkerGlobalScope !== void 0; }, load: function () { var _load = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return Promise.resolve().then(function () { return __webpack_require__(86325); }); case 1: return _context.a(2); } }, _callee); })); function load() { return _load.apply(this, arguments); } return load; }() }; exports.webworkerExt = webworkerExt; /***/ }), /***/ 10849: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var PrepareUpload = __webpack_require__(75957); "use strict"; var PrepareSystem = /*#__PURE__*/function (_PrepareUpload$Prepar) { function PrepareSystem() { _classCallCheck(this, PrepareSystem); return _callSuper(this, PrepareSystem, arguments); } _inherits(PrepareSystem, _PrepareUpload$Prepar); return _createClass(PrepareSystem, [{ key: "destroy", value: /** Destroys the plugin, don't use after this. */ function destroy() { clearTimeout(this.timeout); this.renderer = null; this.queue = null; this.resolves = null; } }]); }(PrepareUpload.PrepareUpload); /** @ignore */ PrepareSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem], name: "prepare" }; exports.PrepareSystem = PrepareSystem; /***/ }), /***/ 10927: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["render"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var ViewContainer = __webpack_require__(23804); "use strict"; var RenderContainer = /*#__PURE__*/function (_ViewContainer$ViewCo) { /** * @param options - The options for the container. */ function RenderContainer(options) { var _options$containsPoin, _options$addBounds; var _this; _classCallCheck(this, RenderContainer); if (typeof options === "function") { options = { render: options }; } var _options = options, render = _options.render, rest = _objectWithoutProperties(_options, _excluded); _this = _callSuper(this, RenderContainer, [_objectSpread({ label: "RenderContainer" }, rest)]); _this.renderPipeId = "customRender"; _this.batched = false; if (render) _this.render = render; _this.containsPoint = (_options$containsPoin = options.containsPoint) !== null && _options$containsPoin !== void 0 ? _options$containsPoin : function () { return false; }; _this.addBounds = (_options$addBounds = options.addBounds) !== null && _options$addBounds !== void 0 ? _options$addBounds : function () { return false; }; return _this; } /** @private */ _inherits(RenderContainer, _ViewContainer$ViewCo); return _createClass(RenderContainer, [{ key: "updateBounds", value: function updateBounds() { this._bounds.clear(); this.addBounds(this._bounds); } /** * An overridable function that can be used to render the object using the current renderer. * @param _renderer - The current renderer */ }, { key: "render", value: function render(_renderer) {} }]); }(ViewContainer.ViewContainer); exports.RenderContainer = RenderContainer; /***/ }), /***/ 10983: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 11225: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var warnings = {}; var v8_0_0 = "8.0.0"; var v8_3_4 = "8.3.4"; function deprecation(version, message) { var ignoreDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3; if (warnings[message]) { return; } var stack = new Error().stack; if (typeof stack === "undefined") { console.warn("PixiJS Deprecation Warning: ", "".concat(message, "\nDeprecated since v").concat(version)); } else { stack = stack.split("\n").splice(ignoreDepth).join("\n"); if (console.groupCollapsed) { console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s", "color:#614108;background:#fffbe6", "font-weight:normal;color:#614108;background:#fffbe6", "".concat(message, "\nDeprecated since v").concat(version)); console.warn(stack); console.groupEnd(); } else { console.warn("PixiJS Deprecation Warning: ", "".concat(message, "\nDeprecated since v").concat(version)); console.warn(stack); } } warnings[message] = true; } exports.deprecation = deprecation; exports.v8_0_0 = v8_0_0; exports.v8_3_4 = v8_3_4; /***/ }), /***/ 11519: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Application = __webpack_require__(34453); var ResizePlugin = __webpack_require__(27628); var TickerPlugin = __webpack_require__(47054); "use strict"; exports.Application = Application.Application; exports.ResizePlugin = ResizePlugin.ResizePlugin; exports.TickerPlugin = TickerPlugin.TickerPlugin; /***/ }), /***/ 11556: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function getOrientationOfPoints(points) { var m = points.length; if (m < 6) { return 1; } var area = 0; for (var i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2) { var x2 = points[i]; var y2 = points[i + 1]; area += (x2 - x1) * (y2 + y1); x1 = x2; y1 = y2; } if (area < 0) { return -1; } return 1; } exports.getOrientationOfPoints = getOrientationOfPoints; /***/ }), /***/ 12026: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var warn = __webpack_require__(57371); var ensureAttributes = __webpack_require__(85855); var _const = __webpack_require__(15068); var createIdFromString = __webpack_require__(79471); var GpuStencilModesToPixi = __webpack_require__(25039); "use strict"; var topologyStringToId = { "point-list": 0, "line-list": 1, "line-strip": 2, "triangle-list": 3, "triangle-strip": 4 }; function getGraphicsStateKey(geometryLayout, shaderKey, state, blendMode, topology) { return geometryLayout << 24 | shaderKey << 16 | state << 10 | blendMode << 5 | topology; } function getGlobalStateKey(stencilStateId, multiSampleCount, colorMask, renderTarget) { return colorMask << 6 | stencilStateId << 3 | renderTarget << 1 | multiSampleCount; } var PipelineSystem = /*#__PURE__*/function () { function PipelineSystem(renderer) { _classCallCheck(this, PipelineSystem); this._moduleCache = /* @__PURE__ */Object.create(null); this._bufferLayoutsCache = /* @__PURE__ */Object.create(null); this._bindingNamesCache = /* @__PURE__ */Object.create(null); this._pipeCache = /* @__PURE__ */Object.create(null); this._pipeStateCaches = /* @__PURE__ */Object.create(null); this._colorMask = 15; this._multisampleCount = 1; this._renderer = renderer; } return _createClass(PipelineSystem, [{ key: "contextChange", value: function contextChange(gpu) { this._gpu = gpu; this.setStencilMode(_const.STENCIL_MODES.DISABLED); this._updatePipeHash(); } }, { key: "setMultisampleCount", value: function setMultisampleCount(multisampleCount) { if (this._multisampleCount === multisampleCount) return; this._multisampleCount = multisampleCount; this._updatePipeHash(); } }, { key: "setRenderTarget", value: function setRenderTarget(renderTarget) { this._multisampleCount = renderTarget.msaaSamples; this._depthStencilAttachment = renderTarget.descriptor.depthStencilAttachment ? 1 : 0; this._updatePipeHash(); } }, { key: "setColorMask", value: function setColorMask(colorMask) { if (this._colorMask === colorMask) return; this._colorMask = colorMask; this._updatePipeHash(); } }, { key: "setStencilMode", value: function setStencilMode(stencilMode) { if (this._stencilMode === stencilMode) return; this._stencilMode = stencilMode; this._stencilState = GpuStencilModesToPixi.GpuStencilModesToPixi[stencilMode]; this._updatePipeHash(); } }, { key: "setPipeline", value: function setPipeline(geometry, program, state, passEncoder) { var pipeline = this.getPipeline(geometry, program, state); passEncoder.setPipeline(pipeline); } }, { key: "getPipeline", value: function getPipeline(geometry, program, state, topology) { if (!geometry._layoutKey) { ensureAttributes.ensureAttributes(geometry, program.attributeData); this._generateBufferKey(geometry); } topology || (topology = geometry.topology); var key = getGraphicsStateKey(geometry._layoutKey, program._layoutKey, state.data, state._blendModeId, topologyStringToId[topology]); if (this._pipeCache[key]) return this._pipeCache[key]; this._pipeCache[key] = this._createPipeline(geometry, program, state, topology); return this._pipeCache[key]; } }, { key: "_createPipeline", value: function _createPipeline(geometry, program, state, topology) { var device = this._gpu.device; var buffers = this._createVertexBufferLayouts(geometry, program); var blendModes = this._renderer.state.getColorTargets(state); blendModes[0].writeMask = this._stencilMode === _const.STENCIL_MODES.RENDERING_MASK_ADD ? 0 : this._colorMask; var layout = this._renderer.shader.getProgramData(program).pipeline; var descriptor = { // TODO later check if its helpful to create.. // layout, vertex: { module: this._getModule(program.vertex.source), entryPoint: program.vertex.entryPoint, // geometry.. buffers: buffers }, fragment: { module: this._getModule(program.fragment.source), entryPoint: program.fragment.entryPoint, targets: blendModes }, primitive: { topology: topology, cullMode: state.cullMode }, layout: layout, multisample: { count: this._multisampleCount }, // depthStencil, label: "PIXI Pipeline" }; if (this._depthStencilAttachment) { descriptor.depthStencil = _objectSpread(_objectSpread({}, this._stencilState), {}, { format: "depth24plus-stencil8", depthWriteEnabled: state.depthTest, depthCompare: state.depthTest ? "less" : "always" }); } var pipeline = device.createRenderPipeline(descriptor); return pipeline; } }, { key: "_getModule", value: function _getModule(code) { return this._moduleCache[code] || this._createModule(code); } }, { key: "_createModule", value: function _createModule(code) { var device = this._gpu.device; this._moduleCache[code] = device.createShaderModule({ code: code }); return this._moduleCache[code]; } }, { key: "_generateBufferKey", value: function _generateBufferKey(geometry) { var keyGen = []; var index = 0; var attributeKeys = Object.keys(geometry.attributes).sort(); for (var i = 0; i < attributeKeys.length; i++) { var attribute = geometry.attributes[attributeKeys[i]]; keyGen[index++] = attribute.offset; keyGen[index++] = attribute.format; keyGen[index++] = attribute.stride; keyGen[index++] = attribute.instance; } var stringKey = keyGen.join("|"); geometry._layoutKey = createIdFromString.createIdFromString(stringKey, "geometry"); return geometry._layoutKey; } }, { key: "_generateAttributeLocationsKey", value: function _generateAttributeLocationsKey(program) { var keyGen = []; var index = 0; var attributeKeys = Object.keys(program.attributeData).sort(); for (var i = 0; i < attributeKeys.length; i++) { var attribute = program.attributeData[attributeKeys[i]]; keyGen[index++] = attribute.location; } var stringKey = keyGen.join("|"); program._attributeLocationsKey = createIdFromString.createIdFromString(stringKey, "programAttributes"); return program._attributeLocationsKey; } /** * Returns a hash of buffer names mapped to bind locations. * This is used to bind the correct buffer to the correct location in the shader. * @param geometry - The geometry where to get the buffer names * @param program - The program where to get the buffer names * @returns An object of buffer names mapped to the bind location. */ }, { key: "getBufferNamesToBind", value: function getBufferNamesToBind(geometry, program) { var key = geometry._layoutKey << 16 | program._attributeLocationsKey; if (this._bindingNamesCache[key]) return this._bindingNamesCache[key]; var data = this._createVertexBufferLayouts(geometry, program); var bufferNamesToBind = /* @__PURE__ */Object.create(null); var attributeData = program.attributeData; for (var i = 0; i < data.length; i++) { var attributes = Object.values(data[i].attributes); var shaderLocation = attributes[0].shaderLocation; for (var j in attributeData) { if (attributeData[j].location === shaderLocation) { bufferNamesToBind[i] = j; break; } } } this._bindingNamesCache[key] = bufferNamesToBind; return bufferNamesToBind; } }, { key: "_createVertexBufferLayouts", value: function _createVertexBufferLayouts(geometry, program) { if (!program._attributeLocationsKey) this._generateAttributeLocationsKey(program); var key = geometry._layoutKey << 16 | program._attributeLocationsKey; if (this._bufferLayoutsCache[key]) { return this._bufferLayoutsCache[key]; } var vertexBuffersLayout = []; geometry.buffers.forEach(function (buffer) { var bufferEntry = { arrayStride: 0, stepMode: "vertex", attributes: [] }; var bufferEntryAttributes = bufferEntry.attributes; for (var i in program.attributeData) { var _attribute$divisor; var attribute = geometry.attributes[i]; if (((_attribute$divisor = attribute.divisor) !== null && _attribute$divisor !== void 0 ? _attribute$divisor : 1) !== 1) { warn.warn("Attribute ".concat(i, " has an invalid divisor value of '").concat(attribute.divisor, "'. WebGPU only supports a divisor value of 1")); } if (attribute.buffer === buffer) { bufferEntry.arrayStride = attribute.stride; bufferEntry.stepMode = attribute.instance ? "instance" : "vertex"; bufferEntryAttributes.push({ shaderLocation: program.attributeData[i].location, offset: attribute.offset, format: attribute.format }); } } if (bufferEntryAttributes.length) { vertexBuffersLayout.push(bufferEntry); } }); this._bufferLayoutsCache[key] = vertexBuffersLayout; return vertexBuffersLayout; } }, { key: "_updatePipeHash", value: function _updatePipeHash() { var key = getGlobalStateKey(this._stencilMode, this._multisampleCount, this._colorMask, this._depthStencilAttachment); if (!this._pipeStateCaches[key]) { this._pipeStateCaches[key] = /* @__PURE__ */Object.create(null); } this._pipeCache = this._pipeStateCaches[key]; } }, { key: "destroy", value: function destroy() { this._renderer = null; this._bufferLayoutsCache = null; } }]); }(); /** @ignore */ PipelineSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "pipeline" }; exports.PipelineSystem = PipelineSystem; /***/ }), /***/ 12435: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var loadTextures = __webpack_require__(7407); var Resolver = __webpack_require__(54080); "use strict"; var resolveTextureUrl = { extension: { type: Extensions.ExtensionType.ResolveParser, name: "resolveTexture" }, test: loadTextures.loadTextures.test, parse: function parse(value) { var _Resolver$Resolver$RE, _Resolver$Resolver$RE2; return { resolution: parseFloat((_Resolver$Resolver$RE = (_Resolver$Resolver$RE2 = Resolver.Resolver.RETINA_PREFIX.exec(value)) === null || _Resolver$Resolver$RE2 === void 0 ? void 0 : _Resolver$Resolver$RE2[1]) !== null && _Resolver$Resolver$RE !== void 0 ? _Resolver$Resolver$RE : "1"), format: value.split(".").pop(), src: value }; } }; exports.resolveTextureUrl = resolveTextureUrl; /***/ }), /***/ 12980: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var spritesheetAsset = __webpack_require__(44622); "use strict"; Extensions.extensions.add(spritesheetAsset.spritesheetAsset); /***/ }), /***/ 13281: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function extractInputs(fragmentSource, out) { var match; var regex = /@in\s+([^;]+);/g; while ((match = regex.exec(fragmentSource)) !== null) { out.push(match[1]); } } function compileInputs(fragments, template) { var sort = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var results = []; extractInputs(template, results); fragments.forEach(function (fragment) { if (fragment.header) { extractInputs(fragment.header, results); } }); var mainInput = results; if (sort) { mainInput.sort(); } var finalString = mainInput.map(function (inValue, i) { return " @location(".concat(i, ") ").concat(inValue, ","); }).join("\n"); var cleanedString = template.replace(/@in\s+[^;]+;\s*/g, ""); cleanedString = cleanedString.replace("{{in}}", "\n".concat(finalString, "\n")); return cleanedString; } exports.compileInputs = compileInputs; /***/ }), /***/ 13714: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function testImageFormat(_x) { return _testImageFormat.apply(this, arguments); } function _testImageFormat() { _testImageFormat = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(imageData) { var blob, _t; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!("Image" in globalThis)) { _context.n = 1; break; } return _context.a(2, new Promise(function (resolve) { var image = new Image(); image.onload = function () { resolve(true); }; image.onerror = function () { resolve(false); }; image.src = imageData; })); case 1: if (!("createImageBitmap" in globalThis && "fetch" in globalThis)) { _context.n = 8; break; } _context.p = 2; _context.n = 3; return fetch(imageData); case 3: _context.n = 4; return _context.v.blob(); case 4: blob = _context.v; _context.n = 5; return createImageBitmap(blob); case 5: _context.n = 7; break; case 6: _context.p = 6; _t = _context.v; return _context.a(2, false); case 7: return _context.a(2, true); case 8: return _context.a(2, false); } }, _callee, null, [[2, 6]]); })); return _testImageFormat.apply(this, arguments); } exports.testImageFormat = testImageFormat; /***/ }), /***/ 13798: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Container = __webpack_require__(47719); var addMaskBounds = __webpack_require__(30597); var addMaskLocalBounds = __webpack_require__(82132); "use strict"; var StencilMask = /*#__PURE__*/function () { function StencilMask(options) { _classCallCheck(this, StencilMask); this.priority = 0; this.pipe = "stencilMask"; if (options !== null && options !== void 0 && options.mask) { this.init(options.mask); } } return _createClass(StencilMask, [{ key: "init", value: function init(mask) { this.mask = mask; this.mask.includeInBuild = false; this.mask.measurable = false; } }, { key: "reset", value: function reset() { this.mask.measurable = true; this.mask.includeInBuild = true; this.mask = null; } }, { key: "addBounds", value: function addBounds(bounds, skipUpdateTransform) { addMaskBounds.addMaskBounds(this.mask, bounds, skipUpdateTransform); } }, { key: "addLocalBounds", value: function addLocalBounds(bounds, localRoot) { addMaskLocalBounds.addMaskLocalBounds(this.mask, bounds, localRoot); } }, { key: "containsPoint", value: function containsPoint(point, hitTestFn) { var mask = this.mask; return hitTestFn(mask, point); } }, { key: "destroy", value: function destroy() { this.reset(); } }], [{ key: "test", value: function test(mask) { return mask instanceof Container.Container; } }]); }(); StencilMask.extension = Extensions.ExtensionType.MaskEffect; exports.StencilMask = StencilMask; /***/ }), /***/ 13864: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var glUploadImageResource = { id: "image", upload: function upload(source, glTexture, gl, webGLVersion) { var glWidth = glTexture.width; var glHeight = glTexture.height; var textureWidth = source.pixelWidth; var textureHeight = source.pixelHeight; var resourceWidth = source.resourceWidth; var resourceHeight = source.resourceHeight; if (resourceWidth < textureWidth || resourceHeight < textureHeight) { if (glWidth !== textureWidth || glHeight !== textureHeight) { gl.texImage2D(glTexture.target, 0, glTexture.internalFormat, textureWidth, textureHeight, 0, glTexture.format, glTexture.type, null); } if (webGLVersion === 2) { gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, resourceWidth, resourceHeight, glTexture.format, glTexture.type, source.resource); } else { gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, glTexture.format, glTexture.type, source.resource); } } else if (glWidth === textureWidth && glHeight === textureHeight) { gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, glTexture.format, glTexture.type, source.resource); } else if (webGLVersion === 2) { gl.texImage2D(glTexture.target, 0, glTexture.internalFormat, textureWidth, textureHeight, 0, glTexture.format, glTexture.type, source.resource); } else { gl.texImage2D(glTexture.target, 0, glTexture.internalFormat, glTexture.format, glTexture.type, source.resource); } glTexture.width = textureWidth; glTexture.height = textureHeight; } }; exports.glUploadImageResource = glUploadImageResource; /***/ }), /***/ 14075: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var addBits = __webpack_require__(88750); var compileHooks = __webpack_require__(33102); var compileInputs = __webpack_require__(13281); var compileOutputs = __webpack_require__(32012); var injectBits = __webpack_require__(22880); "use strict"; var cacheMap = /* @__PURE__ */Object.create(null); var bitCacheMap = /* @__PURE__ */new Map(); var CACHE_UID = 0; function compileHighShader(_ref) { var template = _ref.template, bits = _ref.bits; var cacheId = generateCacheId(template, bits); if (cacheMap[cacheId]) return cacheMap[cacheId]; var _compileInputsAndOutp = compileInputsAndOutputs(template, bits), vertex = _compileInputsAndOutp.vertex, fragment = _compileInputsAndOutp.fragment; cacheMap[cacheId] = compileBits(vertex, fragment, bits); return cacheMap[cacheId]; } function compileHighShaderGl(_ref2) { var template = _ref2.template, bits = _ref2.bits; var cacheId = generateCacheId(template, bits); if (cacheMap[cacheId]) return cacheMap[cacheId]; cacheMap[cacheId] = compileBits(template.vertex, template.fragment, bits); return cacheMap[cacheId]; } function compileInputsAndOutputs(template, bits) { var vertexFragments = bits.map(function (shaderBit) { return shaderBit.vertex; }).filter(function (v) { return !!v; }); var fragmentFragments = bits.map(function (shaderBit) { return shaderBit.fragment; }).filter(function (v) { return !!v; }); var compiledVertex = compileInputs.compileInputs(vertexFragments, template.vertex, true); compiledVertex = compileOutputs.compileOutputs(vertexFragments, compiledVertex); var compiledFragment = compileInputs.compileInputs(fragmentFragments, template.fragment, true); return { vertex: compiledVertex, fragment: compiledFragment }; } function generateCacheId(template, bits) { return bits.map(function (highFragment) { if (!bitCacheMap.has(highFragment)) { bitCacheMap.set(highFragment, CACHE_UID++); } return bitCacheMap.get(highFragment); }).sort(function (a, b) { return a - b; }).join("-") + template.vertex + template.fragment; } function compileBits(vertex, fragment, bits) { var vertexParts = compileHooks.compileHooks(vertex); var fragmentParts = compileHooks.compileHooks(fragment); bits.forEach(function (shaderBit) { addBits.addBits(shaderBit.vertex, vertexParts, shaderBit.name); addBits.addBits(shaderBit.fragment, fragmentParts, shaderBit.name); }); return { vertex: injectBits.injectBits(vertex, vertexParts), fragment: injectBits.injectBits(fragment, fragmentParts) }; } exports.compileHighShader = compileHighShader; exports.compileHighShaderGl = compileHighShaderGl; /***/ }), /***/ 14233: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.calcBenchmark = calcBenchmark; exports["default"] = void 0; var _BrowserRules = _interopRequireDefault(__webpack_require__(27244)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * * @param rulesheet * @param {string=} userAgent */ function BrowserDetector(rulesheet, userAgent) { this.au = userAgent || (__webpack_require__.g.navigator ? navigator.userAgent || '' : ''); this.rulesheet = rulesheet; this.os = this.detectByRules(this.rulesheet.os); this.device = this.detectByRules(this.rulesheet.device); this.engine = this.detectByRules(this.rulesheet.engine); this.browser = this.detectByRules(this.rulesheet.browser); this.isFirefox = this.au.toLowerCase().indexOf('firefox') > -1; this.isCococ = this.au.toLowerCase().indexOf('coc_coc_browser') >= 1; this.isSafari = this.browser.type === 'safari' || !this.isCococ && this.au.toLowerCase().indexOf('safari') > -1 && this.au.toLowerCase().indexOf('win') < 0 && this.au.toLowerCase().indexOf('android') < 0; // this.isSafari = /constructor/i.test(window.HTMLElement) || window.safari; var isMobile = this.au.indexOf('KFFOWI') > -1 || this.au.toLowerCase().indexOf('mobile') > -1 || this.device.type === 'iphone' || this.device.type === 'ipad' || this.device.type === 'android'; Object.defineProperty(this, 'isMobile', { get: function get() { return isMobile || window.isMobile || !!window['mobileHost']; }, set: function set(v) { //do nothing } }); this.isMacOSWebView = /Macintosh/.test(this.au) && /AppWebkit/.test(this.au) && !/Safari/.test(this.au); this.isChromeIOS = /CriOS\/[\d]+/.test(this.au); this.hasTouch = 'ontouchstart' in __webpack_require__.g || __webpack_require__.g.DocumentTouch && document instanceof __webpack_require__.g.DocumentTouch || __webpack_require__.g.navigator && (navigator.maxTouchPoints > 0 || __webpack_require__.g.navigator.msMaxTouchPoints > 0); this.isTouchDevice = this.isMobile && this.hasTouch; this.supportPassiveEvent = function () { var supportsPassiveOption = false; try { var opts = Object.defineProperty({}, 'passive', { get: function get() { supportsPassiveOption = true; } }); __webpack_require__.g.addEventListener('test', null, opts); __webpack_require__.g.removeEventListener('test', null, opts); } catch (e) {} return supportsPassiveOption; }(); this.supportGridLayout = __webpack_require__.g.document && typeof document.createElement('div').style.grid === 'string'; Object.defineProperty(this, 'zoom', { get: function get() { return this.getZoom(); }, enumerable: true, configurable: false }); } BrowserDetector.prototype.detectByRules = function (rules) { var result = {}; for (var i = 0; i < rules.length; ++i) { var rule = rules[i]; var type = rule[0]; var rgx = rule[1]; if (typeof rgx == 'function') { rgx = rgx(this.au.toLowerCase()); } if (Object.prototype.toString.call(rgx).indexOf('RegExp') >= 0) { var matched = this.au.toLowerCase().match(rgx); if (matched) { result.type = type; if (matched[1]) { result.version = matched[1].replace(/_/g, '.'); } break; } } else if (typeof rgx == 'string') { if (this.au.toLowerCase().indexOf(rgx) >= 0) { result.type = type; } } } result.type = result.type || 'unknow'; result.version = result.version || '0'; return result; }; BrowserDetector.prototype.getZoom = function () { //todo: wrong on chrome var type; if ('chrome' in __webpack_require__.g) { type = "chrome"; } else if (this.isSafari) { type = 'safari'; } else if ('orientation' in __webpack_require__.g && 'webkitRequestAnimationFrame' in __webpack_require__.g) { type = 'webkitMobile'; } else if ('webkitRequestAnimationFrame' in __webpack_require__.g) { type = 'webkit'; } switch (type) { case 'chrome': return Math.round(__webpack_require__.g.outerWidth / __webpack_require__.g.innerWidth * 100) / 100; case 'safari': return Math.round(document.documentElement.clientWidth / __webpack_require__.g.innerWidth * 100) / 100; case 'webkitMobile': return (Math.abs(__webpack_require__.g.orientation) == 90 ? screen.height : screen.width) / __webpack_require__.g.innerWidth; case 'webkit': return function () { var important = function important(str) { return str.replace(/;/g, " !important;"); }; var div = document.createElement('div'); div.innerHTML = "1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0"; div.setAttribute('style', important('font: 100px/1em sans-serif; -webkit-text-size-adjust: none; text-size-adjust: none; height: auto; width: 1em; padding: 0; overflow: visible;')); var container = document.createElement('div'); container.setAttribute('style', important('width:0; height:0; overflow:hidden; visibility:hidden; position: absolute;')); container.appendChild(div); document.body.appendChild(container); var zoom = 1000 / div.clientHeight; zoom = Math.round(zoom * 100) / 100; document.body.removeChild(container); return zoom; }(); default: return 1; } return 1; }; function calcBenchmark() { var now = new Date().getTime(); var i = 0; while (now === new Date().getTime()) {} now++; while (now === new Date().getTime()) { ++i; } return i; } BrowserDetector.prototype.calcBenchmark = calcBenchmark; var _default = exports["default"] = new BrowserDetector(_BrowserRules["default"]); /***/ }), /***/ 14342: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var TexturePool = __webpack_require__(53248); var Bounds = __webpack_require__(76631); var clearList = __webpack_require__(56643); var executeInstructions = __webpack_require__(38224); var updateRenderGroupTransforms = __webpack_require__(75315); var validateRenderables = __webpack_require__(28085); "use strict"; var tempMatrix = new Matrix.Matrix(); var RenderGroupSystem = /*#__PURE__*/function () { function RenderGroupSystem(renderer) { _classCallCheck(this, RenderGroupSystem); this._renderer = renderer; } return _createClass(RenderGroupSystem, [{ key: "render", value: function render(_ref) { var container = _ref.container, transform = _ref.transform; var parent = container.parent; var renderGroupParent = container.renderGroup.renderGroupParent; container.parent = null; container.renderGroup.renderGroupParent = null; var renderer = this._renderer; var originalLocalTransform = tempMatrix; if (transform) { originalLocalTransform = originalLocalTransform.copyFrom(container.renderGroup.localTransform); container.renderGroup.localTransform.copyFrom(transform); } var renderPipes = renderer.renderPipes; this._updateCachedRenderGroups(container.renderGroup, null); this._updateRenderGroups(container.renderGroup); renderer.globalUniforms.start({ worldTransformMatrix: transform ? container.renderGroup.localTransform : container.renderGroup.worldTransform, worldColor: container.renderGroup.worldColorAlpha }); executeInstructions.executeInstructions(container.renderGroup, renderPipes); if (renderPipes.uniformBatch) { renderPipes.uniformBatch.renderEnd(); } if (transform) { container.renderGroup.localTransform.copyFrom(originalLocalTransform); } container.parent = parent; container.renderGroup.renderGroupParent = renderGroupParent; } }, { key: "destroy", value: function destroy() { this._renderer = null; } }, { key: "_updateCachedRenderGroups", value: function _updateCachedRenderGroups(renderGroup, closestCacheAsTexture) { if (renderGroup.isCachedAsTexture) { if (!renderGroup.updateCacheTexture) return; closestCacheAsTexture = renderGroup; } renderGroup._parentCacheAsTextureRenderGroup = closestCacheAsTexture; for (var i = renderGroup.renderGroupChildren.length - 1; i >= 0; i--) { this._updateCachedRenderGroups(renderGroup.renderGroupChildren[i], closestCacheAsTexture); } renderGroup.invalidateMatrices(); if (renderGroup.isCachedAsTexture) { if (renderGroup.textureNeedsUpdate) { var _renderGroup$textureO; var bounds = renderGroup.root.getLocalBounds(); bounds.ceil(); var lastTexture = renderGroup.texture; if (renderGroup.texture) { TexturePool.TexturePool.returnTexture(renderGroup.texture); } var renderer = this._renderer; var resolution = renderGroup.textureOptions.resolution || renderer.view.resolution; var antialias = (_renderGroup$textureO = renderGroup.textureOptions.antialias) !== null && _renderGroup$textureO !== void 0 ? _renderGroup$textureO : renderer.view.antialias; renderGroup.texture = TexturePool.TexturePool.getOptimalTexture(bounds.width, bounds.height, resolution, antialias); renderGroup._textureBounds || (renderGroup._textureBounds = new Bounds.Bounds()); renderGroup._textureBounds.copyFrom(bounds); if (lastTexture !== renderGroup.texture) { if (renderGroup.renderGroupParent) { renderGroup.renderGroupParent.structureDidChange = true; } } } } else if (renderGroup.texture) { TexturePool.TexturePool.returnTexture(renderGroup.texture); renderGroup.texture = null; } } }, { key: "_updateRenderGroups", value: function _updateRenderGroups(renderGroup) { var renderer = this._renderer; var renderPipes = renderer.renderPipes; renderGroup.runOnRender(renderer); renderGroup.instructionSet.renderPipes = renderPipes; if (!renderGroup.structureDidChange) { validateRenderables.validateRenderables(renderGroup, renderPipes); } else { clearList.clearList(renderGroup.childrenRenderablesToUpdate.list, 0); } updateRenderGroupTransforms.updateRenderGroupTransforms(renderGroup); if (renderGroup.structureDidChange) { renderGroup.structureDidChange = false; this._buildInstructions(renderGroup, renderer); } else { this._updateRenderables(renderGroup); } renderGroup.childrenRenderablesToUpdate.index = 0; renderer.renderPipes.batch.upload(renderGroup.instructionSet); if (renderGroup.isCachedAsTexture && !renderGroup.textureNeedsUpdate) return; for (var i = 0; i < renderGroup.renderGroupChildren.length; i++) { this._updateRenderGroups(renderGroup.renderGroupChildren[i]); } } }, { key: "_updateRenderables", value: function _updateRenderables(renderGroup) { var _renderGroup$children = renderGroup.childrenRenderablesToUpdate, list = _renderGroup$children.list, index = _renderGroup$children.index; for (var i = 0; i < index; i++) { var container = list[i]; if (container.didViewUpdate) { renderGroup.updateRenderable(container); } } clearList.clearList(list, index); } }, { key: "_buildInstructions", value: function _buildInstructions(renderGroup, rendererOrPipes) { var root = renderGroup.root; var instructionSet = renderGroup.instructionSet; instructionSet.reset(); var renderer = rendererOrPipes.renderPipes ? rendererOrPipes : rendererOrPipes.batch.renderer; var renderPipes = renderer.renderPipes; renderPipes.batch.buildStart(instructionSet); renderPipes.blendMode.buildStart(); renderPipes.colorMask.buildStart(); if (root.sortableChildren) { root.sortChildren(); } root.collectRenderablesWithEffects(instructionSet, renderer, null); renderPipes.batch.buildEnd(instructionSet); renderPipes.blendMode.buildEnd(instructionSet); } }]); }(); /** @ignore */ RenderGroupSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "renderGroup" }; exports.RenderGroupSystem = RenderGroupSystem; /***/ }), /***/ 14394: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var VividLightBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function VividLightBlend() { _classCallCheck(this, VividLightBlend); return _callSuper(this, VividLightBlend, [{ gl: { functions: "\n float colorBurn(float base, float blend)\n {\n return max((1.0-((1.0-base)/blend)),0.0);\n }\n\n float colorDodge(float base, float blend)\n {\n return min(1.0, base / (1.0-blend));\n }\n\n float vividLight(float base, float blend)\n {\n return (blend < 0.5) ? colorBurn(base,(2.0*blend)) : colorDodge(base,(2.0*(blend-0.5)));\n }\n\n vec3 blendVividLight(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n vividLight(base.r, blend.r),\n vividLight(base.g, blend.g),\n vividLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendVividLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn colorBurn(base:f32, blend:f32) -> f32\n {\n return max((1.0-((1.0-base)/blend)),0.0);\n }\n\n fn colorDodge(base: f32, blend: f32) -> f32\n {\n return min(1.0, base / (1.0-blend));\n }\n\n fn vividLight(base: f32, blend: f32) -> f32\n {\n return select(colorDodge(base,(2.0*(blend-0.5))), colorBurn(base,(2.0*blend)), blend<0.5);\n }\n\n fn blendVividLight(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>\n {\n let blended: vec3<f32> = vec3<f32>(\n vividLight(base.r, blend.r),\n vividLight(base.g, blend.g),\n vividLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(VividLightBlend, _BlendModeFilter$Blen); return _createClass(VividLightBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ VividLightBlend.extension = { name: "vivid-light", type: Extensions.ExtensionType.BlendMode }; exports.VividLightBlend = VividLightBlend; /***/ }), /***/ 14405: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(23448); "use strict"; function generateGpuLayoutGroups(_ref) { var groups = _ref.groups; var layout = []; for (var i = 0; i < groups.length; i++) { var group = groups[i]; if (!layout[group.group]) { layout[group.group] = []; } if (group.isUniform) { layout[group.group].push({ binding: group.binding, visibility: _const.ShaderStage.VERTEX | _const.ShaderStage.FRAGMENT, buffer: { type: "uniform" } }); } else if (group.type === "sampler") { layout[group.group].push({ binding: group.binding, visibility: _const.ShaderStage.FRAGMENT, sampler: { type: "filtering" } }); } else if (group.type === "texture_2d") { layout[group.group].push({ binding: group.binding, visibility: _const.ShaderStage.FRAGMENT, texture: { sampleType: "float", viewDimension: "2d", multisampled: false } }); } } return layout; } exports.generateGpuLayoutGroups = generateGpuLayoutGroups; /***/ }), /***/ 14432: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(43021); "use strict"; function parseDDS(arrayBuffer, supportedFormats) { var _parseDDSHeader = parseDDSHeader(arrayBuffer), format = _parseDDSHeader.format, fourCC = _parseDDSHeader.fourCC, width = _parseDDSHeader.width, height = _parseDDSHeader.height, dataOffset = _parseDDSHeader.dataOffset, mipmapCount = _parseDDSHeader.mipmapCount; if (!supportedFormats.includes(format)) { throw new Error("Unsupported texture format: ".concat(fourCC, " ").concat(format, ", supported: ").concat(supportedFormats)); } if (mipmapCount <= 1) { return { format: format, width: width, height: height, resource: [new Uint8Array(arrayBuffer, dataOffset)], alphaMode: "no-premultiply-alpha" }; } var levelBuffers = getMipmapLevelBuffers(format, width, height, dataOffset, mipmapCount, arrayBuffer); var textureOptions = { format: format, width: width, height: height, resource: levelBuffers, alphaMode: "no-premultiply-alpha" }; return textureOptions; } function getMipmapLevelBuffers(format, width, height, dataOffset, mipmapCount, arrayBuffer) { var levelBuffers = []; var blockBytes = _const.TEXTURE_FORMAT_BLOCK_SIZE[format]; var mipWidth = width; var mipHeight = height; var offset = dataOffset; for (var level = 0; level < mipmapCount; ++level) { var alignedWidth = Math.ceil(Math.max(4, mipWidth) / 4) * 4; var alignedHeight = Math.ceil(Math.max(4, mipHeight) / 4) * 4; var byteLength = blockBytes ? alignedWidth / 4 * alignedHeight / 4 * blockBytes : mipWidth * mipHeight * 4; var levelBuffer = new Uint8Array(arrayBuffer, offset, byteLength); levelBuffers.push(levelBuffer); offset += byteLength; mipWidth = Math.max(mipWidth >> 1, 1); mipHeight = Math.max(mipHeight >> 1, 1); } return levelBuffers; } function parseDDSHeader(buffer) { var header = new Uint32Array(buffer, 0, _const.DDS.HEADER_SIZE / Uint32Array.BYTES_PER_ELEMENT); if (header[_const.DDS.HEADER_FIELDS.MAGIC] !== _const.DDS.MAGIC_VALUE) { throw new Error("Invalid magic number in DDS header"); } var height = header[_const.DDS.HEADER_FIELDS.HEIGHT]; var width = header[_const.DDS.HEADER_FIELDS.WIDTH]; var mipmapCount = Math.max(1, header[_const.DDS.HEADER_FIELDS.MIPMAP_COUNT]); var flags = header[_const.DDS.HEADER_FIELDS.PF_FLAGS]; var fourCC = header[_const.DDS.HEADER_FIELDS.FOURCC]; var format = getTextureFormat(header, flags, fourCC, buffer); var dataOffset = _const.DDS.MAGIC_SIZE + _const.DDS.HEADER_SIZE + (fourCC === _const.DDS.D3DFMT.DX10 ? _const.DDS.HEADER_DX10_SIZE : 0); return { format: format, fourCC: fourCC, width: width, height: height, dataOffset: dataOffset, mipmapCount: mipmapCount }; } function getTextureFormat(header, flags, fourCC, buffer) { if (flags & _const.DDS.PIXEL_FORMAT_FLAGS.FOURCC) { if (fourCC === _const.DDS.D3DFMT.DX10) { var dx10Header = new Uint32Array(buffer, _const.DDS.MAGIC_SIZE + _const.DDS.HEADER_SIZE, // there is a 20-byte DDS_HEADER_DX10 after DDS_HEADER _const.DDS.HEADER_DX10_SIZE / Uint32Array.BYTES_PER_ELEMENT); var miscFlag = dx10Header[_const.DDS.HEADER_DX10_FIELDS.MISC_FLAG]; if (miscFlag === _const.DDS.RESOURCE_MISC_TEXTURECUBE) { throw new Error("DDSParser does not support cubemap textures"); } var resourceDimension = dx10Header[_const.DDS.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]; if (resourceDimension === _const.DDS.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D) { throw new Error("DDSParser does not supported 3D texture data"); } var dxgiFormat = dx10Header[_const.DDS.HEADER_DX10_FIELDS.DXGI_FORMAT]; if (dxgiFormat in _const.DXGI_TO_TEXTURE_FORMAT) { return _const.DXGI_TO_TEXTURE_FORMAT[dxgiFormat]; } throw new Error("DDSParser cannot parse texture data with DXGI format ".concat(dxgiFormat)); } if (fourCC in _const.FOURCC_TO_TEXTURE_FORMAT) { return _const.FOURCC_TO_TEXTURE_FORMAT[fourCC]; } throw new Error("DDSParser cannot parse texture data with fourCC format ".concat(fourCC)); } if (flags & _const.DDS.PIXEL_FORMAT_FLAGS.RGB || flags & _const.DDS.PIXEL_FORMAT_FLAGS.RGBA) { return getUncompressedTextureFormat(header); } if (flags & _const.DDS.PIXEL_FORMAT_FLAGS.YUV) { throw new Error("DDSParser does not supported YUV uncompressed texture data."); } if (flags & _const.DDS.PIXEL_FORMAT_FLAGS.LUMINANCE || flags & _const.DDS.PIXEL_FORMAT_FLAGS.LUMINANCEA) { throw new Error("DDSParser does not support single-channel (lumninance) texture data!"); } if (flags & _const.DDS.PIXEL_FORMAT_FLAGS.ALPHA || flags & _const.DDS.PIXEL_FORMAT_FLAGS.ALPHAPIXELS) { throw new Error("DDSParser does not support single-channel (alpha) texture data!"); } throw new Error("DDSParser failed to load a texture file due to an unknown reason!"); } function getUncompressedTextureFormat(header) { var bitCount = header[_const.DDS.HEADER_FIELDS.RGB_BITCOUNT]; var rBitMask = header[_const.DDS.HEADER_FIELDS.R_BIT_MASK]; var gBitMask = header[_const.DDS.HEADER_FIELDS.G_BIT_MASK]; var bBitMask = header[_const.DDS.HEADER_FIELDS.B_BIT_MASK]; var aBitMask = header[_const.DDS.HEADER_FIELDS.A_BIT_MASK]; switch (bitCount) { case 32: if (rBitMask === 255 && gBitMask === 65280 && bBitMask === 16711680 && aBitMask === 4278190080) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM]; } if (rBitMask === 16711680 && gBitMask === 65280 && bBitMask === 255 && aBitMask === 4278190080) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM]; } if (rBitMask === 1072693248 && gBitMask === 1047552 && bBitMask === 1023 && aBitMask === 3221225472) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM]; } if (rBitMask === 65535 && gBitMask === 4294901760 && bBitMask === 0 && aBitMask === 0) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM]; } if (rBitMask === 4294967295 && gBitMask === 0 && bBitMask === 0 && aBitMask === 0) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT]; } break; case 24: if (rBitMask === 16711680 && gBitMask === 65280 && bBitMask === 255 && aBitMask === 32768) {} break; case 16: if (rBitMask === 31744 && gBitMask === 992 && bBitMask === 31 && aBitMask === 32768) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM]; } if (rBitMask === 63488 && gBitMask === 2016 && bBitMask === 31 && aBitMask === 0) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM]; } if (rBitMask === 3840 && gBitMask === 240 && bBitMask === 15 && aBitMask === 61440) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM]; } if (rBitMask === 255 && gBitMask === 0 && bBitMask === 0 && aBitMask === 65280) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM]; } if (rBitMask === 65535 && gBitMask === 0 && bBitMask === 0 && aBitMask === 0) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM]; } break; case 8: if (rBitMask === 255 && gBitMask === 0 && bBitMask === 0 && aBitMask === 0) { return _const.DXGI_TO_TEXTURE_FORMAT[_const.DDS.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM]; } break; } throw new Error("DDSParser does not support uncompressed texture with configuration:\n bitCount = ".concat(bitCount, ", rBitMask = ").concat(rBitMask, ", gBitMask = ").concat(gBitMask, ", aBitMask = ").concat(aBitMask)); } exports.parseDDS = parseDDS; /***/ }), /***/ 14823: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var ObservablePoint = /*#__PURE__*/function () { /** * Creates a new `ObservablePoint` * @param observer - Observer to pass to listen for change events. * @param {number} [x=0] - position of the point on the x axis * @param {number} [y=0] - position of the point on the y axis */ function ObservablePoint(observer, x, y) { _classCallCheck(this, ObservablePoint); this._x = x || 0; this._y = y || 0; this._observer = observer; } /** * Creates a clone of this point. * @param observer - Optional observer to pass to the new observable point. * @returns a copy of this observable point */ return _createClass(ObservablePoint, [{ key: "clone", value: function clone(observer) { return new ObservablePoint(observer !== null && observer !== void 0 ? observer : this._observer, this._x, this._y); } /** * Sets the point to a new `x` and `y` position. * If `y` is omitted, both `x` and `y` will be set to `x`. * @param {number} [x=0] - position of the point on the x axis * @param {number} [y=x] - position of the point on the y axis * @returns The observable point instance itself */ }, { key: "set", value: function set() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; if (this._x !== x || this._y !== y) { this._x = x; this._y = y; this._observer._onUpdate(this); } return this; } /** * Copies x and y from the given point (`p`) * @param p - The point to copy from. Can be any of type that is or extends `PointData` * @returns The observable point instance itself */ }, { key: "copyFrom", value: function copyFrom(p) { if (this._x !== p.x || this._y !== p.y) { this._x = p.x; this._y = p.y; this._observer._onUpdate(this); } return this; } /** * Copies this point's x and y into that of the given point (`p`) * @param p - The point to copy to. Can be any of type that is or extends `PointData` * @returns The point (`p`) with values updated */ }, { key: "copyTo", value: function copyTo(p) { p.set(this._x, this._y); return p; } /** * Accepts another point (`p`) and returns `true` if the given point is equal to this point * @param p - The point to check * @returns Returns `true` if both `x` and `y` are equal */ }, { key: "equals", value: function equals(p) { return p.x === this._x && p.y === this._y; } }, { key: "toString", value: function toString() { return "[pixi.js/math:ObservablePoint x=".concat(0, " y=", 0, " scope=", this._observer, "]"); } /** Position of the observable point on the x axis. */ }, { key: "x", get: function get() { return this._x; }, set: function set(value) { if (this._x !== value) { this._x = value; this._observer._onUpdate(this); } } /** Position of the observable point on the y axis. */ }, { key: "y", get: function get() { return this._y; }, set: function set(value) { if (this._y !== value) { this._y = value; this._observer._onUpdate(this); } } }]); }(); exports.ObservablePoint = ObservablePoint; /***/ }), /***/ 14827: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function logDebugTexture(_x, _x2) { return _logDebugTexture.apply(this, arguments); } function _logDebugTexture() { _logDebugTexture = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(texture, renderer) { var size, base64, width, style, _args = arguments; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: size = _args.length > 2 && _args[2] !== undefined ? _args[2] : 200; _context.n = 1; return renderer.extract.base64(texture); case 1: base64 = _context.v; _context.n = 2; return renderer.encoder.commandFinished; case 2: width = size; console.log("logging texture ".concat(texture.source.width, "px ").concat(texture.source.height, "px")); style = ["font-size: 1px;", "padding: ".concat(width, "px ", 300, "px;"), "background: url(".concat(base64, ") no-repeat;"), "background-size: contain;"].join(" "); console.log("%c ", style); case 3: return _context.a(2); } }, _callee); })); return _logDebugTexture.apply(this, arguments); } exports.logDebugTexture = logDebugTexture; /***/ }), /***/ 14952: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function generateGPULayout(maxTextures) { var gpuLayout = []; var bindIndex = 0; for (var i = 0; i < maxTextures; i++) { gpuLayout[bindIndex] = { texture: { sampleType: "float", viewDimension: "2d", multisampled: false }, binding: bindIndex, visibility: GPUShaderStage.FRAGMENT }; bindIndex++; gpuLayout[bindIndex] = { sampler: { type: "filtering" }, binding: bindIndex, visibility: GPUShaderStage.FRAGMENT }; bindIndex++; } return gpuLayout; } exports.generateGPULayout = generateGPULayout; /***/ }), /***/ 15068: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var BLEND_TO_NPM = { normal: "normal-npm", add: "add-npm", screen: "screen-npm" }; var STENCIL_MODES = /* @__PURE__ */function (STENCIL_MODES2) { STENCIL_MODES2[STENCIL_MODES2["DISABLED"] = 0] = "DISABLED"; STENCIL_MODES2[STENCIL_MODES2["RENDERING_MASK_ADD"] = 1] = "RENDERING_MASK_ADD"; STENCIL_MODES2[STENCIL_MODES2["MASK_ACTIVE"] = 2] = "MASK_ACTIVE"; STENCIL_MODES2[STENCIL_MODES2["INVERSE_MASK_ACTIVE"] = 3] = "INVERSE_MASK_ACTIVE"; STENCIL_MODES2[STENCIL_MODES2["RENDERING_MASK_REMOVE"] = 4] = "RENDERING_MASK_REMOVE"; STENCIL_MODES2[STENCIL_MODES2["NONE"] = 5] = "NONE"; return STENCIL_MODES2; }(STENCIL_MODES || {}); exports.BLEND_TO_NPM = BLEND_TO_NPM; exports.STENCIL_MODES = STENCIL_MODES; /***/ }), /***/ 15464: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var EventEmitter = __webpack_require__(19497); var earcut = __webpack_require__(32231); "use strict"; exports.EventEmitter = EventEmitter; exports.earcut = earcut; /***/ }), /***/ 15489: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function getDefaultUniformValue(type, size) { switch (type) { case "f32": return 0; case "vec2<f32>": return new Float32Array(2 * size); case "vec3<f32>": return new Float32Array(3 * size); case "vec4<f32>": return new Float32Array(4 * size); case "mat2x2<f32>": return new Float32Array([1, 0, 0, 1]); case "mat3x3<f32>": return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); case "mat4x4<f32>": return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); } return null; } exports.getDefaultUniformValue = getDefaultUniformValue; /***/ }), /***/ 15571: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var uid = __webpack_require__(90844); "use strict"; var InstructionSet = /*#__PURE__*/function () { function InstructionSet() { _classCallCheck(this, InstructionSet); /** a unique id for this instruction set used through the renderer */ this.uid = uid.uid("instructionSet"); /** the array of instructions */ this.instructions = []; /** the actual size of the array (any instructions passed this should be ignored) */ this.instructionSize = 0; this.renderables = []; /** used by the garbage collector to track when the instruction set was last used */ this.gcTick = 0; } /** reset the instruction set so it can be reused set size back to 0 */ return _createClass(InstructionSet, [{ key: "reset", value: function reset() { this.instructionSize = 0; } /** * Add an instruction to the set * @param instruction - add an instruction to the set */ }, { key: "add", value: function add(instruction) { this.instructions[this.instructionSize++] = instruction; } /** * Log the instructions to the console (for debugging) * @internal * @ignore */ }, { key: "log", value: function log() { this.instructions.length = this.instructionSize; console.table(this.instructions, ["type", "action"]); } }]); }(); exports.InstructionSet = InstructionSet; /***/ }), /***/ 15698: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); var isWebGLSupported = __webpack_require__(67073); var isWebGPUSupported = __webpack_require__(50132); "use strict"; var detectBasis = { extension: { type: Extensions.ExtensionType.DetectionParser, priority: 3 }, test: function () { var _test = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return isWebGPUSupported.isWebGPUSupported(); case 1: if (!_context.v) { _context.n = 2; break; } return _context.a(2, true); case 2: if (!isWebGLSupported.isWebGLSupported()) { _context.n = 3; break; } return _context.a(2, true); case 3: return _context.a(2, false); } }, _callee); })); function test() { return _test.apply(this, arguments); } return test; }(), add: function () { var _add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(formats) { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: return _context2.a(2, [].concat(_toConsumableArray(formats), ["basis"])); } }, _callee2); })); function add(_x) { return _add.apply(this, arguments); } return add; }(), remove: function () { var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(formats) { return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: return _context3.a(2, formats.filter(function (f) { return f !== "basis"; })); } }, _callee3); })); function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() }; exports.detectBasis = detectBasis; /***/ }), /***/ 15851: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FeatureClass = void 0; exports.activeFullScreen = activeFullScreen; exports.copyStyleRule = copyStyleRule; exports["default"] = exports.deactiveFullScreen = void 0; exports.depthClone = depthClone; exports.depthCloneWithStyle = depthCloneWithStyle; exports.fontFaceIsLoaded = fontFaceIsLoaded; exports.getConstructDescriptor = getConstructDescriptor; exports.getScreenSize = getScreenSize; exports.getScrollSize = getScrollSize; exports.getSystemFontSize = getSystemFontSize; exports.getTextNodeBound = getTextNodeBound; exports.imageToCanvas = imageToCanvas; exports.inactiveFullScreen = inactiveFullScreen; exports.isDomNode = isDomNode; exports.isFullScreen = isFullScreen; exports.isVisibilityOnScreen = isVisibilityOnScreen; exports.traceOutBoundingClientRect = traceOutBoundingClientRect; exports.waitIFrameLoaded = waitIFrameLoaded; exports.waitImageLoaded = waitImageLoaded; var _JSPath = _interopRequireDefault(__webpack_require__(60607)); var _OOP = _interopRequireDefault(__webpack_require__(64181)); var _getFunctionName = _interopRequireDefault(__webpack_require__(63147)); var _ElementNS = _interopRequireDefault(__webpack_require__(53976)); var _AElement = _interopRequireDefault(__webpack_require__(94278)); var _ResizeSystem = _interopRequireDefault(__webpack_require__(58594)); var _attribute = __webpack_require__(82834); var _AttachHook = _interopRequireDefault(__webpack_require__(65077)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /*** * @typedef {{"accept-charset":string, "http-equiv": string, accept : string, accesskey : string, action : string, align : string, allow : string, alt : string, async : string, autocapitalize : string, autocomplete : string, autofocus : string, autoplay : string, background : string, bgcolor : string, border : string, buffered : string, capture : string, challenge : string, charset : string, checked : string, cite : string, class : string, code : string, codebase : string, color : string, cols : string, colspan : string, content : string, contenteditable : string, contextmenu : string, controls : string, coords : string, crossorigin : string, csp : string, data : string, "data-*" : string, datetime : string, decoding : string, default : string, defer : string, dir : string, dirname : string, disabled : string, download : string, draggable : string, dropzone : string, enctype : string, enterkeyhint : string, for : string, form : string, formaction : string, formenctype : string, formmethod : string, formnovalidate : string, formtarget : string, headers : string, height : string, hidden : string, high : string, href : string, hreflang : string, icon : string, id : string, importance : string, integrity : string, intrinsicsize : string, inputmode : string, ismap : string, itemprop : string, keytype : string, kind : string, label : string, lang : string, language : string, loading : string, list : string, loop : string, low : string, manifest : string, max : string, maxlength : string, minlength : string, media : string, method : string, min : string, multiple : string, muted : string, name : string, novalidate : string, open : string, optimum : string, pattern : string, ping : string, placeholder : string, poster : string, preload : string, radiogroup : string, readonly : string, referrerpolicy : string, rel : string, required : string, reversed : string, rows : string, rowspan : string, sandbox : string, scope : string, scoped : string, selected : string, shape : string, size : string, sizes : string, slot : string, span : string, spellcheck : string, src : string, srcdoc : string, srclang : string, srcset : string, start : string, step : string, style : string, summary : string, tabindex : string, target : string, title : string, translate : string, type : string, usemap : string, value : string, width : string, wrap : string, }} AElementAttributeDescriptor */ /** * @typedef {{"arabic-form":string,"baseline-shift": string, "accent-height": string, "alignment-baseline": string, "cap-height": string, "clip-path": string, "clip-rule": string, "color-dinterpolation": string, "color-interpolation-filters": string, "color-profile": string, "color-rendering": string, "dominant-baseline": string, "enable-background": string, "fill-opacity": string, "fill-rule": string, "flood-color": string, "flood-opacity": string, "font-family": string, "font-size": string, "font-size-adjust": string, "font-stretch": string, "font-style": string, "font-variant": string, "font-weight": string, "glyph-name": string, "glyph-orientation-horizontal": string, "glyph-orientation-vertical": string, "horiz-adv-x": string, "horiz-origin-x": string, "image-rendering": string, "letter-spacing": string, "lighting-color": string, "marker-end": string, "marker-mid": string, "marker-start": string, "overline-position": string, "overline-thickness": string, "panose-1": string, "paint-order": string, "pointer-events": string, "rendering-intent": string, "shape-rendering": string, "stop-color": string, "stop-opacity": string, "strikethrough-position": string, "strikethrough-thickness": string, "stroke-dasharray": string, "stroke-dashoffset": string, "stroke-linecap": string, "stroke-linejoin": string, "stroke-miterlimit": string, "stroke-opacity": string, "stroke-width": string, "text-anchor": string, "text-decoration": string, "text-rendering": string, "transform-origin": string, "underline-position": string, "underline-thickness": string, "unicode-bidi": string, "unicode-range": string, "units-per-em": string, "v-alphabetic": string, "v-hanging": string, "v-ideographic": string, "v-mathematical": string, "vector-effect": string, "vert-adv-y": string, "vert-origin-x": string, "vert-origin-y": string, "word-spacing": string, "writing-mode": string, "x-height": string, "xlink:actuate": string, "xlink:arcrole": string, "xlink:href": string, "xlink:role": string, "xlink:show": string, "xlink:title": string, "xlink:type": string, "xml:base": string, "xml:lang": string, "xml:space": string, accumulate:string, additive:string, allowReorder:string, alphabetic:string, amplitude:string, ascent:string, attributeName:string, attributeType:string, autoReverse:string, azimuth:string, baseFrequency:string, baseProfile:string, bbox:string, begin:string, bias:string, by:string, calcMode:string, class:string, clip:string, clipPathUnits:string, color:string, contentScriptType:string, contentStyleType:string, cursor:string, cx:string, cy:string, d:string, decelerate:string, descent:string, diffuseConstant:string, direction:string, display:string, divisor:string, dur:string, dx:string, dy:string, edgeMode:string, elevation:string, end:string, exponent:string, externalResourcesRequired:string, fill:NamedColor|Color|string, filter:string, filterRes:string, filterUnits:string, format:string, from:string, fr:string, fx:string, fy:string, g1:string, g2:string, glyphRef:string, gradientTransform:string, gradientUnits:string, hanging:string, height:string, href:string, hreflang:string, id:string, ideographic:string, in:string, in2:string, intercept:string, k:string, k1:string, k2:string, k3:string, k4:string, kernelMatrix:string, kernelUnitLength:string, kerning:string, keyPoints:string, keySplines:string, keyTimes:string, lang:string, lengthAdjust:string, limitingConeAngle:string, local:string, markerHeight:string, markerUnits:string, markerWidth:string, mask:string, maskContentUnits:string, maskUnits:string, mathematical:string, max:string, media:string, method:string, min:string, mode:string, name:string, numOctaves:string, offset:string, opacity:string, operator:string, order:string, orient:string, orientation:string, origin:string, overflow:string, path:string, pathLength:string, patternContentUnits:string, patternTransform:string, patternUnits:string, ping:string, points:string, pointsAtX:string, pointsAtY:string, pointsAtZ:string, preserveAlpha:string, preserveAspectRatio:string, primitiveUnits:string, r:string, radius:string, referrerPolicy:string, refX:string, refY:string, rel:string, repeatCount:string, repeatDur:string, requiredExtensions:string, requiredFeatures:string, restart:string, result:string, rotate:string, rx:string, ry:string, scale:string, seed:string, slope:string, spacing:string, specularConstant:string, specularExponent:string, speed:string, spreadMethod:string, startOffset:string, stdDeviation:string, stemh:string, stemv:string, stitchTiles:string, string:string, stroke:string, style:string, surfaceScale:string, systemLanguage:string, tabindex:string, tableValues:string, target:string, targetX:string, targetY:string, textLength:string, to:string, transform:string, type:string, u1:string, u2:string, unicode:string, values:string, version:string, viewBox:string, viewTarget:string, visibility:string, width:string, widths:string, x:string, x1:string, x2:string, xChannelSelector:string, y:string, y1:string, y2:string, yChannelSelector:string, z:string, zoomAndPan:string, }} AElementNSAttributeDescriptor */ /*** * @typedef {{abort:function(event:(UiEvent|Event)):void,afterprint:function(event:Event):void,animationend:function(event:AnimationEvent):void,animationiteration:function(event:AnimationEvent):void,animationstart:function(event:AnimationEvent):void,beforeprint:function(event:Event):void,beforeunload:function(event:(UiEvent|Event)):void,blur:function(event:FocusEvent):void,canplay:function(event:Event):void,canplaythrough:function(event:Event):void,change:function(event:Event):void,click:function(event:MouseEvent):void,contextmenu:function(event:MouseEvent):void,copy:function(event:ClipboardEvent):void,cut:function(event:ClipboardEvent):void,dblclick:function(event:MouseEvent):void,drag:function(event:DragEvent):void,dragend:function(event:DragEvent):void,dragenter:function(event:DragEvent):void,dragleave:function(event:DragEvent):void,dragover:function(event:DragEvent):void,dragstart:function(event:DragEvent):void,drop:function(event:DragEvent):void,durationchange:function(event:Event):void,ended:function(event:Event):void,error:function(event:(ProgressEvent|UiEvent|Event)):void,focus:function(event:FocusEvent):void,focusin:function(event:FocusEvent):void,focusout:function(event:FocusEvent):void,fullscreenchange:function(event:Event):void,fullscreenerror:function(event:Event):void,hashchange:function(event:HashChangeEvent):void,input:function(event:(InputEvent|Event)):void,invalid:function(event:Event):void,keydown:function(event:KeyboardEvent):void,keypress:function(event:KeyboardEvent):void,keyup:function(event:KeyboardEvent):void,load:function(event:(UiEvent|Event)):void,loadeddata:function(event:Event):void,loadedmetadata:function(event:Event):void,loadstart:function(event:ProgressEvent):void,message:function(event:Event):void,mousedown:function(event:MouseEvent):void,mouseenter:function(event:MouseEvent):void,mouseleave:function(event:MouseEvent):void,mousemove:function(event:MouseEvent):void,mouseover:function(event:MouseEvent):void,mouseout:function(event:MouseEvent):void,mouseup:function(event:MouseEvent):void,mousewheel:function(event:WheelEvent):void,offline:function(event:Event):void,online:function(event:Event):void,open:function(event:Event):void,pagehide:function(event:PageTransitionEvent):void,pageshow:function(event:PageTransitionEvent):void,paste:function(event:ClipboardEvent):void,pause:function(event:Event):void,play:function(event:Event):void,playing:function(event:Event):void,popstate:function(event:PopStateEvent):void,progress:function(event:Event):void,ratechange:function(event:Event):void,resize:function(event:(UiEvent|Event)):void,reset:function(event:Event):void,scroll:function(event:(UiEvent|Event)):void,search:function(event:Event):void,seeked:function(event:Event):void,seeking:function(event:Event):void,select:function(event:(UiEvent|Event)):void,show:function(event:Event):void,stalled:function(event:Event):void,storage:function(event:StorageEvent):void,submit:function(event:Event):void,suspend:function(event:Event):void,timeupdate:function(event:Event):void,toggle:function(event:Event):void,touchcancel:function(event:TouchEvent):void,touchend:function(event:TouchEvent):void,touchmove:function(event:TouchEvent):void,touchstart:function(event:TouchEvent):void,transitionend:function(event:TransitionEvent):void,unload:function(event:(UiEvent|Event)):void,volumechange:function(event:Event):void,waiting:function(event:Event):void,wheel:function(event:WheelEvent):void}} AElementEventDescriptor */ /*** * @typedef AbsolConstructDescriptor * @property {string | function |null} tag * @property {CSSStyleDeclaration} style * @property {Array | string} extendEvent * @property {Array | string} class * @property {Object} data * @property {AElementAttributeDescriptor|AElementNSAttributeDescriptor} attr * @property {string|AElement | AElementNS | AbsolConstructDescriptor | string[] |AElement[] | AElementNS[] | AbsolConstructDescriptor[]} child * @property {string} text to create a TextNode, not Element * @property {AElement} elt * @property {AElementEventDescriptor|{}} on * @property {Object} props * */ var svgCreator = function svgCreator() { var temp = document.createElement('div'); temp.innerHTML = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>'; var element = temp.childNodes[0]; var prototypes = Object.getOwnPropertyDescriptors(_AElement["default"].prototype); Object.defineProperties(element, prototypes); _AElement["default"].call(element); return element; }; /*** * * @param {*=} option * @constructor */ function Dom(option) { option = option || {}; this.creator = option.creator || {}; Object.defineProperties(this.creator, { svg: { set: function set() { //do nothing }, get: function get() { return svgCreator; } }, attachhook: { set: function set() { //do nothing }, get: function get() { return _AttachHook["default"]; } } }); this['$ '.trim()] = this.$.bind(this); this['_ '.trim()] = this._.bind(this); this['$' + '$'] = this.$$.bind(this); this.buildDom = this._; } Dom.prototype.defaultTag = 'div'; Dom.prototype.fromCode = function (code) { code = code.trim().replace(/>\s+</gm, '><'); var temTag = 'div'; if (code.startsWith('<td') || code.startsWith('<th') && !code.startsWith('<thead')) temTag = 'tr';else if (code.startsWith('<tr')) temTag = 'tbody';else if (code.startsWith('<thead') || code.startsWith('<tbody')) temTag = 'table'; var tempDiv = document.createElement(temTag); tempDiv.innerHTML = code; var element = tempDiv.childNodes[0]; var prototypes = Object.getOwnPropertyDescriptors(_AElement["default"].prototype); Object.defineProperties(element, prototypes); _AElement["default"].call(element); return element; }; /** * DFS * @param {string | AElement} query * @param {AElement} root * @param {function} onFound - return true to stop find * @returns {AElement | AElementNS} */ Dom.prototype.$ = function (query, root, onFound) { var res; if (Dom.isDomNode(query)) res = query;else res = this.select(query, root, onFound); if (res) this.attach(res); return res; }; /*** * * @type {function(string, AElement, Function): AElement} */ Dom.prototype.selectAttacth = Dom.prototype.$; /** * DFS * @param {string} query * @param {AElement} root * @param {function} onFound - return true to stop find */ Dom.prototype.select = function (query, root, onFound) { root = root || document.documentElement; var matcher = _JSPath["default"].compileJSPath(query); return matcher.findFirst(root, onFound); }; var FeatureClass = exports.FeatureClass = { AElementNS: { constructor: _ElementNS["default"], prototypeKeys: Object.keys(_ElementNS["default"].prototype) }, AElement: { constructor: _AElement["default"], prototypeKeys: Object.keys(_AElement["default"].prototype) } }; /** * * @param {AElement | AElementNS } element */ Dom.prototype.attach = function (element) { if (element.attr) return; var feature = element.getBBox && element.tagName !== 'svg' ? FeatureClass.AElementNS : FeatureClass.AElement; var elementConstructor = feature.constructor; var proto = elementConstructor.prototype; var prototypeKeys = feature.prototypeKeys; var n = prototypeKeys.length; var key; for (var i = 0; i < n; ++i) { key = prototypeKeys[i]; element[key] = proto[key]; } Object.assign(element, elementConstructor.prototype); elementConstructor.call(element); }; Dom.prototype.makeNewElement = function (tagName) { return document.createElement(tagName); }; Dom.prototype.makeNewTextNode = function (data) { return document.createTextNode(data); }; /** * * @param {AbsolConstructDescriptor | string | {} } option * @param {boolean=} isInherited * @returns {AElementNS| AElement | Text} */ Dom.prototype._ = function (option, isInherited) { var res; var creator; if (Dom.isDomNode(option)) { res = option; option = {}; /** fix reinit component */ isInherited = true; } else { if (option.charAt) { option = option.trim(); if (option[0] === '<') { res = this.fromCode(option); option = {}; } else { var queryObj = _JSPath["default"].parseQuery(option); option = {}; option.tag = queryObj.tagName || this.defaultTag; if (queryObj.classList && queryObj.classList.length > 0) option["class"] = queryObj.classList; if (queryObj.id) option.id = queryObj.id; if (queryObj.attributes) option.attr = queryObj.attributes; } } } if (option.text || option.text === '') { //is textNode return this.makeNewTextNode(option.text); } option.tag = option.tag || this.defaultTag; creator = option.tag.prototype ? option.tag : this.creator[option.tag]; if (option.tag.prototype) option.tag = option.tag.tag; if (option.elt) { res = this._(option.elt); } else { if (!res) { if (creator) { if (creator.render) { res = creator.render(option.data, option, this); } else { res = creator(option.data, option, this); } } else { res = this.makeNewElement(option.tag); Object.assign(res, option.data); } } } this.attach(res); if (creator) { res._azar_extendTags = res._azar_extendTags || {}; res._azar_extendTags[option.tag] = creator; creator.property && Object.defineProperties(res, creator.property); creator.prototype && _OOP["default"]["extends"](res, creator.prototype); creator.attribute && res.defineAttributes(creator.attribute); if (creator.render) { if (creator.eventHandler) { res.eventHandler = res.eventHandler || {}; var eventHandler = _OOP["default"].bindFunctions(res, creator.eventHandler || creator.prototype.eventHandler); for (var eventHandlerKey in eventHandler) { if (res.eventHandler[eventHandlerKey]) { throw new Error("Same name of eventHandler[" + eventHandlerKey + "]"); } else { res.eventHandler[eventHandlerKey] = eventHandler[eventHandlerKey]; } } } creator.call(res); } } option.extendEvent && res.defineEvent(option.extendEvent); option.attr && res.attr(option.attr); option.on && res.on(option.on); option.once && res.once(option.once); option["class"] && res.addClass(option["class"]); option.style && res.addStyle(option.style); option.id && res.attr('id', option.id); if (!isInherited) res.init(option.props); var children = option.child; if (children) { if (!children.forEach || !children.map) { children = [children]; } for (var i = 0; i < children.length; ++i) { res.addChild(this._(children[i], false)); } } return res; }; /*** * * @type {function(Object, boolean): AElement} */ Dom.prototype.create = Dom.prototype._; /*** * * @param query * @param root * @returns {Array<AElement|AElementNS>} */ Dom.prototype.$$ = function (query, root) { var thisD = this; var res = []; this.selectAttacth(query, root, function (elt) { thisD.attach(elt); res.push(elt); }); return res; }; Dom.prototype.install = function (arg0, arg1) { var _this = this; if (arguments.length === 1) { if (arg0.creator && arg0.create && arg0.select) { // is a dom core var creator = arg0.creator; Object.keys(creator).forEach(function (key) { if (key.startsWith('_') || key.startsWith('$')) return; var func = creator[key]; if (typeof func == 'function') if (_this.creator[key] !== func) _this.creator[key] = func; }); } else if (typeof arg0 == 'function') { var name = arg0.tag || (0, _getFunctionName["default"])(arg0) || arg0.name; if (name) { this.creator[name.toLowerCase()] = arg0; } else { console.error('No ident name of creator function', arg0); } } else if (arg0 instanceof Array) { arg0.forEach(function (func) { var name = func.tag || (0, _getFunctionName["default"])(func) || func.name; if (name) { _this.creator[name.toLowerCase()] = func; } }); } else if (_typeof(arg0) == 'object') { Object.keys(arg0).forEach(function (key) { if (key.startsWith('_') || key.startsWith('$')) return; var func = arg0[key]; if (typeof func == 'function') if (_this.creator[key] !== func) _this.creator[key] = func; }); } else { console.error('Unknown data', arg0); } } else if (arguments.length === 2) { if (arg0 instanceof Array) { if (arg1.creator) arg1 = arg1.creator; arg0.forEach(function (key) { var func = arg1[key]; if (typeof func == 'function') if (_this.creator[key] !== func) _this.creator[key] = func; }); } else if (arg0 instanceof RegExp) { if (arg1.creator) arg1 = arg1.creator; Object.keys(arg1).forEach(function (key) { if (key.match(arg0)) { var func = arg1[key]; if (typeof func == 'function') if (_this.creator[key] !== func) _this.creator[key] = func; } }); } else if (typeof arg0 == 'string' && arg0.length > 0) { if (typeof arg1 == 'function') { this.creator[arg0] = arg1; } else { console.error('arg1 is not a function'); } } } else { console.error('Invalid param'); } return this; }; /*** * * @param {String | null} tagName */ Dom.prototype.require = function (tagName) { return this.creator[tagName] || null; }; /** * * @param {*} o * @returns {Boolean} */ function isDomNode(o) { return (typeof Node === "undefined" ? "undefined" : _typeof(Node)) === "object" ? o instanceof Node : o && _typeof(o) === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string"; } Dom.isDomNode = isDomNode; /** * @param {AElement|Node|HTMLElement} element */ function activeFullScreen(element) { if (element.requestFullscreen) { element.requestFullscreen(); } else if (element.mozRequestFullScreen) { element.mozRequestFullScreen(); } else if (element.webkitRequestFullscreen) { element.webkitRequestFullscreen(_AElement["default"].ALLOW_KEYBOARD_INPUT); } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } } Dom.activeFullScreen = activeFullScreen; function inactiveFullScreen() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } } Dom.inactiveFullScreen = inactiveFullScreen; //adapt var deactiveFullScreen = exports.deactiveFullScreen = inactiveFullScreen; Dom.deactiveFullScreen = deactiveFullScreen; function isFullScreen() { var fullScreenElement = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement; return !!fullScreenElement; } Dom.isFullScreen = isFullScreen; /** * @param {AElement|Node|HTMLElement} current * @returns {ClientRect} */ function traceOutBoundingClientRect(current) { var screenSize = Dom.getScreenSize(); var left = 0; var right = screenSize.width; var top = 0; var bottom = screenSize.height; var ox, oy, fixed; var bound; while (current) { fixed = _AElement["default"].prototype.getComputedStyleValue.call(current, 'position') == "fixed"; ox = _AElement["default"].prototype.getComputedStyleValue.call(current, 'overflow-x') !== "visible"; oy = _AElement["default"].prototype.getComputedStyleValue.call(current, 'overflow-y') !== "visible"; var isHtml = current.tagName.toLowerCase() === 'html'; if (ox || oy || isHtml || fixed) { if (isHtml) { bound = Object.assign({ left: 0, top: 0 }, getScreenSize()); bound.bottom = bound.height; bound.right = bound.width; } else { bound = current.getBoundingClientRect(); } if (ox || isHtml || fixed) { left = Math.max(left, bound.left); right = Math.min(right, bound.right); } if (oy || isHtml || fixed) { top = Math.max(top, bound.top); bottom = Math.min(bottom, bound.bottom); } } if (isHtml || fixed) break; current = current.parentElement; } return { left: left, right: right, top: top, bottom: bottom, width: right - left, height: bottom - top }; } Dom.traceOutBoundingClientRect = traceOutBoundingClientRect; /*** * * @param {string} fontFace * @param {number} timeout * @returns {Promise<boolean>} */ function fontFaceIsLoaded(fontFace, timeout) { timeout = timeout || 0; var element = this.ShareInstance._({ tag: 'span', style: { visibility: 'hidden', position: 'fixed', top: '-9999px', left: '-9999px', 'font-size': '256px' }, props: { innerHTML: "Test string long long long" } }); element.addTo(document.body); return element.afterAttached().then(function () { var lastOffsetWidth = element.getBoundingClientRect().width; element.addStyle('font-family', fontFace); return new Promise(function (resolve, reject) { function check(remainTime) { if (remainTime < 0) { resolve(false); element.selfRemove(); } else requestAnimationFrame(function () { var currentOffsetWidth = element.getBoundingClientRect().width; if (currentOffsetWidth != lastOffsetWidth) { resolve(true); element.selfRemove(); } else check(remainTime - 10); }); } check(timeout); }); }); } Dom.fontFaceIsLoaded = fontFaceIsLoaded; /*** * * @returns {{width: number, WIDTH: number, HEIGHT: number, height: number}} */ function getScreenSize() { var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; return { WIDTH: width, HEIGHT: height, width: width, height: height }; } Dom.getScreenSize = getScreenSize; /*** * * @param {HTMLImageElement} img * @param {number=} timeout * @returns {Promise<void>} */ function waitImageLoaded(img, timeout) { var isLoaded = true; if (!img.complete) { isLoaded = false; } if (img.naturalWidth === 0) { isLoaded = false; } if (isLoaded) return Promise.resolve(); if (!img.src) return Promise.resolve(); return new Promise(function (rs) { if (img.addEventListener) { img.addEventListener('load', rs, false); img.addEventListener('error', rs, false); } else { img.attachEvent('onload', rs, false); } setTimeout(rs, timeout || 5000); }); // No other way of checking: assume it’s ok. } Dom.waitImageLoaded = waitImageLoaded; /*** * * @param {HTMLIFrameElement| Worker} iframe * @returns {Promise} */ function waitIFrameLoaded(iframe) { return new Promise(function (rs, rj) { if (document.all) { iframe.onreadystatechange = function () { if (iframe.readyState === "complete" || iframe.readyState === "loaded") rs(); }; } else { iframe.onload = rs; } setTimeout(rs, 5000); }); } Dom.waitIFrameLoaded = waitIFrameLoaded; /*** * * @param {Image} element * @returns {Promise<HTMLCanvasElement>} */ function imageToCanvas(element) { if (typeof element == 'string') { element = Dom.ShareInstance.$(element); } if (element.tagName.toLowerCase() === 'img') { var preRender = Dom.ShareInstance._('div'); preRender.addStyle({ position: 'fixed', top: '0', left: '0', zIndex: '-10000', opacity: '0' }).addTo(document.body); var canvas = document.createElement("canvas"); preRender.addChild(canvas); return Dom.waitImageLoaded(element).then(function () { canvas.width = element.width; canvas.height = element.height; var context = canvas.getContext("2d"); context.drawImage(element, 0, 0); preRender.selfRemove(); return canvas; }); } else { throw new Error("AElement must be image"); } } Dom.imageToCanvas = imageToCanvas; Dom.ShareInstance = new Dom(); Dom.scrollWidthPromise; Dom.documentReady = new Promise(function (resolve) { if (document.body) { resolve(); } else { window.addEventListener("load", resolve); } }); function getScrollSize() { if (!Dom.scrollWidthPromise) Dom.scrollWidthPromise = new Promise(function (resolve) { function prerender() { var parent = Dom.ShareInstance._({ style: { 'z-index': '-100', opacity: '0', width: '100px', height: '100px', overflow: 'scroll', top: '0', left: '0', 'box-sizing': 'content-box', position: 'fixed' } }).addTo(document.body); var child = Dom.ShareInstance._({ style: { width: '100%', height: '100%' } }).addTo(parent); requestAnimationFrame(function () { var parentBound = parent.getBoundingClientRect(); var childBound = child.getBoundingClientRect(); resolve({ width: parentBound.width - childBound.width, height: parentBound.height - childBound.height }); parent.selfRemove(); }); } Dom.documentReady.then(prerender); }); return Dom.scrollWidthPromise; } Dom.getScrollSize = getScrollSize; /*** * * @param {(AElement|AElementNS|Node)} originElt * @param {function(originElt: (AElement|AElementNS|Node), originElt: (AElement|AElementNS|Node)):void } afterCloneCb * @return {AElement|AElementNS|Node} */ function depthClone(originElt, afterCloneCb) { /*** * * @type {AElement|AElementNS|Node} */ var newElt = originElt.cloneNode(); //no deep if (originElt.childNodes) { /*** * * @type {(AElement|AElementNS)[]} */ var children = Array.prototype.map.call(originElt.childNodes, function (child) { return depthClone(child, afterCloneCb); }); for (var i = 0; i < children.length; ++i) { newElt.appendChild(children[i]); } } return afterCloneCb && afterCloneCb(originElt, newElt) || newElt; } /*** * * @param originElt * @param afterCloneCb * @returns {AElement|HTMLElement|Node} */ function depthCloneWithStyle(originElt, afterCloneCb) { return depthClone(originElt, function (originElt, newElt) { if (!originElt.getAttribute && !originElt.getAttributeNS) return; copyStyleRule(originElt, newElt); afterCloneCb && afterCloneCb(originElt, newElt); }); } Dom.depthClone = depthClone; Dom.depthCloneWithStyle = depthCloneWithStyle; /*** * * @param {AElement|HTMLElement|Node}sourceElt * @param {AElement|HTMLElement|Node} destElt * @returns {AElement|HTMLElement|Node} */ function copyStyleRule(sourceElt, destElt) { if (!sourceElt.getAttribute && !sourceElt.getAttributeNS) return destElt; //is text node if (!destElt.getAttribute && !destElt.getAttributeNS) return destElt; //is text node, nothing to copy var cssRules = _AElement["default"].prototype.getCSSRules.call(sourceElt); var cssKey = cssRules.reduce(function (ac, rule) { for (var i = 0; i < rule.style.length; ++i) { ac[rule.style[i]] = true; } return ac; }, {}); for (var key in cssKey) { destElt.style[key] = _AElement["default"].prototype.getComputedStyleValue.call(sourceElt, key); } return destElt; } Dom.copyStyleRule = copyStyleRule; /** * */ function getSystemFontSize() { if (window.mobileHost && window.mobileHost.systemFont) { return window.mobileHost.systemFont.pointSize; } var _ = Dom.ShareInstance._; var initSpan = Dom.ShareInstance._({ tag: 'span', style: { font: 'inherit' } }); var appleSpan = Dom.ShareInstance._({ tag: 'span', style: { font: '-apple-system-body' } }).addTo(document.body); var renderer = _({ style: { font: 'initial', position: 'fixed', top: 0, left: 0, visibility: 'hidden', opacity: 0, zIndex: -100 }, child: [initSpan && appleSpan] }).addTo(document.body); var appleSize = appleSpan.getFontSize(); var initSize = initSpan.getFontSize(); var defaultSize = appleSize !== initSize ? appleSize : initSize; renderer.remove(); return Math.round(defaultSize * 14 / 16); } function getTextNodeBound(textNode) { if (document.createRange) { var range = document.createRange(); range.selectNodeContents(textNode); if (range.getBoundingClientRect) { return range.getBoundingClientRect(); } } return null; } Dom.getTextNodeBound = getTextNodeBound; /*** * get absol construct descriptor for HTML element only * @param {AElement | Text} elt * @returns {AbsolConstructDescriptor} */ function getConstructDescriptor(elt) { var obj = {}; obj.tag = elt.tagName.toLowerCase(); var classAttr = elt.getAttribute('class'); var classList; if (classAttr) classList = (0, _attribute.parseClassAttr)(classAttr); if (classList && classList.length > 0) obj["class"] = classList; var styleAttr = elt.getAttribute('style'); var style; if (styleAttr) style = (0, _attribute.parseStyleAttr)(styleAttr); var attributes = elt.attributes; var attNode; var attrName; var attrValue; var attr = {}; var on = {}; var props = {}; var eventMatch, eventName; var propMatch, propName; for (var i = 0; i < attributes.length; ++i) { attNode = attributes[i]; attrName = attNode.nodeName; attrValue = attNode.nodeValue; if (attrName == 'style' || attrName == 'class') continue; eventMatch = attrName.match(/^on(.+)/); if (eventMatch) { eventName = eventMatch[1]; on[eventName] = new Function('event', 'sender', attrValue); continue; } propMatch = attrName.match(/^prop-(.+)/); if (propMatch) { propName = propMatch[1]; props[propName] = attrValue; continue; } attr[attrName] = attrValue; } var key; for (key in style) { //style is not empty obj.style = style; break; } for (key in attr) { obj.attr = attr; break; } for (key in on) { obj.on = on; break; } for (key in props) { obj.props = props; break; } return obj; } Dom.getConstructDescriptor = getConstructDescriptor; Dom.addToResizeSystem = function (element) { _ResizeSystem["default"].add(element); }; Dom.updateResizeSystem = function () { _ResizeSystem["default"].update(); }; Dom.updateSizeUp = function (fromElt) { _ResizeSystem["default"].updateUp(fromElt); }; var _default = exports["default"] = Dom; /** * * @param elt */ function isVisibilityOnScreen(elt) { if (!elt) return false; if (!_AElement["default"].prototype.isDescendantOf.call(elt, document.body)) { return false; } var current = elt; var comStyle; while (current) { if (current === document.body) break; comStyle = window.getComputedStyle(current, null); if (comStyle.getPropertyValue('display') === 'none') return false; if (comStyle.getPropertyValue('visisbility') === 'hidden') return false; if (comStyle.getPropertyValue('opacity') === '0') return false; current = current.parentElement; } var bound = elt.getBoundingClientRect(); var outBound = traceOutBoundingClientRect(elt); if (bound.top > outBound.bottom) return false; if (bound.bottom < outBound.top) return false; if (bound.left > outBound.right) return false; if (bound.right < outBound.left) return false; return true; } Dom.isVisibilityOnScreen = isVisibilityOnScreen; /***/ }), /***/ 15973: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _Extensions$extension; function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var Extensions = __webpack_require__(86890); var GlGraphicsAdaptor = __webpack_require__(22905); var GlMeshAdaptor = __webpack_require__(5661); var GlBatchAdaptor = __webpack_require__(39062); var AbstractRenderer = __webpack_require__(59158); var SharedSystems = __webpack_require__(96406); var types = __webpack_require__(9634); var GlBufferSystem = __webpack_require__(46952); var GlContextSystem = __webpack_require__(84344); var GlGeometrySystem = __webpack_require__(85580); var GlBackBufferSystem = __webpack_require__(800); var GlColorMaskSystem = __webpack_require__(38084); var GlEncoderSystem = __webpack_require__(16051); var GlStencilSystem = __webpack_require__(10011); var GlUboSystem = __webpack_require__(68951); var GlRenderTargetSystem = __webpack_require__(58002); var GlShaderSystem = __webpack_require__(17058); var GlUniformGroupSystem = __webpack_require__(72360); var GlStateSystem = __webpack_require__(43528); var GlTextureSystem = __webpack_require__(90216); "use strict"; var DefaultWebGLSystems = [].concat(_toConsumableArray(SharedSystems.SharedSystems), [GlUboSystem.GlUboSystem, GlBackBufferSystem.GlBackBufferSystem, GlContextSystem.GlContextSystem, GlBufferSystem.GlBufferSystem, GlTextureSystem.GlTextureSystem, GlRenderTargetSystem.GlRenderTargetSystem, GlGeometrySystem.GlGeometrySystem, GlUniformGroupSystem.GlUniformGroupSystem, GlShaderSystem.GlShaderSystem, GlEncoderSystem.GlEncoderSystem, GlStateSystem.GlStateSystem, GlStencilSystem.GlStencilSystem, GlColorMaskSystem.GlColorMaskSystem]); var DefaultWebGLPipes = _toConsumableArray(SharedSystems.SharedRenderPipes); var DefaultWebGLAdapters = [GlBatchAdaptor.GlBatchAdaptor, GlMeshAdaptor.GlMeshAdaptor, GlGraphicsAdaptor.GlGraphicsAdaptor]; var systems = []; var renderPipes = []; var renderPipeAdaptors = []; Extensions.extensions.handleByNamedList(Extensions.ExtensionType.WebGLSystem, systems); Extensions.extensions.handleByNamedList(Extensions.ExtensionType.WebGLPipes, renderPipes); Extensions.extensions.handleByNamedList(Extensions.ExtensionType.WebGLPipesAdaptor, renderPipeAdaptors); (_Extensions$extension = Extensions.extensions).add.apply(_Extensions$extension, _toConsumableArray(DefaultWebGLSystems).concat(_toConsumableArray(DefaultWebGLPipes), DefaultWebGLAdapters)); var WebGLRenderer = /*#__PURE__*/function (_AbstractRenderer$Abs) { function WebGLRenderer() { _classCallCheck(this, WebGLRenderer); var systemConfig = { name: "webgl", type: types.RendererType.WEBGL, systems: systems, renderPipes: renderPipes, renderPipeAdaptors: renderPipeAdaptors }; return _callSuper(this, WebGLRenderer, [systemConfig]); } _inherits(WebGLRenderer, _AbstractRenderer$Abs); return _createClass(WebGLRenderer); }(AbstractRenderer.AbstractRenderer); exports.WebGLRenderer = WebGLRenderer; /***/ }), /***/ 16051: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var GlEncoderSystem = /*#__PURE__*/function () { function GlEncoderSystem(renderer) { _classCallCheck(this, GlEncoderSystem); this.commandFinished = Promise.resolve(); this._renderer = renderer; } return _createClass(GlEncoderSystem, [{ key: "setGeometry", value: function setGeometry(geometry, shader) { this._renderer.geometry.bind(geometry, shader.glProgram); } }, { key: "finishRenderPass", value: function finishRenderPass() {} }, { key: "draw", value: function draw(options) { var renderer = this._renderer; var geometry = options.geometry, shader = options.shader, state = options.state, skipSync = options.skipSync, type = options.topology, size = options.size, start = options.start, instanceCount = options.instanceCount; renderer.shader.bind(shader, skipSync); renderer.geometry.bind(geometry, renderer.shader._activeProgram); if (state) { renderer.state.set(state); } renderer.geometry.draw(type, size, start, instanceCount !== null && instanceCount !== void 0 ? instanceCount : geometry.instanceCount); } }, { key: "destroy", value: function destroy() { this._renderer = null; } }]); }(); /** @ignore */ GlEncoderSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "encoder" }; exports.GlEncoderSystem = GlEncoderSystem; /***/ }), /***/ 16385: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _pixi = __webpack_require__(3635); var _util = __webpack_require__(19330); /** * * @param {Level1Scene} scene * @constructor */ function Commander(scene) { this.scene = scene; this.cursorImg = new _pixi.Sprite(this.scene.assetMng.getTexture('arrow_small')); this.cursorImg.x = -13; this.cursorImg.y = -20; this.cursor = new _pixi.Container(); this.cursor.addChild(this.cursorImg); this.cursorKeyFrame = 2; this.cursorTarget = null; } Commander.prototype.onPointerDown = function (point) { var alliance = Object.values(this.scene.alliances).find(function (obj) { return obj.isHit(point); }); if (alliance) { alliance.tryUpgrade(); } var obj = Object.values(this.scene.enemies).find(function (obj) { return obj.isHit(point); }); obj = obj || Object.values(this.scene.staticObjects).find(function (obj) { return obj.isHit(point); }); if (obj) { this.cursorTarget = obj; this.cursorKeyFrame = 0; if (!this.cursor.parent) this.scene.pGrid.addChild(this.cursor); this.cursor.x = (obj.x + obj.width / 2) * 108; this.cursor.y = (obj.y + obj.height / 2) * 108; Object.values(this.scene.alliances).forEach(function (alliance) { alliance.tryLookingTo(obj); }); } else { this.cursorKeyFrame = 10; if (this.cursor.parent) this.cursor.parent.removeChild(this.cursor); Object.values(this.scene.alliances).forEach(function (alliance) { alliance.dontFireStatic(obj); }); } return true; }; Commander.prototype.onPointerUp = function (point) {}; Commander.prototype.update = function (deltaTime) { if (this.cursorTarget && this.cursorTarget.hp <= 0) { this.cursorTarget = null; } this.updateCursor(deltaTime); }; Commander.prototype.updateCursor = function (deltaTime) { var t, obj = this.cursorTarget; if (obj) { Object.values(this.scene.alliances).forEach(function (alliance) { alliance.tryLookingTo(obj); }); this.cursor.x = (obj.x + obj.width / 2) * 108; this.cursor.y = obj.y * 108; this.cursorKeyFrame += deltaTime / 3000; t = this.cursorKeyFrame * 10 % 2; t = t > 1 ? 2 - t : t; t = (0, _util.bezierBlend)(t); this.cursorImg.y = -20 + 5 * t; } else { if (this.cursor.parent) this.cursor.parent.removeChild(this.cursor); } }; var _default = exports["default"] = Commander; /***/ }), /***/ 16508: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var copySearchParams = function copySearchParams(targetUrl, sourceUrl) { var searchParams = sourceUrl.split("?")[1]; if (searchParams) { targetUrl += "?".concat(searchParams); } return targetUrl; }; exports.copySearchParams = copySearchParams; /***/ }), /***/ 16680: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var converters = { rgb8unorm: { convertedFormat: "rgba8unorm", convertFunction: convertRGBtoRGBA }, "rgb8unorm-srgb": { convertedFormat: "rgba8unorm-srgb", convertFunction: convertRGBtoRGBA } }; function convertFormatIfRequired(textureOptions) { var format = textureOptions.format; if (converters[format]) { var convertFunction = converters[format].convertFunction; var levelBuffers = textureOptions.resource; for (var i = 0; i < levelBuffers.length; i++) { levelBuffers[i] = convertFunction(levelBuffers[i]); } textureOptions.format = converters[format].convertedFormat; } } function convertRGBtoRGBA(levelBuffer) { var pixelCount = levelBuffer.byteLength / 3; var levelBufferWithAlpha = new Uint32Array(pixelCount); for (var i = 0; i < pixelCount; ++i) { levelBufferWithAlpha[i] = levelBuffer[i * 3] + (levelBuffer[i * 3 + 1] << 8) + (levelBuffer[i * 3 + 2] << 16) + 4278190080; } return new Uint8Array(levelBufferWithAlpha.buffer); } exports.convertFormatIfRequired = convertFormatIfRequired; /***/ }), /***/ 16711: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _AbstractScene = _interopRequireDefault(__webpack_require__(33186)); var _OOP = __webpack_require__(64181); var _FCore = __webpack_require__(49997); var _Level1Scene = _interopRequireDefault(__webpack_require__(26387)); var _MainMenuScene = _interopRequireDefault(__webpack_require__(40918)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @extends AbstractScene * @constructor */ function Map1Scene() { _AbstractScene["default"].apply(this, arguments); } (0, _OOP.mixClass)(Map1Scene, _AbstractScene["default"]); Map1Scene.prototype.create = function () { var _this = this; this.$homeBtn = (0, _FCore._)({ tag: 'button', "class": ['as-img-btn', 'as-map-scene-page-arrow-btn'], style: { left: '40px', top: '40px' }, child: { tag: 'img', attr: { src: 'assets/home_btn.png' } }, on: { click: function click() { return _this.app.startScene(_MainMenuScene["default"]); } } }); this.$prevBtn = (0, _FCore._)({ tag: 'button', "class": ['as-img-btn', 'as-map-scene-page-arrow-btn', 'as-left'], child: { tag: 'img', attr: { src: 'assets/page_arrow_left.png' } }, on: { click: function click() { return _this.prevPage(); } } }); this.$nextBtn = (0, _FCore._)({ tag: 'button', "class": ['as-img-btn', 'as-map-scene-page-arrow-btn', 'as-right'], child: { tag: 'img', attr: { src: 'assets/page_arrow_right.png' } }, on: { click: function click() { return _this.nextPage(); } } }); this.$gui = (0, _FCore._)({ "class": 'as-map-scene', child: [this.$homeBtn, this.$prevBtn, this.$nextBtn] }); this.$pages = [this.makePage({ idx: 0, name: 'gia_lai_map', levels: [{ x: 370, y: 1660, scene: _Level1Scene["default"] }, { x: 930, y: 1630 }, { x: 1200, y: 1050 }, { x: 540, y: 620 }, { x: 1109, y: 600 }] }), this.makePage({ idx: 1, name: 'daklak_map' }), this.makePage({ idx: 2, name: 'lam_dong_map' }), this.makePage({ idx: 3, name: 'daknong_map' }), this.makePage({ idx: 4, name: 'kon_tum_map' })]; this.$gui.addChild(this.$pages); }; Map1Scene.prototype.onStart = function () { var _this2 = this; this.$gui.addTo(this.$foreground); setTimeout(function () { _this2.$pages[0].$viewport.scrollTop = 1107; _this2.$pages[1].$viewport.scrollTop = 300; _this2.$pages[2].$viewport.scrollTop = 300; _this2.$pages[3].$viewport.scrollTop = 500; _this2.$pages[4].$viewport.scrollTop = 500; }, 1); this.pageIdx = 0; }; Map1Scene.prototype.nextPage = function () { var _this3 = this; var curPage = this.$pages[this.pageIdx]; this.pageIdx = (this.pageIdx + 1) % this.$pages.length; if (this.pageIdx === 0) { this.$pages[0].$viewport.scrollTop = 1107; } var nextPage = this.$pages[this.pageIdx]; nextPage.addStyle('left', '1620px'); this.$nextBtn.disabled = true; curPage.addStyle('transition', ' left 0.25s ease-in-out'); nextPage.addStyle('transition', ' left 0.25s ease-in-out'); setTimeout(function () { curPage.addStyle('left', '-1620px'); nextPage.addStyle('left', '0px'); setTimeout(function () { _this3.$nextBtn.disabled = false; curPage.removeStyle('transition'); nextPage.removeStyle('transition'); }, 300); }, 30); }; Map1Scene.prototype.prevPage = function () { var _this4 = this; var curPage = this.$pages[this.pageIdx]; this.pageIdx = (this.pageIdx + (this.$pages.length - 1)) % this.$pages.length; if (this.pageIdx === 0) { this.$pages[0].$viewport.scrollTop = 1107; } var prevPage = this.$pages[this.pageIdx]; prevPage.addStyle('left', '-1620px'); this.$prevBtn.disabled = true; curPage.addStyle('transition', ' left 0.25s ease-in-out'); prevPage.addStyle('transition', ' left 0.25s ease-in-out'); setTimeout(function () { curPage.addStyle('left', '1620px'); prevPage.addStyle('left', '0px'); setTimeout(function () { _this4.$prevBtn.disabled = false; curPage.removeStyle('transition'); prevPage.removeStyle('transition'); }, 300); }, 30); }; Map1Scene.prototype.makePage = function (data) { var _this5 = this; var pageElt = (0, _FCore._)({ "class": 'as-map-scene-page', style: { left: data.idx * 1620 + 'px' }, child: [{ "class": 'as-map-scene-page-viewport', child: [{ "class": 'as-map-scene-page-content', child: [{ tag: 'img', attr: { src: 'assets/' + data.name + '.png' } }] }] }] }); pageElt.$viewport = (0, _FCore.$)('.as-map-scene-page-viewport', pageElt); pageElt.$content = (0, _FCore.$)('.as-map-scene-page-content', pageElt); if (data.levels) { data.levels.forEach(function (level) { var btn = (0, _FCore._)({ tag: 'button', style: { left: level.x + 'px', top: level.y + 'px' }, "class": ['as-img-btn', 'as-map-scene-level-btn'], child: { tag: 'img', attr: { src: 'assets/locked_btn.png' } }, on: { click: function click() { if (level.scene) _this5.app.startScene(level.scene); } } }); if (!level.scene) { btn.disabled = true; } pageElt.$content.addChild(btn); }); } return pageElt; }; Map1Scene.prototype.onStop = function () { this.$gui.remove(); }; var _default = exports["default"] = Map1Scene; /***/ }), /***/ 17019: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Matrix = __webpack_require__(20764); var InstructionSet = __webpack_require__(15571); var TexturePool = __webpack_require__(53248); "use strict"; var RenderGroup = /*#__PURE__*/function () { function RenderGroup() { _classCallCheck(this, RenderGroup); this.renderPipeId = "renderGroup"; this.root = null; this.canBundle = false; this.renderGroupParent = null; this.renderGroupChildren = []; this.worldTransform = new Matrix.Matrix(); this.worldColorAlpha = 4294967295; this.worldColor = 16777215; this.worldAlpha = 1; // these updates are transform changes.. this.childrenToUpdate = /* @__PURE__ */Object.create(null); this.updateTick = 0; this.gcTick = 0; // these update are renderable changes.. this.childrenRenderablesToUpdate = { list: [], index: 0 }; // other this.structureDidChange = true; this.instructionSet = new InstructionSet.InstructionSet(); this._onRenderContainers = []; /** * Indicates if the cached texture needs to be updated. * @default true */ this.textureNeedsUpdate = true; /** * Indicates if the container should be cached as a texture. * @default false */ this.isCachedAsTexture = false; this._matrixDirty = 7; } return _createClass(RenderGroup, [{ key: "init", value: function init(root) { this.root = root; if (root._onRender) this.addOnRender(root); root.didChange = true; var children = root.children; for (var i = 0; i < children.length; i++) { var child = children[i]; child._updateFlags = 15; this.addChild(child); } } }, { key: "enableCacheAsTexture", value: function enableCacheAsTexture() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; this.textureOptions = options; this.isCachedAsTexture = true; this.textureNeedsUpdate = true; } }, { key: "disableCacheAsTexture", value: function disableCacheAsTexture() { this.isCachedAsTexture = false; if (this.texture) { TexturePool.TexturePool.returnTexture(this.texture); this.texture = null; } } }, { key: "updateCacheTexture", value: function updateCacheTexture() { this.textureNeedsUpdate = true; } }, { key: "reset", value: function reset() { this.renderGroupChildren.length = 0; for (var i in this.childrenToUpdate) { var childrenAtDepth = this.childrenToUpdate[i]; childrenAtDepth.list.fill(null); childrenAtDepth.index = 0; } this.childrenRenderablesToUpdate.index = 0; this.childrenRenderablesToUpdate.list.fill(null); this.root = null; this.updateTick = 0; this.structureDidChange = true; this._onRenderContainers.length = 0; this.renderGroupParent = null; this.disableCacheAsTexture(); } }, { key: "localTransform", get: function get() { return this.root.localTransform; } }, { key: "addRenderGroupChild", value: function addRenderGroupChild(renderGroupChild) { if (renderGroupChild.renderGroupParent) { renderGroupChild.renderGroupParent._removeRenderGroupChild(renderGroupChild); } renderGroupChild.renderGroupParent = this; this.renderGroupChildren.push(renderGroupChild); } }, { key: "_removeRenderGroupChild", value: function _removeRenderGroupChild(renderGroupChild) { var index = this.renderGroupChildren.indexOf(renderGroupChild); if (index > -1) { this.renderGroupChildren.splice(index, 1); } renderGroupChild.renderGroupParent = null; } }, { key: "addChild", value: function addChild(child) { this.structureDidChange = true; child.parentRenderGroup = this; child.updateTick = -1; if (child.parent === this.root) { child.relativeRenderGroupDepth = 1; } else { child.relativeRenderGroupDepth = child.parent.relativeRenderGroupDepth + 1; } child.didChange = true; this.onChildUpdate(child); if (child.renderGroup) { this.addRenderGroupChild(child.renderGroup); return; } if (child._onRender) this.addOnRender(child); var children = child.children; for (var i = 0; i < children.length; i++) { this.addChild(children[i]); } } }, { key: "removeChild", value: function removeChild(child) { this.structureDidChange = true; if (child._onRender) { if (!child.renderGroup) { this.removeOnRender(child); } } child.parentRenderGroup = null; if (child.renderGroup) { this._removeRenderGroupChild(child.renderGroup); return; } var children = child.children; for (var i = 0; i < children.length; i++) { this.removeChild(children[i]); } } }, { key: "removeChildren", value: function removeChildren(children) { for (var i = 0; i < children.length; i++) { this.removeChild(children[i]); } } }, { key: "onChildUpdate", value: function onChildUpdate(child) { var childrenToUpdate = this.childrenToUpdate[child.relativeRenderGroupDepth]; if (!childrenToUpdate) { childrenToUpdate = this.childrenToUpdate[child.relativeRenderGroupDepth] = { index: 0, list: [] }; } childrenToUpdate.list[childrenToUpdate.index++] = child; } }, { key: "updateRenderable", value: function updateRenderable(renderable) { if (renderable.globalDisplayStatus < 7) return; this.instructionSet.renderPipes[renderable.renderPipeId].updateRenderable(renderable); renderable.didViewUpdate = false; } }, { key: "onChildViewUpdate", value: function onChildViewUpdate(child) { this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++] = child; } }, { key: "isRenderable", get: function get() { return this.root.localDisplayStatus === 7 && this.worldAlpha > 0; } /** * adding a container to the onRender list will make sure the user function * passed in to the user defined 'onRender` callBack * @param container - the container to add to the onRender list */ }, { key: "addOnRender", value: function addOnRender(container) { this._onRenderContainers.push(container); } }, { key: "removeOnRender", value: function removeOnRender(container) { this._onRenderContainers.splice(this._onRenderContainers.indexOf(container), 1); } }, { key: "runOnRender", value: function runOnRender(renderer) { for (var i = 0; i < this._onRenderContainers.length; i++) { this._onRenderContainers[i]._onRender(renderer); } } }, { key: "destroy", value: function destroy() { this.disableCacheAsTexture(); this.renderGroupParent = null; this.root = null; this.childrenRenderablesToUpdate = null; this.childrenToUpdate = null; this.renderGroupChildren = null; this._onRenderContainers = null; this.instructionSet = null; } }, { key: "getChildren", value: function getChildren() { var out = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var children = this.root.children; for (var i = 0; i < children.length; i++) { this._getChildren(children[i], out); } return out; } }, { key: "_getChildren", value: function _getChildren(container) { var out = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; out.push(container); if (container.renderGroup) return out; var children = container.children; for (var i = 0; i < children.length; i++) { this._getChildren(children[i], out); } return out; } }, { key: "invalidateMatrices", value: function invalidateMatrices() { this._matrixDirty = 7; } /** * Returns the inverse of the world transform matrix. * @returns {Matrix} The inverse of the world transform matrix. */ }, { key: "inverseWorldTransform", get: function get() { if ((this._matrixDirty & 1) === 0) return this._inverseWorldTransform; this._matrixDirty &= ~1; this._inverseWorldTransform || (this._inverseWorldTransform = new Matrix.Matrix()); return this._inverseWorldTransform.copyFrom(this.worldTransform).invert(); } /** * Returns the inverse of the texture offset transform matrix. * @returns {Matrix} The inverse of the texture offset transform matrix. */ }, { key: "textureOffsetInverseTransform", get: function get() { if ((this._matrixDirty & 2) === 0) return this._textureOffsetInverseTransform; this._matrixDirty &= ~2; this._textureOffsetInverseTransform || (this._textureOffsetInverseTransform = new Matrix.Matrix()); return this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x, -this._textureBounds.y); } /** * Returns the inverse of the parent texture transform matrix. * This is used to properly transform coordinates when rendering into cached textures. * @returns {Matrix} The inverse of the parent texture transform matrix. */ }, { key: "inverseParentTextureTransform", get: function get() { if ((this._matrixDirty & 4) === 0) return this._inverseParentTextureTransform; this._matrixDirty &= ~4; var parentCacheAsTexture = this._parentCacheAsTextureRenderGroup; if (parentCacheAsTexture) { this._inverseParentTextureTransform || (this._inverseParentTextureTransform = new Matrix.Matrix()); return this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(parentCacheAsTexture.inverseWorldTransform).translate(-parentCacheAsTexture._textureBounds.x, -parentCacheAsTexture._textureBounds.y); } return this.worldTransform; } /** * Returns a matrix that transforms coordinates to the correct coordinate space of the texture being rendered to. * This is the texture offset inverse transform of the closest parent RenderGroup that is cached as a texture. * @returns {Matrix | null} The transform matrix for the cached texture coordinate space, * or null if no parent is cached as texture. */ }, { key: "cacheToLocalTransform", get: function get() { if (!this._parentCacheAsTextureRenderGroup) return null; return this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform; } }]); }(); exports.RenderGroup = RenderGroup; /***/ }), /***/ 17058: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var maxRecommendedTextures = __webpack_require__(6899); var GenerateShaderSyncCode = __webpack_require__(70809); var generateProgram = __webpack_require__(40559); "use strict"; var defaultSyncData = { textureCount: 0, blockIndex: 0 }; var GlShaderSystem = /*#__PURE__*/function () { function GlShaderSystem(renderer) { _classCallCheck(this, GlShaderSystem); /** * @internal * @private */ this._activeProgram = null; this._programDataHash = /* @__PURE__ */Object.create(null); this._shaderSyncFunctions = /* @__PURE__ */Object.create(null); this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_programDataHash"); } return _createClass(GlShaderSystem, [{ key: "contextChange", value: function contextChange(gl) { this._gl = gl; this._programDataHash = /* @__PURE__ */Object.create(null); this._shaderSyncFunctions = /* @__PURE__ */Object.create(null); this._activeProgram = null; this.maxTextures = maxRecommendedTextures.getMaxTexturesPerBatch(); } /** * Changes the current shader to the one given in parameter. * @param shader - the new shader * @param skipSync - false if the shader should automatically sync its uniforms. * @returns the glProgram that belongs to the shader. */ }, { key: "bind", value: function bind(shader, skipSync) { this._setProgram(shader.glProgram); if (skipSync) return; defaultSyncData.textureCount = 0; defaultSyncData.blockIndex = 0; var syncFunction = this._shaderSyncFunctions[shader.glProgram._key]; if (!syncFunction) { syncFunction = this._shaderSyncFunctions[shader.glProgram._key] = this._generateShaderSync(shader, this); } this._renderer.buffer.nextBindBase(!!shader.glProgram.transformFeedbackVaryings); syncFunction(this._renderer, shader, defaultSyncData); } /** * Updates the uniform group. * @param uniformGroup - the uniform group to update */ }, { key: "updateUniformGroup", value: function updateUniformGroup(uniformGroup) { this._renderer.uniformGroup.updateUniformGroup(uniformGroup, this._activeProgram, defaultSyncData); } /** * Binds a uniform block to the shader. * @param uniformGroup - the uniform group to bind * @param name - the name of the uniform block * @param index - the index of the uniform block */ }, { key: "bindUniformBlock", value: function bindUniformBlock(uniformGroup, name) { var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var bufferSystem = this._renderer.buffer; var programData = this._getProgramData(this._activeProgram); var isBufferResource = uniformGroup._bufferResource; if (!isBufferResource) { this._renderer.ubo.updateUniformGroup(uniformGroup); } var buffer = uniformGroup.buffer; var glBuffer = bufferSystem.updateBuffer(buffer); var boundLocation = bufferSystem.freeLocationForBufferBase(glBuffer); if (isBufferResource) { var offset = uniformGroup.offset, size = uniformGroup.size; if (offset === 0 && size === buffer.data.byteLength) { bufferSystem.bindBufferBase(glBuffer, boundLocation); } else { bufferSystem.bindBufferRange(glBuffer, boundLocation, offset); } } else if (bufferSystem.getLastBindBaseLocation(glBuffer) !== boundLocation) { bufferSystem.bindBufferBase(glBuffer, boundLocation); } var uniformBlockIndex = this._activeProgram._uniformBlockData[name].index; if (programData.uniformBlockBindings[index] === boundLocation) return; programData.uniformBlockBindings[index] = boundLocation; this._renderer.gl.uniformBlockBinding(programData.program, uniformBlockIndex, boundLocation); } }, { key: "_setProgram", value: function _setProgram(program) { if (this._activeProgram === program) return; this._activeProgram = program; var programData = this._getProgramData(program); this._gl.useProgram(programData.program); } /** * @param program - the program to get the data for * @internal * @private */ }, { key: "_getProgramData", value: function _getProgramData(program) { return this._programDataHash[program._key] || this._createProgramData(program); } }, { key: "_createProgramData", value: function _createProgramData(program) { var key = program._key; this._programDataHash[key] = generateProgram.generateProgram(this._gl, program); return this._programDataHash[key]; } }, { key: "destroy", value: function destroy() { for (var _i = 0, _Object$keys = Object.keys(this._programDataHash); _i < _Object$keys.length; _i++) { var key = _Object$keys[_i]; var programData = this._programDataHash[key]; programData.destroy(); this._programDataHash[key] = null; } this._programDataHash = null; } /** * Creates a function that can be executed that will sync the shader as efficiently as possible. * Overridden by the unsafe eval package if you don't want eval used in your project. * @param shader - the shader to generate the sync function for * @param shaderSystem - the shader system to use * @returns - the generated sync function * @ignore */ }, { key: "_generateShaderSync", value: function _generateShaderSync(shader, shaderSystem) { return GenerateShaderSyncCode.generateShaderSyncCode(shader, shaderSystem); } }, { key: "resetState", value: function resetState() { this._activeProgram = null; } }]); }(); /** @ignore */ GlShaderSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "shader" }; exports.GlShaderSystem = GlShaderSystem; /***/ }), /***/ 17107: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 17660: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var deprecation = __webpack_require__(11225); "use strict"; var AbstractBitmapFont = /*#__PURE__*/function (_EventEmitter) { function AbstractBitmapFont() { var _this; _classCallCheck(this, AbstractBitmapFont); _this = _callSuper(this, AbstractBitmapFont, arguments); /** The map of characters by character code. */ _this.chars = /* @__PURE__ */Object.create(null); /** * The line-height of the font face in pixels. * @type {number} */ _this.lineHeight = 0; /** * The name of the font face * @type {string} */ _this.fontFamily = ""; /** The metrics of the font face. */ _this.fontMetrics = { fontSize: 0, ascent: 0, descent: 0 }; /** * The offset of the font face from the baseline. * @type {number} */ _this.baseLineOffset = 0; /** The range and type of the distance field for this font. */ _this.distanceField = { type: "none", range: 0 }; /** The map of base page textures (i.e., sheets of glyphs). */ _this.pages = []; /** should the fill for this font be applied as a tint to the text. */ _this.applyFillAsTint = true; /** The size of the font face in pixels. */ _this.baseMeasurementFontSize = 100; _this.baseRenderedFontSize = 100; return _this; } /** * The name of the font face. * @deprecated since 8.0.0 Use `fontFamily` instead. */ _inherits(AbstractBitmapFont, _EventEmitter); return _createClass(AbstractBitmapFont, [{ key: "font", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."); return this.fontFamily; } /** * The map of base page textures (i.e., sheets of glyphs). * @deprecated since 8.0.0 Use `pages` instead. */ }, { key: "pageTextures", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."); return this.pages; } /** * The size of the font face in pixels. * @deprecated since 8.0.0 Use `fontMetrics.fontSize` instead. */ }, { key: "size", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."); return this.fontMetrics.fontSize; } /** * The kind of distance field for this font or "none". * @deprecated since 8.0.0 Use `distanceField.type` instead. */ }, { key: "distanceFieldRange", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."); return this.distanceField.range; } /** * The range of the distance field in pixels. * @deprecated since 8.0.0 Use `distanceField.range` instead. */ }, { key: "distanceFieldType", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."); return this.distanceField.type; } }, { key: "destroy", value: function destroy() { var destroyTextures = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this.emit("destroy", this); this.removeAllListeners(); for (var i in this.chars) { var _this$chars$i$texture; (_this$chars$i$texture = this.chars[i].texture) === null || _this$chars$i$texture === void 0 || _this$chars$i$texture.destroy(); } this.chars = null; if (destroyTextures) { this.pages.forEach(function (page) { return page.texture.destroy(true); }); this.pages = null; } } }]); }(EventEmitter); exports.AbstractBitmapFont = AbstractBitmapFont; /***/ }), /***/ 18229: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var PinLightBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function PinLightBlend() { _classCallCheck(this, PinLightBlend); return _callSuper(this, PinLightBlend, [{ gl: { functions: "\n float pinLight(float base, float blend)\n {\n return (blend <= 0.5) ? min(base, 2.0 * blend) : max(base, 2.0 * (blend - 0.5));\n }\n\n vec3 blendPinLight(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n pinLight(base.r, blend.r),\n pinLight(base.g, blend.g),\n pinLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn pinLight(base: f32, blend: f32) -> f32\n {\n return select(max(base,2.0*(blend-0.5)), min(base,2.0*blend), blend <= 0.5);\n }\n\n fn blendPinLight(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n pinLight(base.r, blend.r),\n pinLight(base.g, blend.g),\n pinLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(PinLightBlend, _BlendModeFilter$Blen); return _createClass(PinLightBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ PinLightBlend.extension = { name: "pin-light", type: Extensions.ExtensionType.BlendMode }; exports.PinLightBlend = PinLightBlend; /***/ }), /***/ 18322: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var LinearBurnBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function LinearBurnBlend() { _classCallCheck(this, LinearBurnBlend); return _callSuper(this, LinearBurnBlend, [{ gl: { functions: "\n float linearBurn(float base, float blend)\n {\n return max(0.0, base + blend - 1.0);\n }\n\n vec3 blendLinearBurn(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n linearBurn(base.r, blend.r),\n linearBurn(base.g, blend.g),\n linearBurn(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendLinearBurn(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn linearBurn(base: f32, blend: f32) -> f32\n {\n return max(0.0, base + blend - 1.0);\n }\n\n fn blendLinearBurn(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n linearBurn(base.r, blend.r),\n linearBurn(base.g, blend.g),\n linearBurn(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendLinearBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(LinearBurnBlend, _BlendModeFilter$Blen); return _createClass(LinearBurnBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ LinearBurnBlend.extension = { name: "linear-burn", type: Extensions.ExtensionType.BlendMode }; exports.LinearBurnBlend = LinearBurnBlend; /***/ }), /***/ 18410: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var glUploadImageResource = __webpack_require__(13864); "use strict"; var glUploadVideoResource = { id: "video", upload: function upload(source, glTexture, gl, webGLVersion) { if (!source.isValid) { gl.texImage2D(glTexture.target, 0, glTexture.internalFormat, 1, 1, 0, glTexture.format, glTexture.type, null); return; } glUploadImageResource.glUploadImageResource.upload(source, glTexture, gl, webGLVersion); } }; exports.glUploadVideoResource = glUploadVideoResource; /***/ }), /***/ 18486: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 18578: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var deprecation = __webpack_require__(11225); "use strict"; var MSAA_QUALITY = /* @__PURE__ */function (MSAA_QUALITY2) { MSAA_QUALITY2[MSAA_QUALITY2["NONE"] = 0] = "NONE"; MSAA_QUALITY2[MSAA_QUALITY2["LOW"] = 2] = "LOW"; MSAA_QUALITY2[MSAA_QUALITY2["MEDIUM"] = 4] = "MEDIUM"; MSAA_QUALITY2[MSAA_QUALITY2["HIGH"] = 8] = "HIGH"; return MSAA_QUALITY2; }(MSAA_QUALITY || {}); var DEPRECATED_WRAP_MODES = /* @__PURE__ */function (DEPRECATED_WRAP_MODES2) { DEPRECATED_WRAP_MODES2["CLAMP"] = "clamp-to-edge"; DEPRECATED_WRAP_MODES2["REPEAT"] = "repeat"; DEPRECATED_WRAP_MODES2["MIRRORED_REPEAT"] = "mirror-repeat"; return DEPRECATED_WRAP_MODES2; }(DEPRECATED_WRAP_MODES || {}); var WRAP_MODES = new Proxy(DEPRECATED_WRAP_MODES, { get: function get(target, prop) { deprecation.deprecation(deprecation.v8_0_0, "DRAW_MODES.".concat(prop, " is deprecated, use '").concat(DEPRECATED_WRAP_MODES[prop], "' instead")); return target[prop]; } }); var DEPRECATED_SCALE_MODES = /* @__PURE__ */function (DEPRECATED_SCALE_MODES2) { DEPRECATED_SCALE_MODES2["NEAREST"] = "nearest"; DEPRECATED_SCALE_MODES2["LINEAR"] = "linear"; return DEPRECATED_SCALE_MODES2; }(DEPRECATED_SCALE_MODES || {}); var SCALE_MODES = new Proxy(DEPRECATED_SCALE_MODES, { get: function get(target, prop) { deprecation.deprecation(deprecation.v8_0_0, "DRAW_MODES.".concat(prop, " is deprecated, use '").concat(DEPRECATED_SCALE_MODES[prop], "' instead")); return target[prop]; } }); exports.DEPRECATED_SCALE_MODES = DEPRECATED_SCALE_MODES; exports.DEPRECATED_WRAP_MODES = DEPRECATED_WRAP_MODES; exports.MSAA_QUALITY = MSAA_QUALITY; exports.SCALE_MODES = SCALE_MODES; exports.WRAP_MODES = WRAP_MODES; /***/ }), /***/ 18591: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var triangulateWithHoles = __webpack_require__(39333); "use strict"; var emptyArray = []; var buildPolygon = { extension: { type: Extensions.ExtensionType.ShapeBuilder, name: "polygon" }, build: function build(shape, points) { for (var i = 0; i < shape.points.length; i++) { points[i] = shape.points[i]; } return points; }, triangulate: function triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) { triangulateWithHoles.triangulateWithHoles(points, emptyArray, vertices, verticesStride, verticesOffset, indices, indicesOffset); } }; exports.buildPolygon = buildPolygon; /***/ }), /***/ 18964: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var Bounds = __webpack_require__(76631); var uid = __webpack_require__(90844); var Buffer = __webpack_require__(59832); var ensureIsBuffer = __webpack_require__(9258); var getGeometryBounds = __webpack_require__(1021); "use strict"; function ensureIsAttribute(attribute) { if (attribute instanceof Buffer.Buffer || Array.isArray(attribute) || attribute.BYTES_PER_ELEMENT) { attribute = { buffer: attribute }; } attribute.buffer = ensureIsBuffer.ensureIsBuffer(attribute.buffer, false); return attribute; } var Geometry = /*#__PURE__*/function (_EventEmitter) { /** * Create a new instance of a geometry * @param options - The options for the geometry. */ function Geometry() { var _options$instanceCoun; var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, Geometry); _this = _callSuper(this, Geometry); /** The unique id of the geometry. */ _this.uid = uid.uid("geometry"); /** * the layout key will be generated by WebGPU all geometries that have the same structure * will have the same layout key. This is used to cache the pipeline layout * @internal * @ignore */ _this._layoutKey = 0; /** the instance count of the geometry to draw */ _this.instanceCount = 1; _this._bounds = new Bounds.Bounds(); _this._boundsDirty = true; var attributes = options.attributes, indexBuffer = options.indexBuffer, topology = options.topology; _this.buffers = []; _this.attributes = {}; if (attributes) { for (var i in attributes) { _this.addAttribute(i, attributes[i]); } } _this.instanceCount = (_options$instanceCoun = options.instanceCount) !== null && _options$instanceCoun !== void 0 ? _options$instanceCoun : 1; if (indexBuffer) { _this.addIndex(indexBuffer); } _this.topology = topology || "triangle-list"; return _this; } _inherits(Geometry, _EventEmitter); return _createClass(Geometry, [{ key: "onBufferUpdate", value: function onBufferUpdate() { this._boundsDirty = true; this.emit("update", this); } /** * Returns the requested attribute. * @param id - The name of the attribute required * @returns - The attribute requested. */ }, { key: "getAttribute", value: function getAttribute(id) { return this.attributes[id]; } /** * Returns the index buffer * @returns - The index buffer. */ }, { key: "getIndex", value: function getIndex() { return this.indexBuffer; } /** * Returns the requested buffer. * @param id - The name of the buffer required. * @returns - The buffer requested. */ }, { key: "getBuffer", value: function getBuffer(id) { return this.getAttribute(id).buffer; } /** * Used to figure out how many vertices there are in this geometry * @returns the number of vertices in the geometry */ }, { key: "getSize", value: function getSize() { for (var i in this.attributes) { var attribute = this.attributes[i]; var buffer = attribute.buffer; return buffer.data.length / (attribute.stride / 4 || attribute.size); } return 0; } /** * Adds an attribute to the geometry. * @param name - The name of the attribute to add. * @param attributeOption - The attribute option to add. */ }, { key: "addAttribute", value: function addAttribute(name, attributeOption) { var attribute = ensureIsAttribute(attributeOption); var bufferIndex = this.buffers.indexOf(attribute.buffer); if (bufferIndex === -1) { this.buffers.push(attribute.buffer); attribute.buffer.on("update", this.onBufferUpdate, this); attribute.buffer.on("change", this.onBufferUpdate, this); } this.attributes[name] = attribute; } /** * Adds an index buffer to the geometry. * @param indexBuffer - The index buffer to add. Can be a Buffer, TypedArray, or an array of numbers. */ }, { key: "addIndex", value: function addIndex(indexBuffer) { this.indexBuffer = ensureIsBuffer.ensureIsBuffer(indexBuffer, true); this.buffers.push(this.indexBuffer); } /** Returns the bounds of the geometry. */ }, { key: "bounds", get: function get() { if (!this._boundsDirty) return this._bounds; this._boundsDirty = false; return getGeometryBounds.getGeometryBounds(this, "aPosition", this._bounds); } /** * destroys the geometry. * @param destroyBuffers - destroy the buffers associated with this geometry */ }, { key: "destroy", value: function destroy() { var destroyBuffers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this.emit("destroy", this); this.removeAllListeners(); if (destroyBuffers) { this.buffers.forEach(function (buffer) { return buffer.destroy(); }); } this.attributes = null; this.buffers = null; this.indexBuffer = null; this._bounds = null; } }]); }(EventEmitter); exports.Geometry = Geometry; /***/ }), /***/ 19114: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var BufferResource = __webpack_require__(1484); var UniformGroup = __webpack_require__(34400); var uniformParsers = __webpack_require__(23845); var generateUniformsSyncTypes = __webpack_require__(1761); "use strict"; function generateUniformsSync(group, uniformData) { var funcFragments = ["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n var name = null;\n "]; for (var i in group.uniforms) { if (!uniformData[i]) { if (group.uniforms[i] instanceof UniformGroup.UniformGroup) { if (group.uniforms[i].ubo) { funcFragments.push("\n renderer.shader.bindUniformBlock(uv.".concat(i, ", \"").concat(i, "\");\n ")); } else { funcFragments.push("\n renderer.shader.updateUniformGroup(uv.".concat(i, ");\n ")); } } else if (group.uniforms[i] instanceof BufferResource.BufferResource) { funcFragments.push("\n renderer.shader.bindBufferResource(uv.".concat(i, ", \"").concat(i, "\");\n ")); } continue; } var uniform = group.uniformStructures[i]; var parsed = false; for (var j = 0; j < uniformParsers.uniformParsers.length; j++) { var parser = uniformParsers.uniformParsers[j]; if (uniform.type === parser.type && parser.test(uniform)) { funcFragments.push("name = \"".concat(i, "\";"), uniformParsers.uniformParsers[j].uniform); parsed = true; break; } } if (!parsed) { var templateType = uniform.size === 1 ? generateUniformsSyncTypes.UNIFORM_TO_SINGLE_SETTERS : generateUniformsSyncTypes.UNIFORM_TO_ARRAY_SETTERS; var template = templateType[uniform.type].replace("location", "ud[\"".concat(i, "\"].location")); funcFragments.push("\n cu = ud[\"".concat(i, "\"];\n cv = cu.value;\n v = uv[\"").concat(i, "\"];\n ").concat(template, ";")); } } return new Function("ud", "uv", "renderer", "syncData", funcFragments.join("\n")); } exports.generateUniformsSync = generateUniformsSync; /***/ }), /***/ 19257: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _FCore = __webpack_require__(49997); var _AllianceObjects = __webpack_require__(2352); var _EventEmitter = __webpack_require__(35513); /** * * @param {Level1Scene} scene * @constructor */ function TreePicker(scene) { this.scene = scene; this.prepare(); /** * * @type {null|PlaceHolder} */ this.curPL = null; this.ev_pointerOut = this.ev_pointerOut.bind(this); this.classes = [_AllianceObjects.ANhip, _AllianceObjects.DaoLnHot, _AllianceObjects.AnhTrang, _AllianceObjects.BauDat, _AllianceObjects.May]; } TreePicker.prototype.update = function (deltaTime) { if (!this.$box) return; if (!this.curPL) return; var starCoins = this.scene.starCoins; for (var i = 0; i < this.$buttons.length; ++i) { this.$buttons[i].disabled = this.classes[i].prototype.cost > starCoins; } }; TreePicker.prototype.prepare = function () { var _this = this; if (this.$box) return; this.$buttons = ['a_nhip_small', 'dlh_small', 'moon_small', 'bau_dat_small', 'may_small'].map(function (name, i) { return (0, _FCore._)({ tag: 'button', "class": 'as-img-btn', props: { disabled: true }, child: { tag: 'img', attr: { src: "assets/".concat(name, ".png") } }, on: { click: function click() { if (!_this.curPL) return; var clazz = _this.classes[i]; if (clazz.prototype.cost > _this.scene.starCoins) return; var obj = new clazz(_this.scene, _this.curPL.x, _this.curPL.y); _this.curPL.remove(); _this.close(); } } }); }); this.$box = (0, _FCore._)({ "class": 'as-tree-picker-box', child: this.$buttons }); this.$cursor = (0, _FCore._)({ tag: 'img', "class": 'as-tree-picker-cursor', attr: { src: 'assets/plus_e.png' } }); }; TreePicker.prototype.open = function (placeHolder) { var _this2 = this; this.prepare(); this.curPL = placeHolder; setTimeout(function () { document.addEventListener('pointerdown', _this2.ev_pointerOut); }, 100); this.$box.addTo(this.scene.$foreground); this.$cursor.addTo(this.scene.$foreground); this.updatePosition(); }; TreePicker.prototype.close = function () { if (!this.curPL) return; if (this.$box) { this.$box.remove(); this.$cursor.remove(); } this.curPL = null; }; TreePicker.prototype.destroy = function () { this.close(); }; TreePicker.prototype.updatePosition = function () { if (!this.curPL) return; var rect = this.curPL.getRect(); var x, y; y = rect.y + rect.height + 10; x = rect.x + 108 / 2 - 454 / 2; if (x < 10) x = 10; if (x + 600 > 1622 - 20) x = 1622 - 600 - 20; this.$box.addStyle({ left: x + 'px', top: y + 'px' }); this.$cursor.addStyle({ left: rect.x + 5 + 'px', top: rect.y + 108 / 3 * 2 - 30 + 'px' }); }; TreePicker.prototype.onPointerDown = function (point) { if (this.scene.paused) return; var pl = Object.values(this.scene.placeHolders).find(function (p) { return p.isHit(point); }); if (pl && this.curPL === pl) { this.close(); } else if (pl && this.curPL && this.curPL !== pl) { this.curPL = pl; this.updatePosition(); } else if (pl && !this.curPL) { this.open(pl); } else { if (this.curPL) this.close(); } if (pl) return true; }; TreePicker.prototype.ev_pointerOut = function (event) { var _this3 = this; if (event.target === this.scene.$canvas) return; if ((0, _EventEmitter.hitElement)(this.$box, event)) return; setTimeout(function () { _this3.close(); }, 100); }; TreePicker.prototype.onPointerUp = function (point) {}; var _default = exports["default"] = TreePicker; /***/ }), /***/ 19330: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.bezierBlend = bezierBlend; exports.inOutQuadBlend = inOutQuadBlend; exports.inQuadBlend = inQuadBlend; exports.outQuadBlend = outQuadBlend; /** * * @param {number} t * @returns {number} */ function bezierBlend(t) { return t * t * (3 - 2 * t); } function inOutQuadBlend(t) { if (t <= 0.5) return 2.0 * t * t; t -= 0.5; return 2.0 * t * (1.0 - t) + 0.5; } function inQuadBlend(t) { return t * t; } function outQuadBlend(t) { return 1 - (1 - t) * (1 - t); } /***/ }), /***/ 19497: /***/ ((module) => { "use strict"; var has = Object.prototype.hasOwnProperty, prefix = '~'; /** * Constructor to create a storage for our `EE` objects. * An `Events` instance is a plain object whose properties are event names. * * @constructor * @private */ function Events() {} // // We try to not inherit from `Object.prototype`. In some engines creating an // instance in this way is faster than calling `Object.create(null)` directly. // If `Object.create(null)` is not supported we prefix the event names with a // character to make sure that the built-in object properties are not // overridden or used as an attack vector. // if (Object.create) { Events.prototype = Object.create(null); // // This hack is needed because the `__proto__` property is still inherited in // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. // if (!new Events().__proto__) prefix = false; } /** * Representation of a single event listener. * * @param {Function} fn The listener function. * @param {*} context The context to invoke the listener with. * @param {Boolean} [once=false] Specify if the listener is a one-time listener. * @constructor * @private */ function EE(fn, context, once) { this.fn = fn; this.context = context; this.once = once || false; } /** * Add a listener for a given event. * * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} context The context to invoke the listener with. * @param {Boolean} once Specify if the listener is a one-time listener. * @returns {EventEmitter} * @private */ function addListener(emitter, event, fn, context, once) { if (typeof fn !== 'function') { throw new TypeError('The listener must be a function'); } var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event; if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener]; return emitter; } /** * Clear event by name. * * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. * @param {(String|Symbol)} evt The Event name. * @private */ function clearEvent(emitter, evt) { if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt]; } /** * Minimal `EventEmitter` interface that is molded against the Node.js * `EventEmitter` interface. * * @constructor * @public */ function EventEmitter() { this._events = new Events(); this._eventsCount = 0; } /** * Return an array listing the events for which the emitter has registered * listeners. * * @returns {Array} * @public */ EventEmitter.prototype.eventNames = function eventNames() { var names = [], events, name; if (this._eventsCount === 0) return names; for (name in events = this._events) { if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events)); } return names; }; /** * Return the listeners registered for a given event. * * @param {(String|Symbol)} event The event name. * @returns {Array} The registered listeners. * @public */ EventEmitter.prototype.listeners = function listeners(event) { var evt = prefix ? prefix + event : event, handlers = this._events[evt]; if (!handlers) return []; if (handlers.fn) return [handlers.fn]; for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { ee[i] = handlers[i].fn; } return ee; }; /** * Return the number of listeners listening to a given event. * * @param {(String|Symbol)} event The event name. * @returns {Number} The number of listeners. * @public */ EventEmitter.prototype.listenerCount = function listenerCount(event) { var evt = prefix ? prefix + event : event, listeners = this._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }; /** * Calls each of the listeners registered for a given event. * * @param {(String|Symbol)} event The event name. * @returns {Boolean} `true` if the event had listeners, else `false`. * @public */ EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt], len = arguments.length, args, i; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i = 1, args = new Array(len - 1); i < len; i++) { args[i - 1] = arguments[i]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length, j; for (i = 0; i < length; i++) { if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); switch (len) { case 1: listeners[i].fn.call(listeners[i].context); break; case 2: listeners[i].fn.call(listeners[i].context, a1); break; case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; default: if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) { args[j - 1] = arguments[j]; } listeners[i].fn.apply(listeners[i].context, args); } } } return true; }; /** * Add a listener for a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. * @public */ EventEmitter.prototype.on = function on(event, fn, context) { return addListener(this, event, fn, context, false); }; /** * Add a one-time listener for a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. * @public */ EventEmitter.prototype.once = function once(event, fn, context) { return addListener(this, event, fn, context, true); }; /** * Remove the listeners of a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn Only remove the listeners that match this function. * @param {*} context Only remove the listeners that have this context. * @param {Boolean} once Only remove one-time listeners. * @returns {EventEmitter} `this`. * @public */ EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return this; if (!fn) { clearEvent(this, evt); return this; } var listeners = this._events[evt]; if (listeners.fn) { if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) { clearEvent(this, evt); } } else { for (var i = 0, events = [], length = listeners.length; i < length; i++) { if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) { events.push(listeners[i]); } } // // Reset the array, or remove it completely if we have no more listeners. // if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt); } return this; }; /** * Remove all listeners, or those of the specified event. * * @param {(String|Symbol)} [event] The event name. * @returns {EventEmitter} `this`. * @public */ EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { var evt; if (event) { evt = prefix ? prefix + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events = new Events(); this._eventsCount = 0; } return this; }; // // Alias methods names because people roll like that. // EventEmitter.prototype.off = EventEmitter.prototype.removeListener; EventEmitter.prototype.addListener = EventEmitter.prototype.on; // // Expose the prefix. // EventEmitter.prefixed = prefix; // // Allow `EventEmitter` to be imported as module namespace. // EventEmitter.EventEmitter = EventEmitter; // // Expose the module. // if (true) { module.exports = EventEmitter; } /***/ }), /***/ 19782: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var Ticker = __webpack_require__(6014); var detectVideoAlphaMode = __webpack_require__(29501); var TextureSource = __webpack_require__(55406); "use strict"; var _VideoSource = /*#__PURE__*/function (_TextureSource$Textur) { function _VideoSource(options) { var _options$alphaMode; var _this; _classCallCheck(this, _VideoSource); _this = _callSuper(this, _VideoSource, [options]); // Public /** Whether or not the video is ready to play. */ _this.isReady = false; /** The upload method for this texture. */ _this.uploadMethodId = "video"; options = _objectSpread(_objectSpread({}, _VideoSource.defaultOptions), options); _this._autoUpdate = true; _this._isConnectedToTicker = false; _this._updateFPS = options.updateFPS || 0; _this._msToNextUpdate = 0; _this.autoPlay = options.autoPlay !== false; _this.alphaMode = (_options$alphaMode = options.alphaMode) !== null && _options$alphaMode !== void 0 ? _options$alphaMode : "premultiply-alpha-on-upload"; _this._videoFrameRequestCallback = _this._videoFrameRequestCallback.bind(_this); _this._videoFrameRequestCallbackHandle = null; _this._load = null; _this._resolve = null; _this._reject = null; _this._onCanPlay = _this._onCanPlay.bind(_this); _this._onCanPlayThrough = _this._onCanPlayThrough.bind(_this); _this._onError = _this._onError.bind(_this); _this._onPlayStart = _this._onPlayStart.bind(_this); _this._onPlayStop = _this._onPlayStop.bind(_this); _this._onSeeked = _this._onSeeked.bind(_this); if (options.autoLoad !== false) { void _this.load(); } return _this; } /** Update the video frame if the source is not destroyed and meets certain conditions. */ _inherits(_VideoSource, _TextureSource$Textur); return _createClass(_VideoSource, [{ key: "updateFrame", value: function updateFrame() { if (this.destroyed) { return; } if (this._updateFPS) { var elapsedMS = Ticker.Ticker.shared.elapsedMS * this.resource.playbackRate; this._msToNextUpdate = Math.floor(this._msToNextUpdate - elapsedMS); } if (!this._updateFPS || this._msToNextUpdate <= 0) { this._msToNextUpdate = this._updateFPS ? Math.floor(1e3 / this._updateFPS) : 0; } if (this.isValid) { this.update(); } } /** Callback to update the video frame and potentially request the next frame update. */ }, { key: "_videoFrameRequestCallback", value: function _videoFrameRequestCallback() { this.updateFrame(); if (this.destroyed) { this._videoFrameRequestCallbackHandle = null; } else { this._videoFrameRequestCallbackHandle = this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback); } } /** * Checks if the resource has valid dimensions. * @returns {boolean} True if width and height are set, otherwise false. */ }, { key: "isValid", get: function get() { return !!this.resource.videoWidth && !!this.resource.videoHeight; } /** * Start preloading the video resource. * @returns {Promise<this>} Handle the validate event */ }, { key: "load", value: (function () { var _load = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var _this2 = this; var source, options; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!this._load) { _context.n = 1; break; } return _context.a(2, this._load); case 1: source = this.resource; options = this.options; if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA) && source.width && source.height) { source.complete = true; } source.addEventListener("play", this._onPlayStart); source.addEventListener("pause", this._onPlayStop); source.addEventListener("seeked", this._onSeeked); if (!this._isSourceReady()) { if (!options.preload) { source.addEventListener("canplay", this._onCanPlay); } source.addEventListener("canplaythrough", this._onCanPlayThrough); source.addEventListener("error", this._onError, true); } else { this._mediaReady(); } _context.n = 2; return detectVideoAlphaMode.detectVideoAlphaMode(); case 2: this.alphaMode = _context.v; this._load = new Promise(function (resolve, reject) { if (_this2.isValid) { resolve(_this2); } else { _this2._resolve = resolve; _this2._reject = reject; if (options.preloadTimeoutMs !== void 0) { _this2._preloadTimeout = setTimeout(function () { _this2._onError(new ErrorEvent("Preload exceeded timeout of ".concat(options.preloadTimeoutMs, "ms"))); }); } source.load(); } }); return _context.a(2, this._load); } }, _callee, this); })); function load() { return _load.apply(this, arguments); } return load; }() /** * Handle video error events. * @param event - The error event */ ) }, { key: "_onError", value: function _onError(event) { this.resource.removeEventListener("error", this._onError, true); this.emit("error", event); if (this._reject) { this._reject(event); this._reject = null; this._resolve = null; } } /** * Checks if the underlying source is playing. * @returns True if playing. */ }, { key: "_isSourcePlaying", value: function _isSourcePlaying() { var source = this.resource; return !source.paused && !source.ended; } /** * Checks if the underlying source is ready for playing. * @returns True if ready. */ }, { key: "_isSourceReady", value: function _isSourceReady() { var source = this.resource; return source.readyState > 2; } /** Runs the update loop when the video is ready to play. */ }, { key: "_onPlayStart", value: function _onPlayStart() { if (!this.isValid) { this._mediaReady(); } this._configureAutoUpdate(); } /** Stops the update loop when a pause event is triggered. */ }, { key: "_onPlayStop", value: function _onPlayStop() { this._configureAutoUpdate(); } /** Handles behavior when the video completes seeking to the current playback position. */ }, { key: "_onSeeked", value: function _onSeeked() { if (this._autoUpdate && !this._isSourcePlaying()) { this._msToNextUpdate = 0; this.updateFrame(); this._msToNextUpdate = 0; } } }, { key: "_onCanPlay", value: function _onCanPlay() { var source = this.resource; source.removeEventListener("canplay", this._onCanPlay); this._mediaReady(); } }, { key: "_onCanPlayThrough", value: function _onCanPlayThrough() { var source = this.resource; source.removeEventListener("canplaythrough", this._onCanPlay); if (this._preloadTimeout) { clearTimeout(this._preloadTimeout); this._preloadTimeout = void 0; } this._mediaReady(); } /** Fired when the video is loaded and ready to play. */ }, { key: "_mediaReady", value: function _mediaReady() { var source = this.resource; if (this.isValid) { this.isReady = true; this.resize(source.videoWidth, source.videoHeight); } this._msToNextUpdate = 0; this.updateFrame(); this._msToNextUpdate = 0; if (this._resolve) { this._resolve(this); this._resolve = null; this._reject = null; } if (this._isSourcePlaying()) { this._onPlayStart(); } else if (this.autoPlay) { void this.resource.play(); } } /** Cleans up resources and event listeners associated with this texture. */ }, { key: "destroy", value: function destroy() { this._configureAutoUpdate(); var source = this.resource; if (source) { source.removeEventListener("play", this._onPlayStart); source.removeEventListener("pause", this._onPlayStop); source.removeEventListener("seeked", this._onSeeked); source.removeEventListener("canplay", this._onCanPlay); source.removeEventListener("canplaythrough", this._onCanPlayThrough); source.removeEventListener("error", this._onError, true); source.pause(); source.src = ""; source.load(); } _superPropGet(_VideoSource, "destroy", this, 3)([]); } /** Should the base texture automatically update itself, set to true by default. */ }, { key: "autoUpdate", get: function get() { return this._autoUpdate; }, set: function set(value) { if (value !== this._autoUpdate) { this._autoUpdate = value; this._configureAutoUpdate(); } } /** * How many times a second to update the texture from the video. * Leave at 0 to update at every render. * A lower fps can help performance, as updating the texture at 60fps on a 30ps video may not be efficient. */ }, { key: "updateFPS", get: function get() { return this._updateFPS; }, set: function set(value) { if (value !== this._updateFPS) { this._updateFPS = value; this._configureAutoUpdate(); } } /** * Configures the updating mechanism based on the current state and settings. * * This method decides between using the browser's native video frame callback or a custom ticker * for updating the video frame. It ensures optimal performance and responsiveness * based on the video's state, playback status, and the desired frames-per-second setting. * * - If `_autoUpdate` is enabled and the video source is playing: * - It will prefer the native video frame callback if available and no specific FPS is set. * - Otherwise, it will use a custom ticker for manual updates. * - If `_autoUpdate` is disabled or the video isn't playing, any active update mechanisms are halted. */ }, { key: "_configureAutoUpdate", value: function _configureAutoUpdate() { if (this._autoUpdate && this._isSourcePlaying()) { if (!this._updateFPS && this.resource.requestVideoFrameCallback) { if (this._isConnectedToTicker) { Ticker.Ticker.shared.remove(this.updateFrame, this); this._isConnectedToTicker = false; this._msToNextUpdate = 0; } if (this._videoFrameRequestCallbackHandle === null) { this._videoFrameRequestCallbackHandle = this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback); } } else { if (this._videoFrameRequestCallbackHandle !== null) { this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle); this._videoFrameRequestCallbackHandle = null; } if (!this._isConnectedToTicker) { Ticker.Ticker.shared.add(this.updateFrame, this); this._isConnectedToTicker = true; this._msToNextUpdate = 0; } } } else { if (this._videoFrameRequestCallbackHandle !== null) { this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle); this._videoFrameRequestCallbackHandle = null; } if (this._isConnectedToTicker) { Ticker.Ticker.shared.remove(this.updateFrame, this); this._isConnectedToTicker = false; this._msToNextUpdate = 0; } } } }], [{ key: "test", value: function test(resource) { return globalThis.HTMLVideoElement && resource instanceof HTMLVideoElement; } }]); }(TextureSource.TextureSource); _VideoSource.extension = Extensions.ExtensionType.TextureSource; /** The default options for video sources. */ _VideoSource.defaultOptions = _objectSpread(_objectSpread({}, TextureSource.TextureSource.defaultOptions), {}, { /** If true, the video will start loading immediately. */ autoLoad: true, /** If true, the video will start playing as soon as it is loaded. */ autoPlay: true, /** The number of times a second to update the texture from the video. Leave at 0 to update at every render. */ updateFPS: 0, /** If true, the video will be loaded with the `crossorigin` attribute. */ crossorigin: true, /** If true, the video will loop when it ends. */ loop: false, /** If true, the video will be muted. */ muted: true, /** If true, the video will play inline. */ playsinline: true, /** If true, the video will be preloaded. */ preload: false }); /** * Map of video MIME types that can't be directly derived from file extensions. * @readonly */ _VideoSource.MIME_TYPES = { ogv: "video/ogg", mov: "video/quicktime", m4v: "video/mp4" }; var VideoSource = _VideoSource; exports.VideoSource = VideoSource; /***/ }), /***/ 19977: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var _TextureGCSystem = /*#__PURE__*/function () { /** @param renderer - The renderer this System works for. */ function _TextureGCSystem(renderer) { _classCallCheck(this, _TextureGCSystem); this._renderer = renderer; this.count = 0; this.checkCount = 0; } return _createClass(_TextureGCSystem, [{ key: "init", value: function init(options) { var _options$textureGCAMa; options = _objectSpread(_objectSpread({}, _TextureGCSystem.defaultOptions), options); this.checkCountMax = options.textureGCCheckCountMax; this.maxIdle = (_options$textureGCAMa = options.textureGCAMaxIdle) !== null && _options$textureGCAMa !== void 0 ? _options$textureGCAMa : options.textureGCMaxIdle; this.active = options.textureGCActive; } /** * Checks to see when the last time a texture was used. * If the texture has not been used for a specified amount of time, it will be removed from the GPU. */ }, { key: "postrender", value: function postrender() { if (!this._renderer.renderingToScreen) { return; } this.count++; if (!this.active) return; this.checkCount++; if (this.checkCount > this.checkCountMax) { this.checkCount = 0; this.run(); } } /** * Checks to see when the last time a texture was used. * If the texture has not been used for a specified amount of time, it will be removed from the GPU. */ }, { key: "run", value: function run() { var managedTextures = this._renderer.texture.managedTextures; for (var i = 0; i < managedTextures.length; i++) { var texture = managedTextures[i]; if (texture.autoGarbageCollect && texture.resource && texture._touched > -1 && this.count - texture._touched > this.maxIdle) { texture._touched = -1; texture.unload(); } } } }, { key: "destroy", value: function destroy() { this._renderer = null; } }]); }(); /** @ignore */ _TextureGCSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem], name: "textureGC" }; /** default options for the TextureGCSystem */ _TextureGCSystem.defaultOptions = { /** * If set to true, this will enable the garbage collector on the GPU. * @default true */ textureGCActive: true, /** * @deprecated since 8.3.0 * @see {@link TextureGCSystem.textureGCMaxIdle} */ textureGCAMaxIdle: null, /** * The maximum idle frames before a texture is destroyed by garbage collection. * @default 60 * 60 */ textureGCMaxIdle: 60 * 60, /** * Frames between two garbage collections. * @default 600 */ textureGCCheckCountMax: 600 }; var TextureGCSystem = _TextureGCSystem; exports.TextureGCSystem = TextureGCSystem; /***/ }), /***/ 20105: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var UPDATE_PRIORITY = /* @__PURE__ */function (UPDATE_PRIORITY2) { UPDATE_PRIORITY2[UPDATE_PRIORITY2["INTERACTION"] = 50] = "INTERACTION"; UPDATE_PRIORITY2[UPDATE_PRIORITY2["HIGH"] = 25] = "HIGH"; UPDATE_PRIORITY2[UPDATE_PRIORITY2["NORMAL"] = 0] = "NORMAL"; UPDATE_PRIORITY2[UPDATE_PRIORITY2["LOW"] = -25] = "LOW"; UPDATE_PRIORITY2[UPDATE_PRIORITY2["UTILITY"] = -50] = "UTILITY"; return UPDATE_PRIORITY2; }(UPDATE_PRIORITY || {}); exports.UPDATE_PRIORITY = UPDATE_PRIORITY; /***/ }), /***/ 20180: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); var testVideoFormat = __webpack_require__(82788); "use strict"; var detectOgv = { extension: { type: Extensions.ExtensionType.DetectionParser, priority: 0 }, test: function () { var _test = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: return _context.a(2, testVideoFormat.testVideoFormat("video/ogg")); } }, _callee); })); function test() { return _test.apply(this, arguments); } return test; }(), add: function () { var _add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(formats) { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: return _context2.a(2, [].concat(_toConsumableArray(formats), ["ogv"])); } }, _callee2); })); function add(_x) { return _add.apply(this, arguments); } return add; }(), remove: function () { var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(formats) { return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: return _context3.a(2, formats.filter(function (f) { return f !== "ogv"; })); } }, _callee3); })); function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() }; exports.detectOgv = detectOgv; /***/ }), /***/ 20303: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function stripVersion(src, isES300) { if (!isES300) return src; return src.replace("#version 300 es", ""); } exports.stripVersion = stripVersion; /***/ }), /***/ 20622: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var SubtractBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function SubtractBlend() { _classCallCheck(this, SubtractBlend); return _callSuper(this, SubtractBlend, [{ gl: { functions: "\n float subtract(float base, float blend)\n {\n return max(0.0, base - blend);\n }\n\n vec3 blendSubtract(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n subtract(base.r, blend.r),\n subtract(base.g, blend.g),\n subtract(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn subtract(base: f32, blend: f32) -> f32\n {\n return max(0, base - blend);\n }\n\n fn blendSubtract(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n subtract(base.r, blend.r),\n subtract(base.g, blend.g),\n subtract(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(SubtractBlend, _BlendModeFilter$Blen); return _createClass(SubtractBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ SubtractBlend.extension = { name: "subtract", type: Extensions.ExtensionType.BlendMode }; exports.SubtractBlend = SubtractBlend; /***/ }), /***/ 20720: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var Resolver = __webpack_require__(54080); var resolveTextureUrl = __webpack_require__(12435); "use strict"; var resolveJsonUrl = { extension: { type: Extensions.ExtensionType.ResolveParser, priority: -2, name: "resolveJson" }, test: function test(value) { return Resolver.Resolver.RETINA_PREFIX.test(value) && value.endsWith(".json"); }, parse: resolveTextureUrl.resolveTextureUrl.parse }; exports.resolveJsonUrl = resolveJsonUrl; /***/ }), /***/ 20764: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var _const = __webpack_require__(83987); var Point = __webpack_require__(75544); "use strict"; var Matrix = /*#__PURE__*/function () { /** * @param a - x scale * @param b - y skew * @param c - x skew * @param d - y scale * @param tx - x translation * @param ty - y translation */ function Matrix() { var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; var tx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; var ty = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; _classCallCheck(this, Matrix); /** An array of the current matrix. Only populated when `toArray` is called */ this.array = null; this.a = a; this.b = b; this.c = c; this.d = d; this.tx = tx; this.ty = ty; } /** * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: * * a = array[0] * b = array[1] * c = array[3] * d = array[4] * tx = array[2] * ty = array[5] * @param array - The array that the matrix will be populated from. */ return _createClass(Matrix, [{ key: "fromArray", value: function fromArray(array) { this.a = array[0]; this.b = array[1]; this.c = array[3]; this.d = array[4]; this.tx = array[2]; this.ty = array[5]; } /** * Sets the matrix properties. * @param a - Matrix component * @param b - Matrix component * @param c - Matrix component * @param d - Matrix component * @param tx - Matrix component * @param ty - Matrix component * @returns This matrix. Good for chaining method calls. */ }, { key: "set", value: function set(a, b, c, d, tx, ty) { this.a = a; this.b = b; this.c = c; this.d = d; this.tx = tx; this.ty = ty; return this; } /** * Creates an array from the current Matrix object. * @param transpose - Whether we need to transpose the matrix or not * @param [out=new Float32Array(9)] - If provided the array will be assigned to out * @returns The newly created array which contains the matrix */ }, { key: "toArray", value: function toArray(transpose, out) { if (!this.array) { this.array = new Float32Array(9); } var array = out || this.array; if (transpose) { array[0] = this.a; array[1] = this.b; array[2] = 0; array[3] = this.c; array[4] = this.d; array[5] = 0; array[6] = this.tx; array[7] = this.ty; array[8] = 1; } else { array[0] = this.a; array[1] = this.c; array[2] = this.tx; array[3] = this.b; array[4] = this.d; array[5] = this.ty; array[6] = 0; array[7] = 0; array[8] = 1; } return array; } /** * Get a new position with the current transformation applied. * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) * @param pos - The origin * @param {Point} [newPos] - The point that the new position is assigned to (allowed to be same as input) * @returns {Point} The new point, transformed through this matrix */ }, { key: "apply", value: function apply(pos, newPos) { newPos = newPos || new Point.Point(); var x = pos.x; var y = pos.y; newPos.x = this.a * x + this.c * y + this.tx; newPos.y = this.b * x + this.d * y + this.ty; return newPos; } /** * Get a new position with the inverse of the current transformation applied. * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) * @param pos - The origin * @param {Point} [newPos] - The point that the new position is assigned to (allowed to be same as input) * @returns {Point} The new point, inverse-transformed through this matrix */ }, { key: "applyInverse", value: function applyInverse(pos, newPos) { newPos = newPos || new Point.Point(); var a = this.a; var b = this.b; var c = this.c; var d = this.d; var tx = this.tx; var ty = this.ty; var id = 1 / (a * d + c * -b); var x = pos.x; var y = pos.y; newPos.x = d * id * x + -c * id * y + (ty * c - tx * d) * id; newPos.y = a * id * y + -b * id * x + (-ty * a + tx * b) * id; return newPos; } /** * Translates the matrix on the x and y. * @param x - How much to translate x by * @param y - How much to translate y by * @returns This matrix. Good for chaining method calls. */ }, { key: "translate", value: function translate(x, y) { this.tx += x; this.ty += y; return this; } /** * Applies a scale transformation to the matrix. * @param x - The amount to scale horizontally * @param y - The amount to scale vertically * @returns This matrix. Good for chaining method calls. */ }, { key: "scale", value: function scale(x, y) { this.a *= x; this.d *= y; this.c *= x; this.b *= y; this.tx *= x; this.ty *= y; return this; } /** * Applies a rotation transformation to the matrix. * @param angle - The angle in radians. * @returns This matrix. Good for chaining method calls. */ }, { key: "rotate", value: function rotate(angle) { var cos = Math.cos(angle); var sin = Math.sin(angle); var a1 = this.a; var c1 = this.c; var tx1 = this.tx; this.a = a1 * cos - this.b * sin; this.b = a1 * sin + this.b * cos; this.c = c1 * cos - this.d * sin; this.d = c1 * sin + this.d * cos; this.tx = tx1 * cos - this.ty * sin; this.ty = tx1 * sin + this.ty * cos; return this; } /** * Appends the given Matrix to this Matrix. * @param matrix - The matrix to append. * @returns This matrix. Good for chaining method calls. */ }, { key: "append", value: function append(matrix) { var a1 = this.a; var b1 = this.b; var c1 = this.c; var d1 = this.d; this.a = matrix.a * a1 + matrix.b * c1; this.b = matrix.a * b1 + matrix.b * d1; this.c = matrix.c * a1 + matrix.d * c1; this.d = matrix.c * b1 + matrix.d * d1; this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; return this; } /** * Appends two matrix's and sets the result to this matrix. AB = A * B * @param a - The matrix to append. * @param b - The matrix to append. * @returns This matrix. Good for chaining method calls. */ }, { key: "appendFrom", value: function appendFrom(a, b) { var a1 = a.a; var b1 = a.b; var c1 = a.c; var d1 = a.d; var tx = a.tx; var ty = a.ty; var a2 = b.a; var b2 = b.b; var c2 = b.c; var d2 = b.d; this.a = a1 * a2 + b1 * c2; this.b = a1 * b2 + b1 * d2; this.c = c1 * a2 + d1 * c2; this.d = c1 * b2 + d1 * d2; this.tx = tx * a2 + ty * c2 + b.tx; this.ty = tx * b2 + ty * d2 + b.ty; return this; } /** * Sets the matrix based on all the available properties * @param x - Position on the x axis * @param y - Position on the y axis * @param pivotX - Pivot on the x axis * @param pivotY - Pivot on the y axis * @param scaleX - Scale on the x axis * @param scaleY - Scale on the y axis * @param rotation - Rotation in radians * @param skewX - Skew on the x axis * @param skewY - Skew on the y axis * @returns This matrix. Good for chaining method calls. */ }, { key: "setTransform", value: function setTransform(x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { this.a = Math.cos(rotation + skewY) * scaleX; this.b = Math.sin(rotation + skewY) * scaleX; this.c = -Math.sin(rotation - skewX) * scaleY; this.d = Math.cos(rotation - skewX) * scaleY; this.tx = x - (pivotX * this.a + pivotY * this.c); this.ty = y - (pivotX * this.b + pivotY * this.d); return this; } /** * Prepends the given Matrix to this Matrix. * @param matrix - The matrix to prepend * @returns This matrix. Good for chaining method calls. */ }, { key: "prepend", value: function prepend(matrix) { var tx1 = this.tx; if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) { var a1 = this.a; var c1 = this.c; this.a = a1 * matrix.a + this.b * matrix.c; this.b = a1 * matrix.b + this.b * matrix.d; this.c = c1 * matrix.a + this.d * matrix.c; this.d = c1 * matrix.b + this.d * matrix.d; } this.tx = tx1 * matrix.a + this.ty * matrix.c + matrix.tx; this.ty = tx1 * matrix.b + this.ty * matrix.d + matrix.ty; return this; } /** * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform. * @param transform - The transform to apply the properties to. * @returns The transform with the newly applied properties */ }, { key: "decompose", value: function decompose(transform) { var a = this.a; var b = this.b; var c = this.c; var d = this.d; var pivot = transform.pivot; var skewX = -Math.atan2(-c, d); var skewY = Math.atan2(b, a); var delta = Math.abs(skewX + skewY); if (delta < 1e-5 || Math.abs(_const.PI_2 - delta) < 1e-5) { transform.rotation = skewY; transform.skew.x = transform.skew.y = 0; } else { transform.rotation = 0; transform.skew.x = skewX; transform.skew.y = skewY; } transform.scale.x = Math.sqrt(a * a + b * b); transform.scale.y = Math.sqrt(c * c + d * d); transform.position.x = this.tx + (pivot.x * a + pivot.y * c); transform.position.y = this.ty + (pivot.x * b + pivot.y * d); return transform; } /** * Inverts this matrix * @returns This matrix. Good for chaining method calls. */ }, { key: "invert", value: function invert() { var a1 = this.a; var b1 = this.b; var c1 = this.c; var d1 = this.d; var tx1 = this.tx; var n = a1 * d1 - b1 * c1; this.a = d1 / n; this.b = -b1 / n; this.c = -c1 / n; this.d = a1 / n; this.tx = (c1 * this.ty - d1 * tx1) / n; this.ty = -(a1 * this.ty - b1 * tx1) / n; return this; } /** Checks if this matrix is an identity matrix */ }, { key: "isIdentity", value: function isIdentity() { return this.a === 1 && this.b === 0 && this.c === 0 && this.d === 1 && this.tx === 0 && this.ty === 0; } /** * Resets this Matrix to an identity (default) matrix. * @returns This matrix. Good for chaining method calls. */ }, { key: "identity", value: function identity() { this.a = 1; this.b = 0; this.c = 0; this.d = 1; this.tx = 0; this.ty = 0; return this; } /** * Creates a new Matrix object with the same values as this one. * @returns A copy of this matrix. Good for chaining method calls. */ }, { key: "clone", value: function clone() { var matrix = new Matrix(); matrix.a = this.a; matrix.b = this.b; matrix.c = this.c; matrix.d = this.d; matrix.tx = this.tx; matrix.ty = this.ty; return matrix; } /** * Changes the values of the given matrix to be the same as the ones in this matrix * @param matrix - The matrix to copy to. * @returns The matrix given in parameter with its values updated. */ }, { key: "copyTo", value: function copyTo(matrix) { matrix.a = this.a; matrix.b = this.b; matrix.c = this.c; matrix.d = this.d; matrix.tx = this.tx; matrix.ty = this.ty; return matrix; } /** * Changes the values of the matrix to be the same as the ones in given matrix * @param matrix - The matrix to copy from. * @returns this */ }, { key: "copyFrom", value: function copyFrom(matrix) { this.a = matrix.a; this.b = matrix.b; this.c = matrix.c; this.d = matrix.d; this.tx = matrix.tx; this.ty = matrix.ty; return this; } /** * check to see if two matrices are the same * @param matrix - The matrix to compare to. */ }, { key: "equals", value: function equals(matrix) { return matrix.a === this.a && matrix.b === this.b && matrix.c === this.c && matrix.d === this.d && matrix.tx === this.tx && matrix.ty === this.ty; } }, { key: "toString", value: function toString() { return "[pixi.js:Matrix a=".concat(this.a, " b=").concat(this.b, " c=").concat(this.c, " d=").concat(this.d, " tx=").concat(this.tx, " ty=").concat(this.ty, "]"); } /** * A default (identity) matrix. * * This is a shared object, if you want to modify it consider creating a new `Matrix` * @readonly */ }], [{ key: "IDENTITY", get: function get() { return identityMatrix.identity(); } /** * A static Matrix that can be used to avoid creating new objects. * Will always ensure the matrix is reset to identity when requested. * Use this object for fast but temporary calculations, as it may be mutated later on. * This is a different object to the `IDENTITY` object and so can be modified without changing `IDENTITY`. * @readonly */ }, { key: "shared", get: function get() { return tempMatrix.identity(); } }]); }(); var tempMatrix = new Matrix(); var identityMatrix = new Matrix(); exports.Matrix = Matrix; /***/ }), /***/ 20780: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var vkFormatToGPUFormatMap = { 23: "rgb8unorm", // VK_FORMAT_R8G8B8_UNORM 37: "rgba8unorm", // VK_FORMAT_R8G8B8A8_UNORM 43: "rgba8unorm-srgb" // VK_FORMAT_R8G8B8A8_SRGB // TODO add more! }; function vkFormatToGPUFormat(vkFormat) { var format = vkFormatToGPUFormatMap[vkFormat]; if (format) { return format; } throw new Error("Unsupported VkFormat: ".concat(vkFormat)); } exports.vkFormatToGPUFormat = vkFormatToGPUFormat; /***/ }), /***/ 20806: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Matrix = __webpack_require__(20764); var ObservablePoint = __webpack_require__(14823); "use strict"; var Transform = /*#__PURE__*/function () { /** * @param options - Options for the transform. * @param options.matrix - The matrix to use. * @param options.observer - The observer to use. */ function Transform() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, matrix = _ref.matrix, observer = _ref.observer; _classCallCheck(this, Transform); this.dirty = true; this._matrix = matrix !== null && matrix !== void 0 ? matrix : new Matrix.Matrix(); this.observer = observer; this.position = new ObservablePoint.ObservablePoint(this, 0, 0); this.scale = new ObservablePoint.ObservablePoint(this, 1, 1); this.pivot = new ObservablePoint.ObservablePoint(this, 0, 0); this.skew = new ObservablePoint.ObservablePoint(this, 0, 0); this._rotation = 0; this._cx = 1; this._sx = 0; this._cy = 0; this._sy = 1; } /** * This matrix is computed by combining this Transforms position, scale, rotation, skew, and pivot * properties into a single matrix. * @readonly */ return _createClass(Transform, [{ key: "matrix", get: function get() { var lt = this._matrix; if (!this.dirty) return lt; lt.a = this._cx * this.scale.x; lt.b = this._sx * this.scale.x; lt.c = this._cy * this.scale.y; lt.d = this._sy * this.scale.y; lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c); lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d); this.dirty = false; return lt; } /** * Called when a value changes. * @param point * @internal * @private */ }, { key: "_onUpdate", value: function _onUpdate(point) { var _this$observer; this.dirty = true; if (point === this.skew) { this.updateSkew(); } (_this$observer = this.observer) === null || _this$observer === void 0 || _this$observer._onUpdate(this); } /** Called when the skew or the rotation changes. */ }, { key: "updateSkew", value: function updateSkew() { this._cx = Math.cos(this._rotation + this.skew.y); this._sx = Math.sin(this._rotation + this.skew.y); this._cy = -Math.sin(this._rotation - this.skew.x); this._sy = Math.cos(this._rotation - this.skew.x); this.dirty = true; } }, { key: "toString", value: function toString() { return "[pixi.js/math:Transform position=(".concat(this.position.x, ", ").concat(this.position.y, ") rotation=").concat(this.rotation, " scale=(").concat(this.scale.x, ", ").concat(this.scale.y, ") skew=(").concat(this.skew.x, ", ").concat(this.skew.y, ") ]"); } /** * Decomposes a matrix and sets the transforms properties based on it. * @param matrix - The matrix to decompose */ }, { key: "setFromMatrix", value: function setFromMatrix(matrix) { matrix.decompose(this); this.dirty = true; } /** The rotation of the object in radians. */ }, { key: "rotation", get: function get() { return this._rotation; }, set: function set(value) { if (this._rotation !== value) { this._rotation = value; this._onUpdate(this.skew); } } }]); }(); exports.Transform = Transform; /***/ }), /***/ 21047: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 21187: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Point = __webpack_require__(75544); var _const = __webpack_require__(99799); var getOrientationOfPoints = __webpack_require__(11556); "use strict"; function square(x, y, nx, ny, innerWeight, outerWeight, clockwise, verts) { var ix = x - nx * innerWeight; var iy = y - ny * innerWeight; var ox = x + nx * outerWeight; var oy = y + ny * outerWeight; var exx; var eyy; if (clockwise) { exx = ny; eyy = -nx; } else { exx = -ny; eyy = nx; } var eix = ix + exx; var eiy = iy + eyy; var eox = ox + exx; var eoy = oy + eyy; verts.push(eix, eiy); verts.push(eox, eoy); return 2; } function round(cx, cy, sx, sy, ex, ey, verts, clockwise) { var cx2p0x = sx - cx; var cy2p0y = sy - cy; var angle0 = Math.atan2(cx2p0x, cy2p0y); var angle1 = Math.atan2(ex - cx, ey - cy); if (clockwise && angle0 < angle1) { angle0 += Math.PI * 2; } else if (!clockwise && angle0 > angle1) { angle1 += Math.PI * 2; } var startAngle = angle0; var angleDiff = angle1 - angle0; var absAngleDiff = Math.abs(angleDiff); var radius = Math.sqrt(cx2p0x * cx2p0x + cy2p0y * cy2p0y); var segCount = (15 * absAngleDiff * Math.sqrt(radius) / Math.PI >> 0) + 1; var angleInc = angleDiff / segCount; startAngle += angleInc; if (clockwise) { verts.push(cx, cy); verts.push(sx, sy); for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) { verts.push(cx, cy); verts.push(cx + Math.sin(angle) * radius, cy + Math.cos(angle) * radius); } verts.push(cx, cy); verts.push(ex, ey); } else { verts.push(sx, sy); verts.push(cx, cy); for (var _i = 1, _angle = startAngle; _i < segCount; _i++, _angle += angleInc) { verts.push(cx + Math.sin(_angle) * radius, cy + Math.cos(_angle) * radius); verts.push(cx, cy); } verts.push(ex, ey); verts.push(cx, cy); } return segCount * 2; } function buildLine(points, lineStyle, flipAlignment, closed, vertices, indices) { var eps = _const.closePointEps; if (points.length === 0) { return; } var style = lineStyle; var alignment = style.alignment; if (lineStyle.alignment !== 0.5) { var orientation = getOrientationOfPoints.getOrientationOfPoints(points); if (flipAlignment) orientation *= -1; alignment = (alignment - 0.5) * orientation + 0.5; } var firstPoint = new Point.Point(points[0], points[1]); var lastPoint = new Point.Point(points[points.length - 2], points[points.length - 1]); var closedShape = closed; var closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps && Math.abs(firstPoint.y - lastPoint.y) < eps; if (closedShape) { points = points.slice(); if (closedPath) { points.pop(); points.pop(); lastPoint.set(points[points.length - 2], points[points.length - 1]); } var midPointX = (firstPoint.x + lastPoint.x) * 0.5; var midPointY = (lastPoint.y + firstPoint.y) * 0.5; points.unshift(midPointX, midPointY); points.push(midPointX, midPointY); } var verts = vertices; var length = points.length / 2; var indexCount = points.length; var indexStart = verts.length / 2; var width = style.width / 2; var widthSquared = width * width; var miterLimitSquared = style.miterLimit * style.miterLimit; var x0 = points[0]; var y0 = points[1]; var x1 = points[2]; var y1 = points[3]; var x2 = 0; var y2 = 0; var perpX = -(y0 - y1); var perpY = x0 - x1; var perp1x = 0; var perp1y = 0; var dist = Math.sqrt(perpX * perpX + perpY * perpY); perpX /= dist; perpY /= dist; perpX *= width; perpY *= width; var ratio = alignment; var innerWeight = (1 - ratio) * 2; var outerWeight = ratio * 2; if (!closedShape) { if (style.cap === "round") { indexCount += round(x0 - perpX * (innerWeight - outerWeight) * 0.5, y0 - perpY * (innerWeight - outerWeight) * 0.5, x0 - perpX * innerWeight, y0 - perpY * innerWeight, x0 + perpX * outerWeight, y0 + perpY * outerWeight, verts, true) + 2; } else if (style.cap === "square") { indexCount += square(x0, y0, perpX, perpY, innerWeight, outerWeight, true, verts); } } verts.push(x0 - perpX * innerWeight, y0 - perpY * innerWeight); verts.push(x0 + perpX * outerWeight, y0 + perpY * outerWeight); for (var i = 1; i < length - 1; ++i) { x0 = points[(i - 1) * 2]; y0 = points[(i - 1) * 2 + 1]; x1 = points[i * 2]; y1 = points[i * 2 + 1]; x2 = points[(i + 1) * 2]; y2 = points[(i + 1) * 2 + 1]; perpX = -(y0 - y1); perpY = x0 - x1; dist = Math.sqrt(perpX * perpX + perpY * perpY); perpX /= dist; perpY /= dist; perpX *= width; perpY *= width; perp1x = -(y1 - y2); perp1y = x1 - x2; dist = Math.sqrt(perp1x * perp1x + perp1y * perp1y); perp1x /= dist; perp1y /= dist; perp1x *= width; perp1y *= width; var dx0 = x1 - x0; var dy0 = y0 - y1; var dx1 = x1 - x2; var dy1 = y2 - y1; var dot = dx0 * dx1 + dy0 * dy1; var cross = dy0 * dx1 - dy1 * dx0; var clockwise = cross < 0; if (Math.abs(cross) < 1e-3 * Math.abs(dot)) { verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight); verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight); if (dot >= 0) { if (style.join === "round") { indexCount += round(x1, y1, x1 - perpX * innerWeight, y1 - perpY * innerWeight, x1 - perp1x * innerWeight, y1 - perp1y * innerWeight, verts, false) + 4; } else { indexCount += 2; } verts.push(x1 - perp1x * outerWeight, y1 - perp1y * outerWeight); verts.push(x1 + perp1x * innerWeight, y1 + perp1y * innerWeight); } continue; } var c1 = (-perpX + x0) * (-perpY + y1) - (-perpX + x1) * (-perpY + y0); var c2 = (-perp1x + x2) * (-perp1y + y1) - (-perp1x + x1) * (-perp1y + y2); var px = (dx0 * c2 - dx1 * c1) / cross; var py = (dy1 * c1 - dy0 * c2) / cross; var pDist = (px - x1) * (px - x1) + (py - y1) * (py - y1); var imx = x1 + (px - x1) * innerWeight; var imy = y1 + (py - y1) * innerWeight; var omx = x1 - (px - x1) * outerWeight; var omy = y1 - (py - y1) * outerWeight; var smallerInsideSegmentSq = Math.min(dx0 * dx0 + dy0 * dy0, dx1 * dx1 + dy1 * dy1); var insideWeight = clockwise ? innerWeight : outerWeight; var smallerInsideDiagonalSq = smallerInsideSegmentSq + insideWeight * insideWeight * widthSquared; var insideMiterOk = pDist <= smallerInsideDiagonalSq; if (insideMiterOk) { if (style.join === "bevel" || pDist / widthSquared > miterLimitSquared) { if (clockwise) { verts.push(imx, imy); verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight); verts.push(imx, imy); verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight); } else { verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight); verts.push(omx, omy); verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight); verts.push(omx, omy); } indexCount += 2; } else if (style.join === "round") { if (clockwise) { verts.push(imx, imy); verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight); indexCount += round(x1, y1, x1 + perpX * outerWeight, y1 + perpY * outerWeight, x1 + perp1x * outerWeight, y1 + perp1y * outerWeight, verts, true) + 4; verts.push(imx, imy); verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight); } else { verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight); verts.push(omx, omy); indexCount += round(x1, y1, x1 - perpX * innerWeight, y1 - perpY * innerWeight, x1 - perp1x * innerWeight, y1 - perp1y * innerWeight, verts, false) + 4; verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight); verts.push(omx, omy); } } else { verts.push(imx, imy); verts.push(omx, omy); } } else { verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight); verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight); if (style.join === "round") { if (clockwise) { indexCount += round(x1, y1, x1 + perpX * outerWeight, y1 + perpY * outerWeight, x1 + perp1x * outerWeight, y1 + perp1y * outerWeight, verts, true) + 2; } else { indexCount += round(x1, y1, x1 - perpX * innerWeight, y1 - perpY * innerWeight, x1 - perp1x * innerWeight, y1 - perp1y * innerWeight, verts, false) + 2; } } else if (style.join === "miter" && pDist / widthSquared <= miterLimitSquared) { if (clockwise) { verts.push(omx, omy); verts.push(omx, omy); } else { verts.push(imx, imy); verts.push(imx, imy); } indexCount += 2; } verts.push(x1 - perp1x * innerWeight, y1 - perp1y * innerWeight); verts.push(x1 + perp1x * outerWeight, y1 + perp1y * outerWeight); indexCount += 2; } } x0 = points[(length - 2) * 2]; y0 = points[(length - 2) * 2 + 1]; x1 = points[(length - 1) * 2]; y1 = points[(length - 1) * 2 + 1]; perpX = -(y0 - y1); perpY = x0 - x1; dist = Math.sqrt(perpX * perpX + perpY * perpY); perpX /= dist; perpY /= dist; perpX *= width; perpY *= width; verts.push(x1 - perpX * innerWeight, y1 - perpY * innerWeight); verts.push(x1 + perpX * outerWeight, y1 + perpY * outerWeight); if (!closedShape) { if (style.cap === "round") { indexCount += round(x1 - perpX * (innerWeight - outerWeight) * 0.5, y1 - perpY * (innerWeight - outerWeight) * 0.5, x1 - perpX * innerWeight, y1 - perpY * innerWeight, x1 + perpX * outerWeight, y1 + perpY * outerWeight, verts, false) + 2; } else if (style.cap === "square") { indexCount += square(x1, y1, perpX, perpY, innerWeight, outerWeight, false, verts); } } var eps2 = _const.curveEps * _const.curveEps; for (var _i2 = indexStart; _i2 < indexCount + indexStart - 2; ++_i2) { x0 = verts[_i2 * 2]; y0 = verts[_i2 * 2 + 1]; x1 = verts[(_i2 + 1) * 2]; y1 = verts[(_i2 + 1) * 2 + 1]; x2 = verts[(_i2 + 2) * 2]; y2 = verts[(_i2 + 2) * 2 + 1]; if (Math.abs(x0 * (y1 - y2) + x1 * (y2 - y0) + x2 * (y0 - y1)) < eps2) { continue; } indices.push(_i2, _i2 + 1, _i2 + 2); } } exports.buildLine = buildLine; /***/ }), /***/ 21353: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var FederatedEvent = __webpack_require__(42961); var Extensions = __webpack_require__(86890); var isMobile = __webpack_require__(27126); var removeItems = __webpack_require__(6602); "use strict"; var KEY_CODE_TAB = 9; var DIV_TOUCH_SIZE = 100; var DIV_TOUCH_POS_X = 0; var DIV_TOUCH_POS_Y = 0; var DIV_TOUCH_ZINDEX = 2; var DIV_HOOK_SIZE = 1; var DIV_HOOK_POS_X = -1e3; var DIV_HOOK_POS_Y = -1e3; var DIV_HOOK_ZINDEX = 2; var _AccessibilitySystem = /*#__PURE__*/function () { // 2fps // eslint-disable-next-line jsdoc/require-param /** * @param {WebGLRenderer|WebGPURenderer} renderer - A reference to the current renderer */ function _AccessibilitySystem(renderer) { var _mobileInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isMobile.isMobile; _classCallCheck(this, _AccessibilitySystem); this._mobileInfo = _mobileInfo; /** Whether accessibility divs are visible for debugging */ this.debug = false; /** Whether to activate on tab key press */ this._activateOnTab = true; /** Whether to deactivate accessibility when mouse moves */ this._deactivateOnMouseMove = true; /** Internal variable, see isActive getter. */ this._isActive = false; /** Internal variable, see isMobileAccessibility getter. */ this._isMobileAccessibility = false; /** This is the dom element that will sit over the PixiJS element. This is where the div overlays will go. */ this._div = null; /** A simple pool for storing divs. */ this._pool = []; /** This is a tick used to check if an object is no longer being rendered. */ this._renderId = 0; /** The array of currently active accessible items. */ this._children = []; /** Count to throttle div updates on android devices. */ this._androidUpdateCount = 0; /** The frequency to update the div elements. */ this._androidUpdateFrequency = 500; this._hookDiv = null; if (_mobileInfo.tablet || _mobileInfo.phone) { this._createTouchHook(); } this._renderer = renderer; } /** * Value of `true` if accessibility is currently active and accessibility layers are showing. * @member {boolean} * @readonly */ return _createClass(_AccessibilitySystem, [{ key: "isActive", get: function get() { return this._isActive; } /** * Value of `true` if accessibility is enabled for touch devices. * @member {boolean} * @readonly */ }, { key: "isMobileAccessibility", get: function get() { return this._isMobileAccessibility; } }, { key: "hookDiv", get: function get() { return this._hookDiv; } /** * Creates the touch hooks. * @private */ }, { key: "_createTouchHook", value: function _createTouchHook() { var _this = this; var hookDiv = document.createElement("button"); hookDiv.style.width = "".concat(DIV_HOOK_SIZE, "px"); hookDiv.style.height = "".concat(DIV_HOOK_SIZE, "px"); hookDiv.style.position = "absolute"; hookDiv.style.top = "".concat(DIV_HOOK_POS_X, "px"); hookDiv.style.left = "".concat(DIV_HOOK_POS_Y, "px"); hookDiv.style.zIndex = DIV_HOOK_ZINDEX.toString(); hookDiv.style.backgroundColor = "#FF0000"; hookDiv.title = "select to enable accessibility for this content"; hookDiv.addEventListener("focus", function () { _this._isMobileAccessibility = true; _this._activate(); _this._destroyTouchHook(); }); document.body.appendChild(hookDiv); this._hookDiv = hookDiv; } /** * Destroys the touch hooks. * @private */ }, { key: "_destroyTouchHook", value: function _destroyTouchHook() { if (!this._hookDiv) { return; } document.body.removeChild(this._hookDiv); this._hookDiv = null; } /** * Activating will cause the Accessibility layer to be shown. * This is called when a user presses the tab key. * @private */ }, { key: "_activate", value: function _activate() { var _this2 = this; if (this._isActive) { return; } this._isActive = true; if (!this._div) { this._div = document.createElement("div"); this._div.style.width = "".concat(DIV_TOUCH_SIZE, "px"); this._div.style.height = "".concat(DIV_TOUCH_SIZE, "px"); this._div.style.position = "absolute"; this._div.style.top = "".concat(DIV_TOUCH_POS_X, "px"); this._div.style.left = "".concat(DIV_TOUCH_POS_Y, "px"); this._div.style.zIndex = DIV_TOUCH_ZINDEX.toString(); this._div.style.pointerEvents = "none"; } if (this._activateOnTab) { this._onKeyDown = this._onKeyDown.bind(this); globalThis.addEventListener("keydown", this._onKeyDown, false); } if (this._deactivateOnMouseMove) { this._onMouseMove = this._onMouseMove.bind(this); globalThis.document.addEventListener("mousemove", this._onMouseMove, true); } var canvas = this._renderer.view.canvas; if (!canvas.parentNode) { var observer = new MutationObserver(function () { if (canvas.parentNode) { canvas.parentNode.appendChild(_this2._div); observer.disconnect(); _this2._initAccessibilitySetup(); } }); observer.observe(document.body, { childList: true, subtree: true }); } else { canvas.parentNode.appendChild(this._div); this._initAccessibilitySetup(); } } // New method to handle initialization after div is ready }, { key: "_initAccessibilitySetup", value: function _initAccessibilitySetup() { this._renderer.runners.postrender.add(this); if (this._renderer.lastObjectRendered) { this._updateAccessibleObjects(this._renderer.lastObjectRendered); } } /** * Deactivates the accessibility system. Removes listeners and accessibility elements. * @private */ }, { key: "_deactivate", value: function _deactivate() { if (!this._isActive || this._isMobileAccessibility) { return; } this._isActive = false; globalThis.document.removeEventListener("mousemove", this._onMouseMove, true); if (this._activateOnTab) { globalThis.addEventListener("keydown", this._onKeyDown, false); } this._renderer.runners.postrender.remove(this); var _iterator = _createForOfIteratorHelper(this._children), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var child = _step.value; if (child._accessibleDiv && child._accessibleDiv.parentNode) { child._accessibleDiv.parentNode.removeChild(child._accessibleDiv); child._accessibleDiv = null; } child._accessibleActive = false; } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } this._pool.forEach(function (div) { if (div.parentNode) { div.parentNode.removeChild(div); } }); if (this._div && this._div.parentNode) { this._div.parentNode.removeChild(this._div); } this._pool = []; this._children = []; } /** * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer. * @private * @param {Container} container - The Container to check. */ }, { key: "_updateAccessibleObjects", value: function _updateAccessibleObjects(container) { if (!container.visible || !container.accessibleChildren) { return; } if (container.accessible) { if (!container._accessibleActive) { this._addChild(container); } container._renderId = this._renderId; } var children = container.children; if (children) { for (var i = 0; i < children.length; i++) { this._updateAccessibleObjects(children[i]); } } } /** * Runner init called, view is available at this point. * @ignore */ }, { key: "init", value: function init(options) { var defaultOpts = _AccessibilitySystem.defaultOptions; var mergedOptions = { accessibilityOptions: _objectSpread(_objectSpread({}, defaultOpts), (options === null || options === void 0 ? void 0 : options.accessibilityOptions) || {}) }; this.debug = mergedOptions.accessibilityOptions.debug; this._activateOnTab = mergedOptions.accessibilityOptions.activateOnTab; this._deactivateOnMouseMove = mergedOptions.accessibilityOptions.deactivateOnMouseMove; if (mergedOptions.accessibilityOptions.enabledByDefault) { this._activate(); } else if (this._activateOnTab) { this._onKeyDown = this._onKeyDown.bind(this); globalThis.addEventListener("keydown", this._onKeyDown, false); } this._renderer.runners.postrender.remove(this); } /** * Updates the accessibility layer during rendering. * - Removes divs for containers no longer in the scene * - Updates the position and dimensions of the root div * - Updates positions of active accessibility divs * Only fires while the accessibility system is active. * @ignore */ }, { key: "postrender", value: function postrender() { var now = performance.now(); if (this._mobileInfo.android.device && now < this._androidUpdateCount) { return; } this._androidUpdateCount = now + this._androidUpdateFrequency; if (!this._renderer.renderingToScreen || !this._renderer.view.canvas) { return; } var activeIds = /* @__PURE__ */new Set(); if (this._renderer.lastObjectRendered) { this._updateAccessibleObjects(this._renderer.lastObjectRendered); var _iterator2 = _createForOfIteratorHelper(this._children), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var child = _step2.value; if (child._renderId === this._renderId) { activeIds.add(this._children.indexOf(child)); } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } } for (var i = this._children.length - 1; i >= 0; i--) { var _child = this._children[i]; if (!activeIds.has(i)) { if (_child._accessibleDiv && _child._accessibleDiv.parentNode) { _child._accessibleDiv.parentNode.removeChild(_child._accessibleDiv); this._pool.push(_child._accessibleDiv); _child._accessibleDiv = null; } _child._accessibleActive = false; removeItems.removeItems(this._children, i, 1); } } if (this._renderer.renderingToScreen) { var _this$_renderer$scree = this._renderer.screen, x = _this$_renderer$scree.x, y = _this$_renderer$scree.y, viewWidth = _this$_renderer$scree.width, viewHeight = _this$_renderer$scree.height; var div = this._div; div.style.left = "".concat(x, "px"); div.style.top = "".concat(y, "px"); div.style.width = "".concat(viewWidth, "px"); div.style.height = "".concat(viewHeight, "px"); } for (var _i = 0; _i < this._children.length; _i++) { var _child2 = this._children[_i]; if (!_child2._accessibleActive || !_child2._accessibleDiv) { continue; } var _div = _child2._accessibleDiv; var hitArea = _child2.hitArea || _child2.getBounds().rectangle; if (_child2.hitArea) { var wt = _child2.worldTransform; var sx = this._renderer.resolution; var sy = this._renderer.resolution; _div.style.left = "".concat((wt.tx + hitArea.x * wt.a) * sx, "px"); _div.style.top = "".concat((wt.ty + hitArea.y * wt.d) * sy, "px"); _div.style.width = "".concat(hitArea.width * wt.a * sx, "px"); _div.style.height = "".concat(hitArea.height * wt.d * sy, "px"); } else { this._capHitArea(hitArea); var _sx = this._renderer.resolution; var _sy = this._renderer.resolution; _div.style.left = "".concat(hitArea.x * _sx, "px"); _div.style.top = "".concat(hitArea.y * _sy, "px"); _div.style.width = "".concat(hitArea.width * _sx, "px"); _div.style.height = "".concat(hitArea.height * _sy, "px"); } } this._renderId++; } /** * private function that will visually add the information to the * accessibility div * @param {HTMLElement} div - */ }, { key: "_updateDebugHTML", value: function _updateDebugHTML(div) { div.innerHTML = "type: ".concat(div.type, "</br> title : ").concat(div.title, "</br> tabIndex: ").concat(div.tabIndex); } /** * Adjust the hit area based on the bounds of a display object * @param {Rectangle} hitArea - Bounds of the child */ }, { key: "_capHitArea", value: function _capHitArea(hitArea) { if (hitArea.x < 0) { hitArea.width += hitArea.x; hitArea.x = 0; } if (hitArea.y < 0) { hitArea.height += hitArea.y; hitArea.y = 0; } var _this$_renderer = this._renderer, viewWidth = _this$_renderer.width, viewHeight = _this$_renderer.height; if (hitArea.x + hitArea.width > viewWidth) { hitArea.width = viewWidth - hitArea.x; } if (hitArea.y + hitArea.height > viewHeight) { hitArea.height = viewHeight - hitArea.y; } } /** * Creates or reuses a div element for a Container and adds it to the accessibility layer. * Sets up ARIA attributes, event listeners, and positioning based on the container's properties. * @private * @param {Container} container - The child to make accessible. */ }, { key: "_addChild", value: function _addChild(container) { var div = this._pool.pop(); if (!div) { if (container.accessibleType === "button") { div = document.createElement("button"); } else { div = document.createElement(container.accessibleType); div.style.cssText = "\n color: transparent;\n pointer-events: none;\n padding: 0;\n margin: 0;\n border: 0;\n outline: 0;\n background: transparent;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n "; if (container.accessibleText) { div.innerText = container.accessibleText; } } div.style.width = "".concat(DIV_TOUCH_SIZE, "px"); div.style.height = "".concat(DIV_TOUCH_SIZE, "px"); div.style.backgroundColor = this.debug ? "rgba(255,255,255,0.5)" : "transparent"; div.style.position = "absolute"; div.style.zIndex = DIV_TOUCH_ZINDEX.toString(); div.style.borderStyle = "none"; if (navigator.userAgent.toLowerCase().includes("chrome")) { div.setAttribute("aria-live", "off"); } else { div.setAttribute("aria-live", "polite"); } if (navigator.userAgent.match(/rv:.*Gecko\//)) { div.setAttribute("aria-relevant", "additions"); } else { div.setAttribute("aria-relevant", "text"); } div.addEventListener("click", this._onClick.bind(this)); div.addEventListener("focus", this._onFocus.bind(this)); div.addEventListener("focusout", this._onFocusOut.bind(this)); } div.style.pointerEvents = container.accessiblePointerEvents; div.type = container.accessibleType; if (container.accessibleTitle && container.accessibleTitle !== null) { div.title = container.accessibleTitle; } else if (!container.accessibleHint || container.accessibleHint === null) { div.title = "container ".concat(container.tabIndex); } if (container.accessibleHint && container.accessibleHint !== null) { div.setAttribute("aria-label", container.accessibleHint); } if (this.debug) { this._updateDebugHTML(div); } container._accessibleActive = true; container._accessibleDiv = div; div.container = container; this._children.push(container); this._div.appendChild(container._accessibleDiv); if (container.interactive) { container._accessibleDiv.tabIndex = container.tabIndex; } } /** * Dispatch events with the EventSystem. * @param e * @param type * @private */ }, { key: "_dispatchEvent", value: function _dispatchEvent(e, type) { var target = e.target.container; var boundary = this._renderer.events.rootBoundary; var event = Object.assign(new FederatedEvent.FederatedEvent(boundary), { target: target }); boundary.rootTarget = this._renderer.lastObjectRendered; type.forEach(function (type2) { return boundary.dispatchEvent(event, type2); }); } /** * Maps the div button press to pixi's EventSystem (click) * @private * @param {MouseEvent} e - The click event. */ }, { key: "_onClick", value: function _onClick(e) { this._dispatchEvent(e, ["click", "pointertap", "tap"]); } /** * Maps the div focus events to pixi's EventSystem (mouseover) * @private * @param {FocusEvent} e - The focus event. */ }, { key: "_onFocus", value: function _onFocus(e) { if (!e.target.getAttribute("aria-live")) { e.target.setAttribute("aria-live", "assertive"); } this._dispatchEvent(e, ["mouseover"]); } /** * Maps the div focus events to pixi's EventSystem (mouseout) * @private * @param {FocusEvent} e - The focusout event. */ }, { key: "_onFocusOut", value: function _onFocusOut(e) { if (!e.target.getAttribute("aria-live")) { e.target.setAttribute("aria-live", "polite"); } this._dispatchEvent(e, ["mouseout"]); } /** * Is called when a key is pressed * @private * @param {KeyboardEvent} e - The keydown event. */ }, { key: "_onKeyDown", value: function _onKeyDown(e) { if (e.keyCode !== KEY_CODE_TAB || !this._activateOnTab) { return; } this._activate(); } /** * Is called when the mouse moves across the renderer element * @private * @param {MouseEvent} e - The mouse event. */ }, { key: "_onMouseMove", value: function _onMouseMove(e) { if (e.movementX === 0 && e.movementY === 0) { return; } this._deactivate(); } /** Destroys the accessibility system. Removes all elements and listeners. */ }, { key: "destroy", value: function destroy() { this._deactivate(); this._destroyTouchHook(); this._div = null; this._pool = null; this._children = null; this._renderer = null; if (this._activateOnTab) { globalThis.removeEventListener("keydown", this._onKeyDown); } } /** * Enables or disables the accessibility system. * @param enabled - Whether to enable or disable accessibility. */ }, { key: "setAccessibilityEnabled", value: function setAccessibilityEnabled(enabled) { if (enabled) { this._activate(); } else { this._deactivate(); } } }]); }(); /** @ignore */ _AccessibilitySystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem], name: "accessibility" }; /** default options used by the system */ _AccessibilitySystem.defaultOptions = { /** * Whether to enable accessibility features on initialization * @default false */ enabledByDefault: false, /** * Whether to visually show the accessibility divs for debugging * @default false */ debug: false, /** * Whether to activate accessibility when tab key is pressed * @default true */ activateOnTab: true, /** * Whether to deactivate accessibility when mouse moves * @default true */ deactivateOnMouseMove: true }; var AccessibilitySystem = _AccessibilitySystem; exports.AccessibilitySystem = AccessibilitySystem; /***/ }), /***/ 21408: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["texture", "verticesX", "verticesY"]; function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropSet(t, e, o, r, p, f) { return _set(_getPrototypeOf(f ? t.prototype : t), e, o, r, p); } function set(e, r, t, o) { return set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) { var f, i = _superPropBase(e, r); if (i) { if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), !0; if (!f.writable) return !1; } if (f = Object.getOwnPropertyDescriptor(o, r)) { if (!f.writable) return !1; f.value = t, Object.defineProperty(o, r, f); } else _defineProperty(o, r, t); return !0; }, set(e, r, t, o); } function _set(e, r, t, o, f) { if (!set(e, r, t, o || e) && f) throw new TypeError("failed to set property"); return t; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Texture = __webpack_require__(73782); var definedProps = __webpack_require__(48629); var Mesh = __webpack_require__(60931); var PerspectivePlaneGeometry = __webpack_require__(83675); "use strict"; var _PerspectiveMesh = /*#__PURE__*/function (_Mesh$Mesh) { /** * @param options - Options to be applied to PerspectiveMesh */ function _PerspectiveMesh(options) { var _this; _classCallCheck(this, _PerspectiveMesh); options = _objectSpread(_objectSpread({}, _PerspectiveMesh.defaultOptions), options); var _options = options, texture = _options.texture, verticesX = _options.verticesX, verticesY = _options.verticesY, rest = _objectWithoutProperties(_options, _excluded); var planeGeometry = new PerspectivePlaneGeometry.PerspectivePlaneGeometry(definedProps.definedProps({ width: texture.width, height: texture.height, verticesX: verticesX, verticesY: verticesY })); _this = _callSuper(this, _PerspectiveMesh, [definedProps.definedProps(_objectSpread(_objectSpread({}, rest), {}, { geometry: planeGeometry }))]); _this._texture = texture; _this.geometry.setCorners(options.x0, options.y0, options.x1, options.y1, options.x2, options.y2, options.x3, options.y3); return _this; } /** Update the geometry when the texture is updated */ _inherits(_PerspectiveMesh, _Mesh$Mesh); return _createClass(_PerspectiveMesh, [{ key: "textureUpdated", value: function textureUpdated() { var geometry = this.geometry; if (!geometry) return; var _this$texture = this.texture, width = _this$texture.width, height = _this$texture.height; if (geometry.width !== width || geometry.height !== height) { geometry.width = width; geometry.height = height; geometry.updateProjection(); } } }, { key: "texture", get: /** The texture that the mesh uses */ function get() { return this._texture; } /** * Set the corners of the quad to the given coordinates * The mesh will then calculate the perspective so it looks correct! * @param x0 - x coordinate of the first corner * @param y0 - y coordinate of the first corner * @param x1 - x coordinate of the second corner * @param y1 - y coordinate of the second corner * @param x2 - x coordinate of the third corner * @param y2 - y coordinate of the third corner * @param x3 - x coordinate of the fourth corner * @param y3 - y coordinate of the fourth corner */, set: function set(value) { if (this._texture === value) return; _superPropSet(_PerspectiveMesh, "texture", value, this, 1, 1); this.textureUpdated(); } }, { key: "setCorners", value: function setCorners(x0, y0, x1, y1, x2, y2, x3, y3) { this.geometry.setCorners(x0, y0, x1, y1, x2, y2, x3, y3); } }]); }(Mesh.Mesh); /** default options for the mesh */ _PerspectiveMesh.defaultOptions = { texture: Texture.Texture.WHITE, verticesX: 10, verticesY: 10, x0: 0, y0: 0, x1: 100, y1: 0, x2: 100, y2: 100, x3: 0, y3: 100 }; var PerspectiveMesh = _PerspectiveMesh; exports.PerspectiveMesh = PerspectiveMesh; /***/ }), /***/ 21623: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var _const = __webpack_require__(20105); var Ticker = __webpack_require__(6014); "use strict"; var EventsTickerClass = /*#__PURE__*/function () { function EventsTickerClass() { _classCallCheck(this, EventsTickerClass); /** The frequency that fake events will be fired. */ this.interactionFrequency = 10; this._deltaTime = 0; this._didMove = false; this._tickerAdded = false; this._pauseUpdate = true; } /** * Initializes the event ticker. * @param events - The event system. */ return _createClass(EventsTickerClass, [{ key: "init", value: function init(events) { this.removeTickerListener(); this.events = events; this.interactionFrequency = 10; this._deltaTime = 0; this._didMove = false; this._tickerAdded = false; this._pauseUpdate = true; } /** Whether to pause the update checks or not. */ }, { key: "pauseUpdate", get: function get() { return this._pauseUpdate; }, set: function set(paused) { this._pauseUpdate = paused; } /** Adds the ticker listener. */ }, { key: "addTickerListener", value: function addTickerListener() { if (this._tickerAdded || !this.domElement) { return; } Ticker.Ticker.system.add(this._tickerUpdate, this, _const.UPDATE_PRIORITY.INTERACTION); this._tickerAdded = true; } /** Removes the ticker listener. */ }, { key: "removeTickerListener", value: function removeTickerListener() { if (!this._tickerAdded) { return; } Ticker.Ticker.system.remove(this._tickerUpdate, this); this._tickerAdded = false; } /** Sets flag to not fire extra events when the user has already moved there mouse */ }, { key: "pointerMoved", value: function pointerMoved() { this._didMove = true; } /** Updates the state of interactive objects. */ }, { key: "_update", value: function _update() { if (!this.domElement || this._pauseUpdate) { return; } if (this._didMove) { this._didMove = false; return; } var rootPointerEvent = this.events["_rootPointerEvent"]; if (this.events.supportsTouchEvents && rootPointerEvent.pointerType === "touch") { return; } globalThis.document.dispatchEvent(new PointerEvent("pointermove", { clientX: rootPointerEvent.clientX, clientY: rootPointerEvent.clientY, pointerType: rootPointerEvent.pointerType, pointerId: rootPointerEvent.pointerId })); } /** * Updates the state of interactive objects if at least {@link interactionFrequency} * milliseconds have passed since the last invocation. * * Invoked by a throttled ticker update from {@link Ticker.system}. * @param ticker - The throttled ticker. */ }, { key: "_tickerUpdate", value: function _tickerUpdate(ticker) { this._deltaTime += ticker.deltaTime; if (this._deltaTime < this.interactionFrequency) { return; } this._deltaTime = 0; this._update(); } }]); }(); var EventsTicker = new EventsTickerClass(); exports.EventsTicker = EventsTicker; /***/ }), /***/ 21654: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var localUniformBit = { name: "local-uniform-bit", vertex: { header: /* wgsl */"\n\n struct LocalUniforms {\n uTransformMatrix:mat3x3<f32>,\n uColor:vec4<f32>,\n uRound:f32,\n }\n\n @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ", main: /* wgsl */"\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n ", end: /* wgsl */"\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n " } }; var localUniformBitGroup2 = _objectSpread(_objectSpread({}, localUniformBit), {}, { vertex: _objectSpread(_objectSpread({}, localUniformBit.vertex), {}, { // replace the group! header: localUniformBit.vertex.header.replace("group(1)", "group(2)") }) }); var localUniformBitGl = { name: "local-uniform-bit", vertex: { header: /* glsl */"\n\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n ", main: /* glsl */"\n vColor *= uColor;\n modelMatrix = uTransformMatrix;\n ", end: /* glsl */"\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n " } }; exports.localUniformBit = localUniformBit; exports.localUniformBitGl = localUniformBitGl; exports.localUniformBitGroup2 = localUniformBitGroup2; /***/ }), /***/ 21963: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var deprecation = __webpack_require__(11225); "use strict"; var cacheAsTextureMixin = { /** * Is this container cached as a texture? * @readonly * @type {boolean} * @memberof scene.Container# */ get isCachedAsTexture() { var _this$renderGroup; return !!((_this$renderGroup = this.renderGroup) !== null && _this$renderGroup !== void 0 && _this$renderGroup.isCachedAsTexture); }, cacheAsTexture: function cacheAsTexture(val) { if (typeof val === "boolean" && val === false) { this.disableRenderGroup(); } else { this.enableRenderGroup(); this.renderGroup.enableCacheAsTexture(val === true ? {} : val); } }, /** * Updates the cached texture. Will flag that this container's cached texture needs to be redrawn. * This will happen on the next render. * @memberof scene.Container# */ updateCacheTexture: function updateCacheTexture() { var _this$renderGroup2; (_this$renderGroup2 = this.renderGroup) === null || _this$renderGroup2 === void 0 || _this$renderGroup2.updateCacheTexture(); }, /** * Allows backwards compatibility with pixi.js below version v8. Use `cacheAsTexture` instead. * @deprecated */ get cacheAsBitmap() { return this.isCachedAsTexture; }, /** * @deprecated */ set cacheAsBitmap(val) { deprecation.deprecation("v8.6.0", "cacheAsBitmap is deprecated, use cacheAsTexture instead."); this.cacheAsTexture(val); } }; exports.cacheAsTextureMixin = cacheAsTextureMixin; /***/ }), /***/ 22247: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(99799); "use strict"; function buildPixelLine(points, closed, vertices, indices) { var eps = _const.closePointEps; if (points.length === 0) { return; } var fx = points[0]; var fy = points[1]; var lx = points[points.length - 2]; var ly = points[points.length - 1]; var closePath = closed || Math.abs(fx - lx) < eps && Math.abs(fy - ly) < eps; var verts = vertices; var length = points.length / 2; var indexStart = verts.length / 2; for (var i = 0; i < length; i++) { verts.push(points[i * 2]); verts.push(points[i * 2 + 1]); } for (var _i = 0; _i < length - 1; _i++) { indices.push(indexStart + _i, indexStart + _i + 1); } if (closePath) { indices.push(indexStart + length - 1, indexStart); } } exports.buildPixelLine = buildPixelLine; /***/ }), /***/ 22380: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function migrateFragmentFromV7toV8(fragmentShader) { fragmentShader = fragmentShader.replaceAll("texture2D", "texture").replaceAll("gl_FragColor", "finalColor").replaceAll("varying", "in"); fragmentShader = "\n out vec4 finalColor;\n ".concat(fragmentShader, "\n "); return fragmentShader; } exports.migrateFragmentFromV7toV8 = migrateFragmentFromV7toV8; /***/ }), /***/ 22572: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var PoolGroup = __webpack_require__(47505); var BatchableSprite = __webpack_require__(42517); var updateTextBounds = __webpack_require__(38157); "use strict"; var CanvasTextPipe = /*#__PURE__*/function () { function CanvasTextPipe(renderer) { _classCallCheck(this, CanvasTextPipe); this._gpuText = /* @__PURE__ */Object.create(null); this._destroyRenderableBound = this.destroyRenderable.bind(this); this._renderer = renderer; this._renderer.runners.resolutionChange.add(this); this._renderer.renderableGC.addManagedHash(this, "_gpuText"); } return _createClass(CanvasTextPipe, [{ key: "resolutionChange", value: function resolutionChange() { for (var i in this._gpuText) { var gpuText = this._gpuText[i]; if (!gpuText) continue; var text = gpuText.batchableSprite.renderable; if (text._autoResolution) { text._resolution = this._renderer.resolution; text.onViewUpdate(); } } } }, { key: "validateRenderable", value: function validateRenderable(text) { var gpuText = this._getGpuText(text); var newKey = text._getKey(); if (gpuText.currentKey !== newKey) { return true; } return false; } }, { key: "addRenderable", value: function addRenderable(text, instructionSet) { var gpuText = this._getGpuText(text); var batchableSprite = gpuText.batchableSprite; if (text._didTextUpdate) { this._updateText(text); } this._renderer.renderPipes.batch.addToBatch(batchableSprite, instructionSet); } }, { key: "updateRenderable", value: function updateRenderable(text) { var gpuText = this._getGpuText(text); var batchableSprite = gpuText.batchableSprite; if (text._didTextUpdate) { this._updateText(text); } batchableSprite._batcher.updateElement(batchableSprite); } }, { key: "destroyRenderable", value: function destroyRenderable(text) { text.off("destroyed", this._destroyRenderableBound); this._destroyRenderableById(text.uid); } }, { key: "_destroyRenderableById", value: function _destroyRenderableById(textUid) { var gpuText = this._gpuText[textUid]; this._renderer.canvasText.decreaseReferenceCount(gpuText.currentKey); PoolGroup.BigPool["return"](gpuText.batchableSprite); this._gpuText[textUid] = null; } }, { key: "_updateText", value: function _updateText(text) { var newKey = text._getKey(); var gpuText = this._getGpuText(text); var batchableSprite = gpuText.batchableSprite; if (gpuText.currentKey !== newKey) { this._updateGpuText(text); } text._didTextUpdate = false; updateTextBounds.updateTextBounds(batchableSprite, text); } }, { key: "_updateGpuText", value: function _updateGpuText(text) { var gpuText = this._getGpuText(text); var batchableSprite = gpuText.batchableSprite; if (gpuText.texture) { this._renderer.canvasText.decreaseReferenceCount(gpuText.currentKey); } gpuText.texture = batchableSprite.texture = this._renderer.canvasText.getManagedTexture(text); gpuText.currentKey = text._getKey(); batchableSprite.texture = gpuText.texture; } }, { key: "_getGpuText", value: function _getGpuText(text) { return this._gpuText[text.uid] || this.initGpuText(text); } }, { key: "initGpuText", value: function initGpuText(text) { var gpuTextData = { texture: null, currentKey: "--", batchableSprite: PoolGroup.BigPool.get(BatchableSprite.BatchableSprite) }; gpuTextData.batchableSprite.renderable = text; gpuTextData.batchableSprite.transform = text.groupTransform; gpuTextData.batchableSprite.bounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 }; gpuTextData.batchableSprite.roundPixels = this._renderer._roundPixels | text._roundPixels; this._gpuText[text.uid] = gpuTextData; text._resolution = text._autoResolution ? this._renderer.resolution : text.resolution; this._updateText(text); text.on("destroyed", this._destroyRenderableBound); return gpuTextData; } }, { key: "destroy", value: function destroy() { for (var i in this._gpuText) { this._destroyRenderableById(i); } this._gpuText = null; this._renderer = null; } }]); }(); /** @ignore */ CanvasTextPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "text" }; exports.CanvasTextPipe = CanvasTextPipe; /***/ }), /***/ 22609: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; __webpack_require__(63607); var EventBoundary = __webpack_require__(61435); __webpack_require__(82534); var EventSystem = __webpack_require__(49556); var EventTicker = __webpack_require__(21623); var FederatedEvent = __webpack_require__(42961); __webpack_require__(3903); var FederatedEventTarget = __webpack_require__(64996); var FederatedMouseEvent = __webpack_require__(73616); var FederatedPointerEvent = __webpack_require__(58122); var FederatedWheelEvent = __webpack_require__(69288); "use strict"; exports.EventBoundary = EventBoundary.EventBoundary; exports.EventSystem = EventSystem.EventSystem; exports.EventsTicker = EventTicker.EventsTicker; exports.FederatedEvent = FederatedEvent.FederatedEvent; exports.FederatedContainer = FederatedEventTarget.FederatedContainer; exports.FederatedMouseEvent = FederatedMouseEvent.FederatedMouseEvent; exports.FederatedPointerEvent = FederatedPointerEvent.FederatedPointerEvent; exports.FederatedWheelEvent = FederatedWheelEvent.FederatedWheelEvent; /***/ }), /***/ 22718: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var EventEmitter = __webpack_require__(19497); "use strict"; var DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i; var VERSION = "8.8.1"; exports.EventEmitter = EventEmitter; exports.DATA_URI = DATA_URI; exports.VERSION = VERSION; /***/ }), /***/ 22727: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Matrix = __webpack_require__(20764); var Pool = __webpack_require__(93068); var Bounds = __webpack_require__(76631); "use strict"; var matrixPool = new Pool.Pool(Matrix.Matrix); var boundsPool = new Pool.Pool(Bounds.Bounds); exports.boundsPool = boundsPool; exports.matrixPool = matrixPool; /***/ }), /***/ 22880: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function injectBits(templateSrc, fragmentParts) { var out = templateSrc; for (var i in fragmentParts) { var parts = fragmentParts[i]; var toInject = parts.join("\n"); if (toInject.length) { out = out.replace("{{".concat(i, "}}"), "//-----".concat(i, " START-----//\n").concat(parts.join("\n"), "\n//----").concat(i, " FINISH----//")); } else { out = out.replace("{{".concat(i, "}}"), ""); } } return out; } exports.injectBits = injectBits; /***/ }), /***/ 22905: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var maxRecommendedTextures = __webpack_require__(6899); var compileHighShaderToProgram = __webpack_require__(97754); var colorBit = __webpack_require__(78786); var generateTextureBatchBit = __webpack_require__(96847); var localUniformBit = __webpack_require__(21654); var roundPixelsBit = __webpack_require__(35268); var getBatchSamplersUniformGroup = __webpack_require__(72059); var Shader = __webpack_require__(27866); var UniformGroup = __webpack_require__(34400); "use strict"; var GlGraphicsAdaptor = /*#__PURE__*/function () { function GlGraphicsAdaptor() { _classCallCheck(this, GlGraphicsAdaptor); } return _createClass(GlGraphicsAdaptor, [{ key: "init", value: function init() { var uniforms = new UniformGroup.UniformGroup({ uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" }, uTransformMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uRound: { value: 0, type: "f32" } }); var maxTextures = maxRecommendedTextures.getMaxTexturesPerBatch(); var glProgram = compileHighShaderToProgram.compileHighShaderGlProgram({ name: "graphics", bits: [colorBit.colorBitGl, generateTextureBatchBit.generateTextureBatchBitGl(maxTextures), localUniformBit.localUniformBitGl, roundPixelsBit.roundPixelsBitGl] }); this.shader = new Shader.Shader({ glProgram: glProgram, resources: { localUniforms: uniforms, batchSamplers: getBatchSamplersUniformGroup.getBatchSamplersUniformGroup(maxTextures) } }); } }, { key: "execute", value: function execute(graphicsPipe, renderable) { var context = renderable.context; var shader = context.customShader || this.shader; var renderer = graphicsPipe.renderer; var contextSystem = renderer.graphicsContext; var _contextSystem$getCon = contextSystem.getContextRenderData(context), batcher = _contextSystem$getCon.batcher, instructions = _contextSystem$getCon.instructions; shader.groups[0] = renderer.globalUniforms.bindGroup; renderer.state.set(graphicsPipe.state); renderer.shader.bind(shader); renderer.geometry.bind(batcher.geometry, shader.glProgram); var batches = instructions.instructions; for (var i = 0; i < instructions.instructionSize; i++) { var batch = batches[i]; if (batch.size) { for (var j = 0; j < batch.textures.count; j++) { renderer.texture.bind(batch.textures.textures[j], j); } renderer.geometry.draw(batch.topology, batch.size, batch.start); } } } }, { key: "destroy", value: function destroy() { this.shader.destroy(true); this.shader = null; } }]); }(); /** @ignore */ GlGraphicsAdaptor.extension = { type: [Extensions.ExtensionType.WebGLPipesAdaptor], name: "graphics" }; exports.GlGraphicsAdaptor = GlGraphicsAdaptor; /***/ }), /***/ 23009: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var ResizePlugin = __webpack_require__(27628); var TickerPlugin = __webpack_require__(47054); "use strict"; Extensions.extensions.add(ResizePlugin.ResizePlugin); Extensions.extensions.add(TickerPlugin.TickerPlugin); /***/ }), /***/ 23237: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var basis_worker = __webpack_require__(44036); var setBasisTranscoderPath = __webpack_require__(9773); "use strict"; var basisWorker; var urlHash = {}; function getBasisWorker(supportedTextures) { if (!basisWorker) { basisWorker = new basis_worker["default"]().worker; basisWorker.onmessage = function (messageEvent) { var _messageEvent$data = messageEvent.data, success = _messageEvent$data.success, url = _messageEvent$data.url, textureOptions = _messageEvent$data.textureOptions; if (!success) { console.warn("Failed to load Basis texture", url); } urlHash[url](textureOptions); }; basisWorker.postMessage({ type: "init", jsUrl: setBasisTranscoderPath.basisTranscoderUrls.jsUrl, wasmUrl: setBasisTranscoderPath.basisTranscoderUrls.wasmUrl, supportedTextures: supportedTextures }); } return basisWorker; } function loadBasisOnWorker(url, supportedTextures) { var ktxWorker = getBasisWorker(supportedTextures); return new Promise(function (resolve) { urlHash[url] = resolve; ktxWorker.postMessage({ type: "load", url: url }); }); } exports.loadBasisOnWorker = loadBasisOnWorker; /***/ }), /***/ 23448: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var ShaderStage = /* @__PURE__ */function (ShaderStage2) { ShaderStage2[ShaderStage2["VERTEX"] = 1] = "VERTEX"; ShaderStage2[ShaderStage2["FRAGMENT"] = 2] = "FRAGMENT"; ShaderStage2[ShaderStage2["COMPUTE"] = 4] = "COMPUTE"; return ShaderStage2; }(ShaderStage || {}); exports.ShaderStage = ShaderStage; /***/ }), /***/ 23551: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function extractStructAndGroups(wgsl) { var _wgsl$match, _wgsl$match$map$filte, _wgsl$match2; var linePattern = /(^|[^/])@(group|binding)\(\d+\)[^;]+;/g; var groupPattern = /@group\((\d+)\)/; var bindingPattern = /@binding\((\d+)\)/; var namePattern = /var(<[^>]+>)? (\w+)/; var typePattern = /:\s*(\w+)/; var structPattern = /struct\s+(\w+)\s*{([^}]+)}/g; var structMemberPattern = /(\w+)\s*:\s*([\w\<\>]+)/g; var structName = /struct\s+(\w+)/; var groups = (_wgsl$match = wgsl.match(linePattern)) === null || _wgsl$match === void 0 ? void 0 : _wgsl$match.map(function (item) { return { group: parseInt(item.match(groupPattern)[1], 10), binding: parseInt(item.match(bindingPattern)[1], 10), name: item.match(namePattern)[2], isUniform: item.match(namePattern)[1] === "<uniform>", type: item.match(typePattern)[1] }; }); if (!groups) { return { groups: [], structs: [] }; } var structs = (_wgsl$match$map$filte = (_wgsl$match2 = wgsl.match(structPattern)) === null || _wgsl$match2 === void 0 ? void 0 : _wgsl$match2.map(function (struct) { var name = struct.match(structName)[1]; var members = struct.match(structMemberPattern).reduce(function (acc, member) { var _member$split = member.split(":"), _member$split2 = _slicedToArray(_member$split, 2), name2 = _member$split2[0], type = _member$split2[1]; acc[name2.trim()] = type.trim(); return acc; }, {}); if (!members) { return null; } return { name: name, members: members }; }).filter(function (_ref) { var name = _ref.name; return groups.some(function (group) { return group.type === name; }); })) !== null && _wgsl$match$map$filte !== void 0 ? _wgsl$match$map$filte : []; return { groups: groups, structs: structs }; } exports.extractStructAndGroups = extractStructAndGroups; /***/ }), /***/ 23804: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Bounds = __webpack_require__(76631); var Container = __webpack_require__(47719); "use strict"; var ViewContainer = /*#__PURE__*/function (_Container$Container) { // eslint-disable-next-line @typescript-eslint/no-useless-constructor function ViewContainer(options) { var _this; _classCallCheck(this, ViewContainer); _this = _callSuper(this, ViewContainer, [options]); /** @private */ _this.canBundle = true; /** @private */ _this.allowChildren = false; /** @private */ _this._roundPixels = 0; /** @private */ _this._lastUsed = -1; _this._bounds = new Bounds.Bounds(0, 1, 0, 0); _this._boundsDirty = true; return _this; } /** * The local bounds of the view. * @type {rendering.Bounds} */ _inherits(ViewContainer, _Container$Container); return _createClass(ViewContainer, [{ key: "bounds", get: function get() { if (!this._boundsDirty) return this._bounds; this.updateBounds(); this._boundsDirty = false; return this._bounds; } /** * Whether or not to round the x/y position of the sprite. * @type {boolean} */ }, { key: "roundPixels", get: function get() { return !!this._roundPixels; }, set: function set(value) { this._roundPixels = value ? 1 : 0; } /** * Checks if the object contains the given point. * @param point - The point to check */ }, { key: "containsPoint", value: function containsPoint(point) { var bounds = this.bounds; var x = point.x, y = point.y; return x >= bounds.minX && x <= bounds.maxX && y >= bounds.minY && y <= bounds.maxY; } /** @private */ }, { key: "onViewUpdate", value: function onViewUpdate() { this._didViewChangeTick++; this._boundsDirty = true; if (this.didViewUpdate) return; this.didViewUpdate = true; var renderGroup = this.renderGroup || this.parentRenderGroup; if (renderGroup) { renderGroup.onChildViewUpdate(this); } } }, { key: "destroy", value: function destroy(options) { _superPropGet(ViewContainer, "destroy", this, 3)([options]); this._bounds = null; } }, { key: "collectRenderablesSimple", value: function collectRenderablesSimple(instructionSet, renderer, currentLayer) { var renderPipes = renderer.renderPipes, renderableGC = renderer.renderableGC; renderPipes.blendMode.setBlendMode(this, this.groupBlendMode, instructionSet); var rp = renderPipes; rp[this.renderPipeId].addRenderable(this, instructionSet); renderableGC.addRenderable(this); this.didViewUpdate = false; var children = this.children; var length = children.length; for (var i = 0; i < length; i++) { children[i].collectRenderables(instructionSet, renderer, currentLayer); } } }]); }(Container.Container); exports.ViewContainer = ViewContainer; /***/ }), /***/ 23845: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var uniformParsers = [ // uploading pixi matrix object to mat3 { type: "mat3x3<f32>", test: function test(data) { var value = data.value; return value.a !== void 0; }, ubo: "\n var matrix = uv[name].toArray(true);\n data[offset] = matrix[0];\n data[offset + 1] = matrix[1];\n data[offset + 2] = matrix[2];\n data[offset + 4] = matrix[3];\n data[offset + 5] = matrix[4];\n data[offset + 6] = matrix[5];\n data[offset + 8] = matrix[6];\n data[offset + 9] = matrix[7];\n data[offset + 10] = matrix[8];\n ", uniform: "\n gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));\n " }, // uploading a pixi rectangle as a vec4 { type: "vec4<f32>", test: function test(data) { return data.type === "vec4<f32>" && data.size === 1 && data.value.width !== void 0; }, ubo: "\n v = uv[name];\n data[offset] = v.x;\n data[offset + 1] = v.y;\n data[offset + 2] = v.width;\n data[offset + 3] = v.height;\n ", uniform: "\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);\n }\n " }, // uploading a pixi point as a vec2 { type: "vec2<f32>", test: function test(data) { return data.type === "vec2<f32>" && data.size === 1 && data.value.x !== void 0; }, ubo: "\n v = uv[name];\n data[offset] = v.x;\n data[offset + 1] = v.y;\n ", uniform: "\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.x || cv[1] !== v.y) {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud[name].location, v.x, v.y);\n }\n " }, // uploading a pixi color as a vec4 { type: "vec4<f32>", test: function test(data) { return data.type === "vec4<f32>" && data.size === 1 && data.value.red !== void 0; }, ubo: "\n v = uv[name];\n data[offset] = v.red;\n data[offset + 1] = v.green;\n data[offset + 2] = v.blue;\n data[offset + 3] = v.alpha;\n ", uniform: "\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);\n }\n " }, // uploading a pixi color as a vec3 { type: "vec3<f32>", test: function test(data) { return data.type === "vec3<f32>" && data.size === 1 && data.value.red !== void 0; }, ubo: "\n v = uv[name];\n data[offset] = v.red;\n data[offset + 1] = v.green;\n data[offset + 2] = v.blue;\n ", uniform: "\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n gl.uniform3f(ud[name].location, v.red, v.green, v.blue);\n }\n " }]; exports.uniformParsers = uniformParsers; /***/ }), /***/ 23896: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var createIdFromString = __webpack_require__(79471); var getMaxFragmentPrecision = __webpack_require__(56696); var addProgramDefines = __webpack_require__(66702); var ensurePrecision = __webpack_require__(57151); var insertVersion = __webpack_require__(30942); var setProgramName = __webpack_require__(55946); var stripVersion = __webpack_require__(20303); "use strict"; var processes = { // strips any version headers.. stripVersion: stripVersion.stripVersion, // adds precision string if not already present ensurePrecision: ensurePrecision.ensurePrecision, // add some defines if WebGL1 to make it more compatible with WebGL2 shaders addProgramDefines: addProgramDefines.addProgramDefines, // add the program name to the shader setProgramName: setProgramName.setProgramName, // add the version string to the shader header insertVersion: insertVersion.insertVersion }; var programCache = /* @__PURE__ */Object.create(null); var _GlProgram = /*#__PURE__*/function () { /** * Creates a shiny new GlProgram. Used by WebGL renderer. * @param options - The options for the program. */ function _GlProgram(options) { _classCallCheck(this, _GlProgram); options = _objectSpread(_objectSpread({}, _GlProgram.defaultOptions), options); var isES300 = options.fragment.indexOf("#version 300 es") !== -1; var preprocessorOptions = { stripVersion: isES300, ensurePrecision: { requestedFragmentPrecision: options.preferredFragmentPrecision, requestedVertexPrecision: options.preferredVertexPrecision, maxSupportedVertexPrecision: "highp", maxSupportedFragmentPrecision: getMaxFragmentPrecision.getMaxFragmentPrecision() }, setProgramName: { name: options.name }, addProgramDefines: isES300, insertVersion: isES300 }; var fragment = options.fragment; var vertex = options.vertex; Object.keys(processes).forEach(function (processKey) { var processOptions = preprocessorOptions[processKey]; fragment = processes[processKey](fragment, processOptions, true); vertex = processes[processKey](vertex, processOptions, false); }); this.fragment = fragment; this.vertex = vertex; this.transformFeedbackVaryings = options.transformFeedbackVaryings; this._key = createIdFromString.createIdFromString("".concat(this.vertex, ":").concat(this.fragment), "gl-program"); } /** destroys the program */ return _createClass(_GlProgram, [{ key: "destroy", value: function destroy() { this.fragment = null; this.vertex = null; this._attributeData = null; this._uniformData = null; this._uniformBlockData = null; this.transformFeedbackVaryings = null; } /** * Helper function that creates a program for a given source. * It will check the program cache if the program has already been created. * If it has that one will be returned, if not a new one will be created and cached. * @param options - The options for the program. * @returns A program using the same source */ }], [{ key: "from", value: function from(options) { var key = "".concat(options.vertex, ":").concat(options.fragment); if (!programCache[key]) { programCache[key] = new _GlProgram(options); } return programCache[key]; } }]); }(); /** The default options used by the program. */ _GlProgram.defaultOptions = { preferredVertexPrecision: "highp", preferredFragmentPrecision: "mediump" }; var GlProgram = _GlProgram; exports.GlProgram = GlProgram; /***/ }), /***/ 23962: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var checkDataUrl = __webpack_require__(36258); var checkExtension = __webpack_require__(59230); var LoaderParser = __webpack_require__(96804); "use strict"; var validJSONExtension = ".json"; var validJSONMIME = "application/json"; var loadJson = { extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.Low }, name: "loadJson", test: function test(url) { return checkDataUrl.checkDataUrl(url, validJSONMIME) || checkExtension.checkExtension(url, validJSONExtension); }, load: function load(url) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var response, json; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return adapter.DOMAdapter.get().fetch(url); case 1: response = _context.v; _context.n = 2; return response.json(); case 2: json = _context.v; return _context.a(2, json); } }, _callee); }))(); } }; exports.loadJson = loadJson; /***/ }), /***/ 23963: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function applyMatrix(array, stride, offset, matrix) { var index = 0; var size = array.length / (stride || 2); var a = matrix.a; var b = matrix.b; var c = matrix.c; var d = matrix.d; var tx = matrix.tx; var ty = matrix.ty; offset *= stride; while (index < size) { var x = array[offset]; var y = array[offset + 1]; array[offset] = a * x + c * y + tx; array[offset + 1] = b * x + d * y + ty; offset += stride; index++; } } exports.applyMatrix = applyMatrix; /***/ }), /***/ 24074: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var OverlayBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function OverlayBlend() { _classCallCheck(this, OverlayBlend); return _callSuper(this, OverlayBlend, [{ gl: { functions: "\n float overlay(float base, float blend)\n {\n return (base < 0.5) ? (2.0*base*blend) : (1.0-2.0*(1.0-base)*(1.0-blend));\n }\n\n vec3 blendOverlay(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n overlay(base.r, blend.r),\n overlay(base.g, blend.g),\n overlay(base.b, blend.b)\n );\n \n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendOverlay(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn overlay(base: f32, blend: f32) -> f32\n {\n return select((1.0-2.0*(1.0-base)*(1.0-blend)), (2.0*base*blend), base < 0.5);\n }\n\n fn blendOverlay(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n overlay(base.r, blend.r),\n overlay(base.g, blend.g),\n overlay(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendOverlay(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(OverlayBlend, _BlendModeFilter$Blen); return _createClass(OverlayBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ OverlayBlend.extension = { name: "overlay", type: Extensions.ExtensionType.BlendMode }; exports.OverlayBlend = OverlayBlend; /***/ }), /***/ 24185: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } var Color = __webpack_require__(98828); var extractSvgUrlId = __webpack_require__(45084); "use strict"; var styleAttributes = { // Fill properties fill: { type: "paint", "default": 0 }, // Fill color/gradient "fill-opacity": { type: "number", "default": 1 }, // Fill transparency // Stroke properties stroke: { type: "paint", "default": 0 }, // Stroke color/gradient "stroke-width": { type: "number", "default": 1 }, // Width of stroke "stroke-opacity": { type: "number", "default": 1 }, // Stroke transparency "stroke-linecap": { type: "string", "default": "butt" }, // End cap style: butt, round, square "stroke-linejoin": { type: "string", "default": "miter" }, // Join style: miter, round, bevel "stroke-miterlimit": { type: "number", "default": 10 }, // Limit on miter join sharpness "stroke-dasharray": { type: "string", "default": "none" }, // Dash pattern "stroke-dashoffset": { type: "number", "default": 0 }, // Offset for dash pattern // Global properties opacity: { type: "number", "default": 1 } // Overall opacity }; function parseSVGStyle(svg, session) { var style = svg.getAttribute("style"); var strokeStyle = {}; var fillStyle = {}; var result = { strokeStyle: strokeStyle, fillStyle: fillStyle, useFill: false, useStroke: false }; for (var key in styleAttributes) { var attribute = svg.getAttribute(key); if (attribute) { parseAttribute(session, result, key, attribute.trim()); } } if (style) { var styleParts = style.split(";"); for (var i = 0; i < styleParts.length; i++) { var stylePart = styleParts[i].trim(); var _stylePart$split = stylePart.split(":"), _stylePart$split2 = _slicedToArray(_stylePart$split, 2), _key = _stylePart$split2[0], value = _stylePart$split2[1]; if (styleAttributes[_key]) { parseAttribute(session, result, _key, value.trim()); } } } return { strokeStyle: result.useStroke ? strokeStyle : null, fillStyle: result.useFill ? fillStyle : null, useFill: result.useFill, useStroke: result.useStroke }; } function parseAttribute(session, result, id, value) { switch (id) { case "stroke": if (value !== "none") { if (value.startsWith("url(")) { var id2 = extractSvgUrlId.extractSvgUrlId(value); result.strokeStyle.fill = session.defs[id2]; } else { result.strokeStyle.color = Color.Color.shared.setValue(value).toNumber(); } result.useStroke = true; } break; case "stroke-width": result.strokeStyle.width = Number(value); break; case "fill": if (value !== "none") { if (value.startsWith("url(")) { var _id = extractSvgUrlId.extractSvgUrlId(value); result.fillStyle.fill = session.defs[_id]; } else { result.fillStyle.color = Color.Color.shared.setValue(value).toNumber(); } result.useFill = true; } break; case "fill-opacity": result.fillStyle.alpha = Number(value); break; case "stroke-opacity": result.strokeStyle.alpha = Number(value); break; case "opacity": result.fillStyle.alpha = Number(value); result.strokeStyle.alpha = Number(value); break; } } exports.parseAttribute = parseAttribute; exports.parseSVGStyle = parseSVGStyle; exports.styleAttributes = styleAttributes; /***/ }), /***/ 24425: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function updateWorldTransform(local, parent, world) { var lta = local.a; var ltb = local.b; var ltc = local.c; var ltd = local.d; var lttx = local.tx; var ltty = local.ty; var pta = parent.a; var ptb = parent.b; var ptc = parent.c; var ptd = parent.d; world.a = lta * pta + ltb * ptc; world.b = lta * ptb + ltb * ptd; world.c = ltc * pta + ltd * ptc; world.d = ltc * ptb + ltd * ptd; world.tx = lttx * pta + ltty * ptc + parent.tx; world.ty = lttx * ptb + ltty * ptd + parent.ty; } exports.updateWorldTransform = updateWorldTransform; /***/ }), /***/ 24500: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function processX(base, ids, depth, result, tags) { var id = ids[depth]; for (var i = 0; i < id.length; i++) { var value = id[i]; if (depth < ids.length - 1) { processX(base.replace(result[depth], value), ids, depth + 1, result, tags); } else { tags.push(base.replace(result[depth], value)); } } } function createStringVariations(string) { var regex = /\{(.*?)\}/g; var result = string.match(regex); var tags = []; if (result) { var ids = []; result.forEach(function (vars) { var split = vars.substring(1, vars.length - 1).split(","); ids.push(split); }); processX(string, ids, 0, result, tags); } else { tags.push(string); } return tags; } exports.createStringVariations = createStringVariations; /***/ }), /***/ 24509: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var BrowserAdapter = { createCanvas: function createCanvas(width, height) { var canvas = document.createElement("canvas"); canvas.width = width; canvas.height = height; return canvas; }, getCanvasRenderingContext2D: function getCanvasRenderingContext2D() { return CanvasRenderingContext2D; }, getWebGLRenderingContext: function getWebGLRenderingContext() { return WebGLRenderingContext; }, getNavigator: function getNavigator() { return navigator; }, getBaseUrl: function getBaseUrl() { var _document$baseURI; return (_document$baseURI = document.baseURI) !== null && _document$baseURI !== void 0 ? _document$baseURI : window.location.href; }, getFontFaceSet: function getFontFaceSet() { return document.fonts; }, fetch: function (_fetch) { function fetch(_x, _x2) { return _fetch.apply(this, arguments); } fetch.toString = function () { return _fetch.toString(); }; return fetch; }(function (url, options) { return fetch(url, options); }), parseXML: function parseXML(xml) { var parser = new DOMParser(); return parser.parseFromString(xml, "text/xml"); } }; exports.BrowserAdapter = BrowserAdapter; /***/ }), /***/ 24778: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var checkDataUrl = __webpack_require__(36258); var checkExtension = __webpack_require__(59230); var LoaderParser = __webpack_require__(96804); "use strict"; var validTXTExtension = ".txt"; var validTXTMIME = "text/plain"; var loadTxt = { name: "loadTxt", extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.Low, name: "loadTxt" }, test: function test(url) { return checkDataUrl.checkDataUrl(url, validTXTMIME) || checkExtension.checkExtension(url, validTXTExtension); }, load: function load(url) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var response, txt; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return adapter.DOMAdapter.get().fetch(url); case 1: response = _context.v; _context.n = 2; return response.text(); case 2: txt = _context.v; return _context.a(2, txt); } }, _callee); }))(); } }; exports.loadTxt = loadTxt; /***/ }), /***/ 24937: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var deprecation = __webpack_require__(11225); "use strict"; var findMixin = { /** * The instance label of the object. * @memberof scene.Container# * @member {string} label */ label: null, /** * The instance name of the object. * @deprecated since 8.0.0 * @see scene.Container#label * @member {string} name * @memberof scene.Container# */ get name() { deprecation.deprecation(deprecation.v8_0_0, "Container.name property has been removed, use Container.label instead"); return this.label; }, set name(value) { deprecation.deprecation(deprecation.v8_0_0, "Container.name property has been removed, use Container.label instead"); this.label = value; }, /** * @method getChildByName * @deprecated since 8.0.0 * @param {string} name - Instance name. * @param {boolean}[deep=false] - Whether to search recursively * @returns {Container} The child with the specified name. * @see scene.Container#getChildByLabel * @memberof scene.Container# */ getChildByName: function getChildByName(name) { var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return this.getChildByLabel(name, deep); }, /** * Returns the first child in the container with the specified label. * * Recursive searches are done in a pre-order traversal. * @memberof scene.Container# * @param {string|RegExp} label - Instance label. * @param {boolean}[deep=false] - Whether to search recursively * @returns {Container} The child with the specified label. */ getChildByLabel: function getChildByLabel(label) { var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var children = this.children; for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.label === label || label instanceof RegExp && label.test(child.label)) return child; } if (deep) { for (var _i = 0; _i < children.length; _i++) { var _child = children[_i]; var found = _child.getChildByLabel(label, true); if (found) { return found; } } } return null; }, /** * Returns all children in the container with the specified label. * @memberof scene.Container# * @param {string|RegExp} label - Instance label. * @param {boolean}[deep=false] - Whether to search recursively * @param {Container[]} [out=[]] - The array to store matching children in. * @returns {Container[]} An array of children with the specified label. */ getChildrenByLabel: function getChildrenByLabel(label) { var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var out = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; var children = this.children; for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.label === label || label instanceof RegExp && label.test(child.label)) { out.push(child); } } if (deep) { for (var _i2 = 0; _i2 < children.length; _i2++) { children[_i2].getChildrenByLabel(label, true, out); } } return out; } }; exports.findMixin = findMixin; /***/ }), /***/ 25039: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(15068); "use strict"; var GpuStencilModesToPixi = []; GpuStencilModesToPixi[_const.STENCIL_MODES.NONE] = void 0; GpuStencilModesToPixi[_const.STENCIL_MODES.DISABLED] = { stencilWriteMask: 0, stencilReadMask: 0 }; GpuStencilModesToPixi[_const.STENCIL_MODES.RENDERING_MASK_ADD] = { stencilFront: { compare: "equal", passOp: "increment-clamp" }, stencilBack: { compare: "equal", passOp: "increment-clamp" } }; GpuStencilModesToPixi[_const.STENCIL_MODES.RENDERING_MASK_REMOVE] = { stencilFront: { compare: "equal", passOp: "decrement-clamp" }, stencilBack: { compare: "equal", passOp: "decrement-clamp" } }; GpuStencilModesToPixi[_const.STENCIL_MODES.MASK_ACTIVE] = { stencilWriteMask: 0, stencilFront: { compare: "equal", passOp: "keep" }, stencilBack: { compare: "equal", passOp: "keep" } }; GpuStencilModesToPixi[_const.STENCIL_MODES.INVERSE_MASK_ACTIVE] = { stencilWriteMask: 0, stencilFront: { compare: "not-equal", passOp: "replace" }, stencilBack: { compare: "not-equal", passOp: "replace" } }; exports.GpuStencilModesToPixi = GpuStencilModesToPixi; /***/ }), /***/ 25082: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var source = "struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct AlphaUniforms {\n uAlpha:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> alphaUniforms : AlphaUniforms;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n };\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n \n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n \n var sample = textureSample(uTexture, uSampler, uv);\n \n return sample * alphaUniforms.uAlpha;\n}"; exports["default"] = source; /***/ }), /***/ 25131: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var adapter = __webpack_require__(72450); "use strict"; var context; function getTestContext() { var _context; if (!context || (_context = context) !== null && _context !== void 0 && _context.isContextLost()) { var canvas = adapter.DOMAdapter.get().createCanvas(); context = canvas.getContext("webgl", {}); } return context; } exports.getTestContext = getTestContext; /***/ }), /***/ 25654: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var uid = __webpack_require__(90844); var TextureSource = __webpack_require__(55406); var Texture = __webpack_require__(73782); "use strict"; var _RenderTarget = /*#__PURE__*/function () { /** * @param [descriptor] - Options for creating a render target. */ function _RenderTarget() { var descriptor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _RenderTarget); /** unique id for this render target */ this.uid = uid.uid("renderTarget"); /** * An array of textures that can be written to by the GPU - mostly this has one texture in Pixi, but you could * write to multiple if required! (eg deferred lighting) */ this.colorTextures = []; this.dirtyId = 0; this.isRoot = false; this._size = new Float32Array(2); /** if true, then when the render target is destroyed, it will destroy all the textures that were created for it. */ this._managedColorTextures = false; descriptor = _objectSpread(_objectSpread({}, _RenderTarget.defaultOptions), descriptor); this.stencil = descriptor.stencil; this.depth = descriptor.depth; this.isRoot = descriptor.isRoot; if (typeof descriptor.colorTextures === "number") { this._managedColorTextures = true; for (var i = 0; i < descriptor.colorTextures; i++) { this.colorTextures.push(new TextureSource.TextureSource({ width: descriptor.width, height: descriptor.height, resolution: descriptor.resolution, antialias: descriptor.antialias })); } } else { this.colorTextures = _toConsumableArray(descriptor.colorTextures.map(function (texture) { return texture.source; })); var colorSource = this.colorTexture.source; this.resize(colorSource.width, colorSource.height, colorSource._resolution); } this.colorTexture.source.on("resize", this.onSourceResize, this); if (descriptor.depthStencilTexture || this.stencil) { if (descriptor.depthStencilTexture instanceof Texture.Texture || descriptor.depthStencilTexture instanceof TextureSource.TextureSource) { this.depthStencilTexture = descriptor.depthStencilTexture.source; } else { this.ensureDepthStencilTexture(); } } } return _createClass(_RenderTarget, [{ key: "size", get: function get() { var _size = this._size; _size[0] = this.pixelWidth; _size[1] = this.pixelHeight; return _size; } }, { key: "width", get: function get() { return this.colorTexture.source.width; } }, { key: "height", get: function get() { return this.colorTexture.source.height; } }, { key: "pixelWidth", get: function get() { return this.colorTexture.source.pixelWidth; } }, { key: "pixelHeight", get: function get() { return this.colorTexture.source.pixelHeight; } }, { key: "resolution", get: function get() { return this.colorTexture.source._resolution; } }, { key: "colorTexture", get: function get() { return this.colorTextures[0]; } }, { key: "onSourceResize", value: function onSourceResize(source) { this.resize(source.width, source.height, source._resolution, true); } /** * This will ensure a depthStencil texture is created for this render target. * Most likely called by the mask system to make sure we have stencil buffer added. * @internal * @ignore */ }, { key: "ensureDepthStencilTexture", value: function ensureDepthStencilTexture() { if (!this.depthStencilTexture) { this.depthStencilTexture = new TextureSource.TextureSource({ width: this.width, height: this.height, resolution: this.resolution, format: "depth24plus-stencil8", autoGenerateMipmaps: false, antialias: false, mipLevelCount: 1 // sampleCount: handled by the render target system.. }); } } }, { key: "resize", value: function resize(width, height) { var resolution = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.resolution; var skipColorTexture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; this.dirtyId++; this.colorTextures.forEach(function (colorTexture, i) { if (skipColorTexture && i === 0) return; colorTexture.source.resize(width, height, resolution); }); if (this.depthStencilTexture) { this.depthStencilTexture.source.resize(width, height, resolution); } } }, { key: "destroy", value: function destroy() { this.colorTexture.source.off("resize", this.onSourceResize, this); if (this._managedColorTextures) { this.colorTextures.forEach(function (texture) { texture.destroy(); }); } if (this.depthStencilTexture) { this.depthStencilTexture.destroy(); delete this.depthStencilTexture; } } }]); }(); /** The default options for a render target */ _RenderTarget.defaultOptions = { /** the width of the RenderTarget */ width: 0, /** the height of the RenderTarget */ height: 0, /** the resolution of the RenderTarget */ resolution: 1, /** an array of textures, or a number indicating how many color textures there should be */ colorTextures: 1, /** should this render target have a stencil buffer? */ stencil: false, /** should this render target have a depth buffer? */ depth: false, /** should this render target be antialiased? */ antialias: false, // save on perf by default! /** is this a root element, true if this is gl context owners render target */ isRoot: false }; var RenderTarget = _RenderTarget; exports.RenderTarget = RenderTarget; /***/ }), /***/ 25835: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function transformVertices(vertices, m, offset, stride, size) { var a = m.a; var b = m.b; var c = m.c; var d = m.d; var tx = m.tx; var ty = m.ty; offset || (offset = 0); stride || (stride = 2); size || (size = vertices.length / stride - offset); var index = offset * stride; for (var i = 0; i < size; i++) { var x = vertices[index]; var y = vertices[index + 1]; vertices[index] = a * x + c * y + tx; vertices[index + 1] = b * x + d * y + ty; index += stride; } } exports.transformVertices = transformVertices; /***/ }), /***/ 26387: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _OOP = __webpack_require__(64181); var _AbstractScene = _interopRequireDefault(__webpack_require__(33186)); var _FCore = __webpack_require__(49997); var _Vec = _interopRequireDefault(__webpack_require__(28239)); var _GameObjects = __webpack_require__(36805); var _TreePicker = _interopRequireDefault(__webpack_require__(19257)); var _InLevelModal = _interopRequireDefault(__webpack_require__(49635)); var _pixi = __webpack_require__(3635); var _Commander = _interopRequireDefault(__webpack_require__(16385)); var _WavesController = _interopRequireDefault(__webpack_require__(48973)); var _EnemyObjects = __webpack_require__(97779); var _MainMenuScene = _interopRequireDefault(__webpack_require__(40918)); var _Map1Scene = _interopRequireDefault(__webpack_require__(16711)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @extends AbstractScene * @constructor */ function Level1Scene() { _AbstractScene["default"].apply(this, arguments); } (0, _OOP.mixClass)(Level1Scene, _AbstractScene["default"]); Level1Scene.prototype.map = { x: 218, y: 225, width: 1296, height: 648, cols: 12, rows: 6, cellSize: 1296 / 12 }; Level1Scene.prototype.wayCells = [{ x: 0, y: 1 }, { x: 1, y: 1 }, { x: 2, y: 1 }, { x: 2, y: 2 }, { x: 3, y: 2 }, { x: 3, y: 3 }, { x: 3, y: 4 }, { x: 4, y: 4 }, { x: 5, y: 4 }, { x: 6, y: 4 }, { x: 6, y: 5 }, { x: 7, y: 5 }, { x: 8, y: 5 }, { x: 9, y: 5 }, { x: 10, y: 5 }, { x: 10, y: 4 }, { x: 10, y: 3 }, { x: 10, y: 2 }, { x: 9, y: 2 }, { x: 9, y: 1 }, { x: 9, y: 0 }, { x: 10, y: 0 }, { x: 11, y: 0 } //last is protected target ]; Level1Scene.prototype.wayDict = Level1Scene.prototype.wayCells.reduce(function (ac, cr) { ac["".concat(cr.x, ",").concat(cr.y)] = true; return ac; }, {}); Level1Scene.prototype.waveCmd = [1, _EnemyObjects.ViKhuan, 2, _EnemyObjects.ViKhuan, 4, _EnemyObjects.ViKhuan, 7, _EnemyObjects.OcSen, 1, _EnemyObjects.ViKhuan, 9, _EnemyObjects.Sau, 1, _EnemyObjects.ViKhuan, 2, _EnemyObjects.ViKhuan, 4, _EnemyObjects.ViKhuan, 'end', 1, _EnemyObjects.BoCanhCung, 2, _EnemyObjects.ViKhuan, 4, _EnemyObjects.ViKhuan, 7, _EnemyObjects.OcSen, 1, _EnemyObjects.Sau, 3, _EnemyObjects.OcSen, 2, _EnemyObjects.Sau, 'end', //3 1, _EnemyObjects.ViKhuan, 7, _EnemyObjects.OcSen, 1, _EnemyObjects.ViKhuan, 9, _EnemyObjects.Sau, 7, _EnemyObjects.OcSen, 1, _EnemyObjects.Sau, 3, _EnemyObjects.OcSen, 'end', //4 2, _EnemyObjects.Sau, 7, _EnemyObjects.OcSen, 1, _EnemyObjects.Sau, 1, _EnemyObjects.OcSen, 1, _EnemyObjects.OcSen, 7, _EnemyObjects.OcSen, 1, _EnemyObjects.ViKhuan, 2, _EnemyObjects.Sau, 2, _EnemyObjects.Sau, 1, _EnemyObjects.Sau, 'end', //5 2, _EnemyObjects.Sau, 7, _EnemyObjects.OcSen, 1, _EnemyObjects.Sau, 3, _EnemyObjects.OcSen, 3, _EnemyObjects.OcSen, 0.3, _EnemyObjects.ViKhuan, 0.3, _EnemyObjects.ViKhuan, 0.3, _EnemyObjects.ViKhuan, 0.3, _EnemyObjects.ViKhuan, 0.3, _EnemyObjects.ViKhuan, 0.3, _EnemyObjects.ViKhuan, 0.3, _EnemyObjects.ViKhuan, 0.3, _EnemyObjects.ViKhuan, 0.3, _EnemyObjects.ViKhuan, 9, _EnemyObjects.Sau, 'end', //6 2, _EnemyObjects.Sau, 2, _EnemyObjects.OcSen, 0.5, _EnemyObjects.Sau, 0.5, _EnemyObjects.Sau, 0.5, _EnemyObjects.Sau, 0.5, _EnemyObjects.Sau, 0.5, _EnemyObjects.OcSen, 4, _EnemyObjects.OcSen, 1, _EnemyObjects.ViKhuan, 9, _EnemyObjects.Sau, 'end', 1, _EnemyObjects.ViKhuan, 2, _EnemyObjects.ViKhuan, 2, _EnemyObjects.BoCanhCung, 2, _EnemyObjects.BoCanhCung, 2, _EnemyObjects.BoCanhCung, 1, _EnemyObjects.OcSen, 1, _EnemyObjects.OcSen, 3, _EnemyObjects.OcSen, 2, _EnemyObjects.BoCanhCung, 2, _EnemyObjects.BoCanhCung, 1, _EnemyObjects.OcSen, 3, _EnemyObjects.OcSen, 3, _EnemyObjects.OcSen, 1, _EnemyObjects.ViKhuan, 9, _EnemyObjects.Sau, 'end', 1, _EnemyObjects.ViKhuan, 2, _EnemyObjects.OcSen, 4, _EnemyObjects.OcSen, 4, _EnemyObjects.OcSen, 7, _EnemyObjects.BoCanhCung, 0.5, _EnemyObjects.OcSen, 0.5, _EnemyObjects.OcSen, 0.5, _EnemyObjects.OcSen, 0.5, _EnemyObjects.OcSen, 0.5, _EnemyObjects.OcSen, 0.5, _EnemyObjects.OcSen, 0.5, _EnemyObjects.OcSen, 0.5, _EnemyObjects.OcSen, 1, _EnemyObjects.OcSen, 1, _EnemyObjects.Sau, 1, _EnemyObjects.Sau, 2, _EnemyObjects.BoCanhCung, 1, _EnemyObjects.BoCanhCung, 0.1, _EnemyObjects.ViKhuan, 0.1, _EnemyObjects.ViKhuan, 0.1, _EnemyObjects.ViKhuan, 0.1, _EnemyObjects.ViKhuan, 0.1, _EnemyObjects.ViKhuan, 0.1, _EnemyObjects.ViKhuan, 0.1, _EnemyObjects.ViKhuan, 4, _EnemyObjects.OcSen, 'end']; // Level1Scene.prototype.waveCmd = Level1Scene.prototype.waveCmd.slice(0, 30).concat(["end"]); Level1Scene.prototype.initCoins = 20; Level1Scene.prototype.initHp = 20; Level1Scene.prototype.cellTypeOf = function (x, y) { if (this.wayDict["".concat(x, ",").concat(y)]) { return 'way'; } }; Level1Scene.prototype.create = function () { var _this = this; this.gameState = "CREATE"; this.alliances = {}; this.enemies = {}; this.pGrid = new _pixi.Container(); this.pLiveObject = new _pixi.Container(); this.pGrid.addChild(this.pLiveObject); this.pGrid.x = 218; this.pGrid.y = 225; this.pixi.stage.addChild(this.pGrid); this.$mapGround = (0, _FCore._)({ tag: 'img', "class": 'as-map-ground', attr: { src: 'assets/level1_map_ground.png' } }); this.$bottomBar = (0, _FCore._)({ "class": 'as-bottom-bar', child: [{ tag: 'img', "class": 'as-bottom-bar-bg', attr: { src: 'assets/bottom_bar.png' } }, { tag: 'button', "class": 'as-img-btn', style: { left: '120px' }, child: { tag: 'img', attr: { src: 'assets/skill_1_btn.png' } } }, { tag: 'button', "class": 'as-img-btn', style: { left: '330px' }, child: { tag: 'img', attr: { src: 'assets/skill_2_btn.png' } } }, { tag: 'button', "class": 'as-img-btn', style: { left: '533px' }, child: { tag: 'img', attr: { src: 'assets/skill_3_btn.png' } } }, { tag: 'button', "class": 'as-img-btn', style: { left: '733px' }, child: { tag: 'img', attr: { src: 'assets/skill_4_btn.png' } } }] }); this.$starCoins = (0, _FCore._)({ "class": 'as-score', child: { text: '0' } }); this.$waveIdx = (0, _FCore._)({ tag: 'strong', "class": 'as-wave', child: { text: '01' } }); this.$totalWave = (0, _FCore._)({ tag: 'strong', child: { text: '/15' } }); this.$waves = (0, _FCore._)({ "class": 'as-waves', child: [this.$waveIdx, this.$totalWave, { tag: 'span', child: { text: ' WAVES' } }] }); this.$switch = (0, _FCore._)({ "class": 'as-switch', child: [{ tag: 'img', "class": 'as-switch-bg', attr: { src: 'assets/switch_bg.png' } }, { tag: 'img', "class": 'as-switch-x1', attr: { src: 'assets/x1.png' } }, { tag: 'img', "class": 'as-switch-x2', attr: { src: 'assets/x2.png' } }], on: { click: function click() { _this.x2 = !_this.x2; } } }); this.$pauseBtn = (0, _FCore._)({ tag: 'button', "class": ['as-pause-btn', 'as-img-btn'], child: { tag: 'img', attr: { src: 'assets/pause_btn.png' } }, on: { click: function click() { _this.paused = !_this.paused; } } }); this.$menuBtn = (0, _FCore._)({ tag: 'button', "class": ['as-menu-btn', 'as-img-btn'], child: { tag: 'img', attr: { src: 'assets/menu_btn.png' } }, on: { click: function click() { new _InLevelModal["default"](_this); } } }); // // setTimeout(()=>{ // new InLevelModal(this); // }, 1000) this.$topBar = (0, _FCore._)({ "class": 'as-top-bar', child: [{ tag: 'img', "class": 'as-top-bar-bg', attr: { src: 'assets/top_bar.png' } }, this.$starCoins, this.$waves, this.$switch, this.$pauseBtn, this.$menuBtn] }); this.$grid = (0, _FCore._)({ "class": 'as-game-grid', child: Array(6 * 12).fill('.as-cell') }); this.$staticObjectCtn = (0, _FCore._)({ "class": 'as-static-object-ctn' // child: [this.$grid] }); Array.prototype.map.call(this.$grid.childNodes, function (cell, i) { var x = i % 12; var y = Math.floor(i / 12); cell.on('click', function () { console.log(_this.cellTypeOf(x, y)); }); }); this.treePicker = new _TreePicker["default"](this); }; Level1Scene.prototype.onStart = function () { var _this2 = this; this.gameState = "PLAYING"; this.$bottomBar.addStyle('bottom', -136 + 'px'); this.$topBar.addStyle('top', -136 + 'px'); this.$foreground.addChild(this.$bottomBar).addChild(this.$topBar); this.$background.addChild([this.$mapGround, this.$staticObjectCtn]); setTimeout(function () { _this2.$bottomBar.removeStyle('bottom'); _this2.$topBar.addStyle('top', 0 + 'px'); }, 30); this.starCoins = this.initCoins; this.commander = new _Commander["default"](this); this.mosterHome = new _GameObjects.MonsterHome(this, -1, 1); this.protectedTarget = new _GameObjects.ProtectedTarget(this, 11, 0); this.protectedTarget.hp = this.initHp; this.wavesCtrl = new _WavesController["default"](this); this.staticObjects = {}; this.placeHolders = {}; this.bullets = {}; var temp = [new _GameObjects.GrassT2(this, 1, 0), new _GameObjects.GrassT2(this, 2, 0), new _GameObjects.GrassT2(this, 3, 5), new _GameObjects.GrassT2(this, 4, 5), new _GameObjects.GrassT2(this, 11, 5), new _GameObjects.GrassT2(this, 9, 3), new _GameObjects.GrassT2(this, 8, 4), new _GameObjects.GrassT1(this, 9, 4), new _GameObjects.GrassT1(this, 1, 2), new _GameObjects.GrassT3(this, 8, 0), new _GameObjects.GrassT3(this, 3, 1), new _GameObjects.Grass1x2(this, 4, 2), new _GameObjects.Mushroom(this, 4, 1), new _GameObjects.Mushroom(this, 11, 2), new _GameObjects.SmallRock(this, 2, 3), new _GameObjects.SmallRock(this, 8, 1), new _GameObjects.SmallRock(this, 11, 4), new _GameObjects.Rock2x1(this, 1, 4), new _GameObjects.Pond3x2(this, 5, 2)]; var temp2 = [new _GameObjects.PlaceHolder(this, 0, 0), new _GameObjects.PlaceHolder(this, 3, 0), new _GameObjects.PlaceHolder(this, 4, 0), new _GameObjects.PlaceHolder(this, 5, 0), new _GameObjects.PlaceHolder(this, 5, 1), new _GameObjects.PlaceHolder(this, 6, 1), new _GameObjects.PlaceHolder(this, 7, 1), new _GameObjects.PlaceHolder(this, 8, 2), new _GameObjects.PlaceHolder(this, 8, 3), new _GameObjects.PlaceHolder(this, 7, 4), new _GameObjects.PlaceHolder(this, 1, 5), new _GameObjects.PlaceHolder(this, 2, 5), new _GameObjects.PlaceHolder(this, 0, 2), new _GameObjects.PlaceHolder(this, 10, 1)]; }; Level1Scene.prototype.onStop = function () { this.gameState = "STOPPED"; [this.$grid, this.$staticObjectCtn, this.$topBar, this.$bottomBar, this.$mapGround].forEach(function (e) { e.remove(); }); this.treePicker.close(); this.protectedTarget.remove(); this.pixi.stage.removeChild(this.pGrid); this.mosterHome.remove(); Object.values(this.alliances).forEach(function (obj) { return obj.remove(); }); Object.values(this.enemies).forEach(function (obj) { return obj.remove(); }); Object.values(this.bullets).forEach(function (obj) { return obj.remove(); }); if (this.$resultModal) { this.$resultModal.remove(); this.$resultModal = null; } }; Level1Scene.prototype.onDestroy = function () { this.treePicker.destroy(); }; Level1Scene.prototype.onPointerDown = function (point) { if (this.treePicker.onPointerDown(point)) return; if (this.commander.onPointerDown(point)) return; // console.log(point) // console.log(this.cellOfPoint(point)); }; Level1Scene.prototype.onPointerUp = function (point) { if (this.treePicker.onPointerUp(point)) return; if (this.commander.onPointerUp(point)) return; }; Level1Scene.prototype.cellOfPoint = function (point) { var offset = point.sub(new _Vec["default"](this.map.x, this.map.y)); if (offset.x < 0 || offset.y < 0) return null; if (offset.x >= this.map.width || offset.y >= this.map.height) return null; var cellWidth = this.map.width / this.map.cols; var cellHeight = this.map.height / this.map.rows; var x = Math.floor(offset.x / cellWidth); var y = Math.floor(offset.y / cellHeight); return { x: x, y: y }; }; Level1Scene.prototype.update = function (deltaTime) { if (this.gameState === "PLAYING" || this.gameState === "SUCCESS") { { if (this.paused) return; if (this.x2) deltaTime *= 2; this.protectedTarget.update(deltaTime); Object.values(this.alliances).forEach(function (obj) { return obj.update(deltaTime); }); Object.values(this.enemies).forEach(function (obj) { return obj.update(deltaTime); }); Object.values(this.bullets).forEach(function (obj) { return obj.update(deltaTime); }); this.treePicker.update(deltaTime); if (this.gameState === "PLAYING") { this.commander.update(deltaTime); this.wavesCtrl.update(deltaTime); } } } }; Level1Scene.prototype.success = function () { var _this3 = this; if (this.gameState !== "PLAYING") return; this.x2 = false; this.gameState = "SUCCESS"; this.$resultModal = (0, _FCore._)({ "class": 'as-result-modal', child: { tag: 'img', attr: { src: 'assets/rec_complete.png' } } }).addTo(this.$foreground); setTimeout(function () { if (_this3.$resultModal) _this3.$resultModal.addStyle('opacity', 1); _this3.$resultModal.once('click', function (e) { _this3.win(); }); }, 200); }; Level1Scene.prototype.fail = function () { var _this4 = this; if (this.gameState !== "PLAYING") return; this.x2 = false; this.gameState = "FAIL"; this.$resultModal = (0, _FCore._)({ "class": ['as-result-modal', 'as-fail'], child: { tag: 'img' }, on: {} }).addTo(this.$foreground); this.$result = (0, _FCore._)({ "class": ['as-result-win'], child: [{ tag: 'img', "class": 'as-result-win-bg', attr: { src: 'assets/result_bg.png' } }, { tag: 'button', "class": 'as-img-btn', style: { left: '565px', top: '750px' }, child: { tag: 'img', attr: { src: 'assets/replay_btn.png' } }, on: { click: function click() { _this4.app.startScene(_this4.constructor); } } }, { tag: 'button', "class": 'as-img-btn', style: { left: '1038px', top: '755px' }, child: { tag: 'img', attr: { src: 'assets/home_btn.png' } }, on: { click: function click() { _this4.app.startScene(_MainMenuScene["default"]); } } }, { tag: 'img', "class": 'as-result-win-stars', attr: { src: 'assets/win_3_stars.png' } }, { style: { position: 'absolute', zIndex: 100, top: '588px', left: '510px', fontSize: '122px', color: 'white', fontWeight: 'bold' }, child: { text: "THẤT BẠI" } }] }).addTo(this.$resultModal); setTimeout(function () { if (_this4.$resultModal) _this4.$resultModal.addStyle('opacity', 1); }, 200); }; Level1Scene.prototype.win = function () { var _this5 = this; if (this.gameState !== "SUCCESS") return; this.$resultModal.clearChild(); this.$resultModal.addClass('as-win'); var stars = 3; if (this.protectedTarget.hp / this.initHp < 0.5) { stars = 1; } else if (this.protectedTarget.hp / this.initHp < 0.75) { stars = 2; } this.$result = (0, _FCore._)({ "class": 'as-result-win', child: [{ tag: 'img', "class": 'as-result-win-bg', attr: { src: 'assets/win_bg.png' } }, // { // tag: 'button', // class: 'as-img-btn', // style: { // left: '1300px', // top: '150px' // }, // child: { // tag: 'img', // attr: { // src: 'assets/close_btn.png' // } // } // }, { tag: 'button', "class": 'as-img-btn', style: { left: '420px', top: '755px' }, child: { tag: 'img', attr: { src: 'assets/reset_btn.png' } }, on: { click: function click() { _this5.app.startScene(_this5.constructor); } } }, { tag: 'button', "class": 'as-img-btn', style: { left: '565px', top: '750px' }, child: { tag: 'img', attr: { src: 'assets/resume_btn.png' } }, on: { click: function click() { _this5.app.startScene(_Map1Scene["default"]); } } }, { tag: 'button', "class": 'as-img-btn', style: { left: '1038px', top: '755px' }, child: { tag: 'img', attr: { src: 'assets/home_btn.png' } }, on: { click: function click() { _this5.app.startScene(_MainMenuScene["default"]); } } }, { tag: 'img', "class": 'as-result-win-stars', attr: { src: 'assets/win_' + stars + '_stars.png' } }] }).addTo(this.$resultModal); this.gameState = "WIN"; }; Object.defineProperty(Level1Scene.prototype, 'x2', { set: function set(value) { if (value) { this.$switch.addClass('as-checked'); } else { this.$switch.removeClass('as-checked'); } }, get: function get() { return this.$switch.hasClass('as-checked'); } }); Object.defineProperty(Level1Scene.prototype, 'starCoins', { set: function set(value) { this._starCoins = value; this.$starCoins.firstChild.data = value.toString(); }, get: function get() { return this._starCoins || 0; } }); Object.defineProperty(Level1Scene.prototype, 'paused', { set: function set(value) { this._paused = !!value; if (value) { this.$pauseBtn.firstChild.src = 'assets/play_btn.png'; } else { this.$pauseBtn.firstChild.src = 'assets/pause_btn.png'; } }, get: function get() { return this._paused || false; } }); var _default = exports["default"] = Level1Scene; /***/ }), /***/ 26513: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; __webpack_require__(99724); var Assets = __webpack_require__(80396); var BackgroundLoader = __webpack_require__(51814); var Cache = __webpack_require__(65278); __webpack_require__(61213); var cacheTextureArray = __webpack_require__(62997); var detectAvif = __webpack_require__(33634); var detectDefaults = __webpack_require__(51783); var detectMp4 = __webpack_require__(2675); var detectOgv = __webpack_require__(20180); var detectWebm = __webpack_require__(52371); var detectWebp = __webpack_require__(42264); __webpack_require__(17107); var testImageFormat = __webpack_require__(13714); var testVideoFormat = __webpack_require__(82788); var Loader = __webpack_require__(85898); var LoaderParser = __webpack_require__(96804); var loadJson = __webpack_require__(23962); var loadTxt = __webpack_require__(24778); var loadWebFont = __webpack_require__(43885); var loadSVG = __webpack_require__(10465); var loadTextures = __webpack_require__(7407); var loadVideoTextures = __webpack_require__(7272); var createTexture = __webpack_require__(49698); __webpack_require__(96388); var WorkerManager = __webpack_require__(4480); var resolveJsonUrl = __webpack_require__(20720); var resolveTextureUrl = __webpack_require__(12435); var Resolver = __webpack_require__(54080); __webpack_require__(65269); __webpack_require__(69344); var checkDataUrl = __webpack_require__(36258); var checkExtension = __webpack_require__(59230); var convertToList = __webpack_require__(28097); var copySearchParams = __webpack_require__(16508); var createStringVariations = __webpack_require__(24500); var isSingleItem = __webpack_require__(91208); "use strict"; exports.Assets = Assets.Assets; exports.AssetsClass = Assets.AssetsClass; exports.BackgroundLoader = BackgroundLoader.BackgroundLoader; exports.Cache = Cache.Cache; exports.cacheTextureArray = cacheTextureArray.cacheTextureArray; exports.detectAvif = detectAvif.detectAvif; exports.detectDefaults = detectDefaults.detectDefaults; exports.detectMp4 = detectMp4.detectMp4; exports.detectOgv = detectOgv.detectOgv; exports.detectWebm = detectWebm.detectWebm; exports.detectWebp = detectWebp.detectWebp; exports.testImageFormat = testImageFormat.testImageFormat; exports.testVideoFormat = testVideoFormat.testVideoFormat; exports.Loader = Loader.Loader; exports.LoaderParserPriority = LoaderParser.LoaderParserPriority; exports.loadJson = loadJson.loadJson; exports.loadTxt = loadTxt.loadTxt; exports.getFontFamilyName = loadWebFont.getFontFamilyName; exports.loadWebFont = loadWebFont.loadWebFont; exports.loadSvg = loadSVG.loadSvg; exports.loadImageBitmap = loadTextures.loadImageBitmap; exports.loadTextures = loadTextures.loadTextures; exports.crossOrigin = loadVideoTextures.crossOrigin; exports.determineCrossOrigin = loadVideoTextures.determineCrossOrigin; exports.loadVideoTextures = loadVideoTextures.loadVideoTextures; exports.preloadVideo = loadVideoTextures.preloadVideo; exports.createTexture = createTexture.createTexture; exports.WorkerManager = WorkerManager.WorkerManager; exports.resolveJsonUrl = resolveJsonUrl.resolveJsonUrl; exports.resolveTextureUrl = resolveTextureUrl.resolveTextureUrl; exports.Resolver = Resolver.Resolver; exports.getUrlExtension = Resolver.getUrlExtension; exports.checkDataUrl = checkDataUrl.checkDataUrl; exports.checkExtension = checkExtension.checkExtension; exports.convertToList = convertToList.convertToList; exports.copySearchParams = copySearchParams.copySearchParams; exports.createStringVariations = createStringVariations.createStringVariations; exports.isSingleItem = isSingleItem.isSingleItem; /***/ }), /***/ 27126: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _isMobileJs$default; var isMobileJs = __webpack_require__(40355); "use strict"; var isMobileCall = (_isMobileJs$default = isMobileJs["default"]) !== null && _isMobileJs$default !== void 0 ? _isMobileJs$default : isMobileJs; var isMobile = isMobileCall(globalThis.navigator); exports.isMobile = isMobile; /***/ }), /***/ 27182: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Matrix = __webpack_require__(20764); var matrixAndBoundsPool = __webpack_require__(22727); "use strict"; function getGlobalBounds(target, skipUpdateTransform, bounds) { bounds.clear(); var parentTransform; var pooledMatrix; if (target.parent) { if (!skipUpdateTransform) { pooledMatrix = matrixAndBoundsPool.matrixPool.get().identity(); parentTransform = updateTransformBackwards(target, pooledMatrix); } else { parentTransform = target.parent.worldTransform; } } else { parentTransform = Matrix.Matrix.IDENTITY; } _getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform); if (pooledMatrix) { matrixAndBoundsPool.matrixPool["return"](pooledMatrix); } if (!bounds.isValid) { bounds.set(0, 0, 0, 0); } return bounds; } function _getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform) { if (!target.visible || !target.measurable) return; var worldTransform; if (!skipUpdateTransform) { target.updateLocalTransform(); worldTransform = matrixAndBoundsPool.matrixPool.get(); worldTransform.appendFrom(target.localTransform, parentTransform); } else { worldTransform = target.worldTransform; } var parentBounds = bounds; var preserveBounds = !!target.effects.length; if (preserveBounds) { bounds = matrixAndBoundsPool.boundsPool.get().clear(); } if (target.boundsArea) { bounds.addRect(target.boundsArea, worldTransform); } else { if (target.bounds) { bounds.matrix = worldTransform; bounds.addBounds(target.bounds); } for (var i = 0; i < target.children.length; i++) { _getGlobalBounds(target.children[i], bounds, worldTransform, skipUpdateTransform); } } if (preserveBounds) { for (var _i = 0; _i < target.effects.length; _i++) { var _target$effects$_i$ad, _target$effects$_i; (_target$effects$_i$ad = (_target$effects$_i = target.effects[_i]).addBounds) === null || _target$effects$_i$ad === void 0 || _target$effects$_i$ad.call(_target$effects$_i, bounds); } parentBounds.addBounds(bounds, Matrix.Matrix.IDENTITY); matrixAndBoundsPool.boundsPool["return"](bounds); } if (!skipUpdateTransform) { matrixAndBoundsPool.matrixPool["return"](worldTransform); } } function updateTransformBackwards(target, parentTransform) { var parent = target.parent; if (parent) { updateTransformBackwards(parent, parentTransform); parent.updateLocalTransform(); parentTransform.append(parent.localTransform); } return parentTransform; } exports._getGlobalBounds = _getGlobalBounds; exports.getGlobalBounds = getGlobalBounds; exports.updateTransformBackwards = updateTransformBackwards; /***/ }), /***/ 27244: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var external = __webpack_require__.g.external; var re_msie = /\b(?:msie |ie |trident\/[0-9].*rv[ :])([0-9.]+)/; var re_blackberry_10 = /\bbb10\b.+?\bversion\/([\d.]+)/; var re_blackberry_6_7 = /\bblackberry\b.+\bversion\/([\d.]+)/; var re_blackberry_4_5 = /\bblackberry\d+\/([\d.]+)/; var NA_VERSION = "-1"; var DEVICES = [["nokia", function (ua) { // nokia/-1 if (ua.indexOf("nokia ") !== -1) { return /\bnokia ([0-9]+)?/; } else { return /\bnokia([a-z0-9]+)?/; } }], //Android WP ["samsung", function (ua) { if (ua.indexOf("samsung") !== -1) { return /\bsamsung(?:[ \-](?:sgh|gt|sm))?-([a-z0-9]+)/; } else { return /\b(?:sgh|sch|gt|sm)-([a-z0-9]+)/; } }], ["wp", function (ua) { return ua.indexOf("windows phone ") !== -1 || ua.indexOf("xblwp") !== -1 || ua.indexOf("zunewp") !== -1 || ua.indexOf("windows ce") !== -1; }], ["pc", "windows"], ["ipad", "ipad"], // ipod iphone ["ipod", "ipod"], ["iphone", /\biphone\b|\biph(\d)/], ["mac", "macintosh"], ["mi", /\bmi[ \-]?([a-z0-9 ]+(?= build|\)))/], ["hongmi", /\bhm[ \-]?([a-z0-9]+)/], ["aliyun", /\baliyunos\b(?:[\-](\d+))?/], ["meizu", function (ua) { return ua.indexOf("meizu") >= 0 ? /\bmeizu[\/ ]([a-z0-9]+)\b/ : /\bm([0-9cx]{1,4})\b/; }], ["nexus", /\bnexus ([0-9s.]+)/], ["huawei", function (ua) { var re_mediapad = /\bmediapad (.+?)(?= build\/huaweimediapad\b)/; if (ua.indexOf("huawei-huawei") !== -1) { return /\bhuawei\-huawei\-([a-z0-9\-]+)/; } else if (re_mediapad.test(ua)) { return re_mediapad; } else { return /\bhuawei[ _\-]?([a-z0-9]+)/; } }], ["lenovo", function (ua) { if (ua.indexOf("lenovo-lenovo") !== -1) { return /\blenovo\-lenovo[ \-]([a-z0-9]+)/; } else { return /\blenovo[ \-]?([a-z0-9]+)/; } }], ["zte", function (ua) { if (/\bzte\-[tu]/.test(ua)) { return /\bzte-[tu][ _\-]?([a-su-z0-9\+]+)/; } else { return /\bzte[ _\-]?([a-su-z0-9\+]+)/; } }], ["vivo", /\bvivo(?: ([a-z0-9]+))?/], ["htc", function (ua) { if (/\bhtc[a-z0-9 _\-]+(?= build\b)/.test(ua)) { return /\bhtc[ _\-]?([a-z0-9 ]+(?= build))/; } else { return /\bhtc[ _\-]?([a-z0-9 ]+)/; } }], ["oppo", /\boppo[_ ]([a-z0-9]+)/], ["konka", /\bkonka[_\-]([a-z0-9]+)/], ["sonyericsson", /\bmt([a-z0-9]+)/], ["coolpad", /\bcoolpad[_ ]?([a-z0-9]+)/], ["lg", /\blg[\-]([a-z0-9]+)/], ["android", /\bandroid\b|\badr\b/], ["blackberry", function (ua) { if (ua.indexOf("blackberry") >= 0) { return /\bblackberry\s?(\d+)/; } return "bb10"; }]]; var OS = [["wp", function (ua) { if (ua.indexOf("windows phone ") !== -1) { return /\bwindows phone (?:os )?([0-9.]+)/; } else if (ua.indexOf("xblwp") !== -1) { return /\bxblwp([0-9.]+)/; } else if (ua.indexOf("zunewp") !== -1) { return /\bzunewp([0-9.]+)/; } return "windows phone"; }], ["windows", /\bwindows nt ([0-9.]+)/], ["macosx", /\bmac os x ([0-9._]+)/], ["ios", function (ua) { if (/\bcpu(?: iphone)? os /.test(ua)) { return /\bcpu(?: iphone)? os ([0-9._]+)/; } else if (ua.indexOf("iph os ") !== -1) { return /\biph os ([0-9_]+)/; } else { return /\bios\b/; } }], ["yunos", /\baliyunos ([0-9.]+)/], ["android", function (ua) { if (ua.indexOf("android") >= 0) { return /\bandroid[ \/-]?([0-9.x]+)?/; } else if (ua.indexOf("adr") >= 0) { if (ua.indexOf("mqqbrowser") >= 0) { return /\badr[ ]\(linux; u; ([0-9.]+)?/; } else { return /\badr(?:[ ]([0-9.]+))?/; } } return "android"; //return /\b(?:android|\badr)(?:[\/\- ](?:\(linux; u; )?)?([0-9.x]+)?/; }], ["chromeos", /\bcros i686 ([0-9.]+)/], ["linux", "linux"], ["linux", /\blinux\s(?:[xi][0-9_]+;)\srv:([0-9.]+)/], //Linux x86_64; rv:34.0 ["windowsce", /\bwindows ce(?: ([0-9.]+))?/], ["cros", /\bcros armv7l ([0-9.]+)/], //CrOS armv7l 7077.134.0 ["symbian", /\bsymbian(?:os)?\/([0-9.]+)/], ["blackberry", function (ua) { var m = ua.match(re_blackberry_10) || ua.match(re_blackberry_6_7) || ua.match(re_blackberry_4_5); return m ? { version: m[1] } : "blackberry"; }], ['ie', /\rv\:\/([0-9.]+)/]]; var ENGINE = [["edgehtml", /edge\/([0-9.]+)/], ["trident", re_msie], ["blink", function () { return "chrome" in __webpack_require__.g && "CSS" in __webpack_require__.g && /\bapplewebkit[\/]?([0-9.+]+)/; }], ["webkit", /\bapplewebkit[\/]?([0-9.+]+)/], ["gecko", function (ua) { var match = ua.match(/\brv:([\d\w.]+).*\bgecko\/(\d+)/); if (match) { return { version: match[1] + "." + match[2] }; } }], ["presto", /\bpresto\/([0-9.]+)/], ["androidwebkit", /\bandroidwebkit\/([0-9.]+)/], ["coolpadwebkit", /\bcoolpadwebkit\/([0-9.]+)/], ["u2", /\bu2\/([0-9.]+)/], ["u3", /\bu3\/([0-9.]+)/]]; var BROWSER = [['coccoc', /coc_coc_browser\/([0-9.]+)/], // Microsoft Edge Browser, Default browser in Windows 10. ["edge", /edge\/([0-9.]+)/], ["chrome-edge", /chrome.+edg\/([0-9.]+)/], // Sogou. ["sogou", function (ua) { if (ua.indexOf("sogoumobilebrowser") >= 0) { return /sogoumobilebrowser\/([0-9.]+)/; } else if (ua.indexOf("sogoumse") >= 0) { return true; } return / se ([0-9.x]+)/; }], // Maxthon ["maxthon", function () { try { if (external && (external.mxVersion || external.max_version)) { return { version: external.mxVersion || external.max_version }; } } catch (ex) {/* */} return /\b(?:maxthon|mxbrowser)(?:[ \/]([0-9.]+))?/; }], ["micromessenger", /\bmicromessenger\/([\d.]+)/], ["qq", /\bm?qqbrowser\/([0-9.]+)/], ["green", "greenbrowser"], ["tt", /\btencenttraveler ([0-9.]+)/], ["liebao", function (ua) { if (ua.indexOf("liebaofast") >= 0) { return /\bliebaofast\/([0-9.]+)/; } if (ua.indexOf("lbbrowser") === -1) { return false; } var version; try { if (external && external.LiebaoGetVersion) { version = external.LiebaoGetVersion(); } } catch (ex) {/* */} return { version: version || NA_VERSION }; }], ["tao", /\btaobrowser\/([0-9.]+)/], ["coolnovo", /\bcoolnovo\/([0-9.]+)/], ["saayaa", "saayaa"], ["baidu", /\b(?:ba?idubrowser|baiduhd)[ \/]([0-9.x]+)/], ["ie", re_msie], ["mi", /\bmiuibrowser\/([0-9.]+)/], ["opera", function (ua) { var re_opera_old = /\bopera.+version\/([0-9.ab]+)/; var re_opera_new = /\bopr\/([0-9.]+)/; return re_opera_old.test(ua) ? re_opera_old : re_opera_new; }], ["oupeng", /\boupeng\/([0-9.]+)/], ["yandex", /yabrowser\/([0-9.]+)/], ["ali-ap", function (ua) { if (ua.indexOf("aliapp") > 0) { return /\baliapp\(ap\/([0-9.]+)\)/; } else { return /\balipayclient\/([0-9.]+)\b/; } }], ["ali-ap-pd", /\baliapp\(ap-pd\/([0-9.]+)\)/], ["ali-am", /\baliapp\(am\/([0-9.]+)\)/], ["ali-tb", /\baliapp\(tb\/([0-9.]+)\)/], ["ali-tb-pd", /\baliapp\(tb-pd\/([0-9.]+)\)/], ["ali-tm", /\baliapp\(tm\/([0-9.]+)\)/], ["ali-tm-pd", /\baliapp\(tm-pd\/([0-9.]+)\)/], ["uc", function (ua) { if (ua.indexOf("ucbrowser/") >= 0) { return /\bucbrowser\/([0-9.]+)/; } else if (ua.indexOf("ubrowser/") >= 0) { return /\bubrowser\/([0-9.]+)/; } else if (/\buc\/[0-9]/.test(ua)) { return /\buc\/([0-9.]+)/; } else if (ua.indexOf("ucweb") >= 0) { // `ucweb/2.0` is compony info. // `UCWEB8.7.2.214/145/800` is browser info. return /\bucweb([0-9.]+)?/; } else { return /\b(?:ucbrowser|uc)\b/; } }], ["baiduboxapp", function (ua) { var back = 0; var a; if (/ baiduboxapp\//i.test(ua)) { a = /([\d+.]+)_(?:diordna|enohpi)_/.exec(ua); if (a) { a = a[1].split("."); back = a.reverse().join("."); } else if (a = /baiduboxapp\/([\d+.]+)/.exec(ua)) { back = a[1]; } return { version: back }; } return false; }], ["oppobrowser", /\boppobrowser\/([0-9.]+)/], ["edge-android", / (?:edga)\/([0-9.]+)/], ["chrome", / (?:chrome|crios|crmo)\/([0-9.]+)/], // Android safari ["android", function (ua) { if (ua.indexOf("android") === -1) { return; } return /\bversion\/([0-9.]+(?: beta)?)/; }], ["blackberry", function (ua) { var m = ua.match(re_blackberry_10) || ua.match(re_blackberry_6_7) || ua.match(re_blackberry_4_5); return m ? { version: m[1] } : "blackberry"; }], ["safari", /\bversion\/([0-9.]+(?: beta)?)(?: mobile(?:\/[a-z0-9]+)?)? safari\//], // Safari, WebView ["webview", /\bcpu(?: iphone)? os (?:[0-9._]+).+\bapplewebkit\/([0-9.]+)\b/], ["webview", /os x (?:[0-9._]+).+\bapplewebkit\/([0-9.]+)\b/], ["firefox", /\bfirefox\/([0-9.ab]+)/], ["nokia", /\bnokiabrowser\/([0-9.]+)/]]; module.exports = { device: DEVICES, os: OS, browser: BROWSER, engine: ENGINE, re_msie: re_msie }; /***/ }), /***/ 27265: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var particleData = { vertex: { attributeName: "aVertex", format: "float32x2", code: "\n const texture = p.texture;\n const sx = p.scaleX;\n const sy = p.scaleY;\n const ax = p.anchorX;\n const ay = p.anchorY;\n const trim = texture.trim;\n const orig = texture.orig;\n\n if (trim)\n {\n w1 = trim.x - (ax * orig.width);\n w0 = w1 + trim.width;\n\n h1 = trim.y - (ay * orig.height);\n h0 = h1 + trim.height;\n }\n else\n {\n w1 = -ax * (orig.width);\n w0 = w1 + orig.width;\n\n h1 = -ay * (orig.height);\n h0 = h1 + orig.height;\n }\n\n f32v[offset] = w1 * sx;\n f32v[offset + 1] = h1 * sy;\n\n f32v[offset + stride] = w0 * sx;\n f32v[offset + stride + 1] = h1 * sy;\n\n f32v[offset + (stride * 2)] = w0 * sx;\n f32v[offset + (stride * 2) + 1] = h0 * sy;\n\n f32v[offset + (stride * 3)] = w1 * sx;\n f32v[offset + (stride * 3) + 1] = h0 * sy;\n ", dynamic: false }, // positionData position: { attributeName: "aPosition", format: "float32x2", code: "\n var x = p.x;\n var y = p.y;\n\n f32v[offset] = x;\n f32v[offset + 1] = y;\n\n f32v[offset + stride] = x;\n f32v[offset + stride + 1] = y;\n\n f32v[offset + (stride * 2)] = x;\n f32v[offset + (stride * 2) + 1] = y;\n\n f32v[offset + (stride * 3)] = x;\n f32v[offset + (stride * 3) + 1] = y;\n ", dynamic: true }, // rotationData rotation: { attributeName: "aRotation", format: "float32", code: "\n var rotation = p.rotation;\n\n f32v[offset] = rotation;\n f32v[offset + stride] = rotation;\n f32v[offset + (stride * 2)] = rotation;\n f32v[offset + (stride * 3)] = rotation;\n ", dynamic: false }, // uvsData uvs: { attributeName: "aUV", format: "float32x2", code: "\n var uvs = p.texture.uvs;\n\n f32v[offset] = uvs.x0;\n f32v[offset + 1] = uvs.y0;\n\n f32v[offset + stride] = uvs.x1;\n f32v[offset + stride + 1] = uvs.y1;\n\n f32v[offset + (stride * 2)] = uvs.x2;\n f32v[offset + (stride * 2) + 1] = uvs.y2;\n\n f32v[offset + (stride * 3)] = uvs.x3;\n f32v[offset + (stride * 3) + 1] = uvs.y3;\n ", dynamic: false }, // tintData color: { attributeName: "aColor", format: "unorm8x4", code: "\n const c = p.color;\n\n u32v[offset] = c;\n u32v[offset + stride] = c;\n u32v[offset + (stride * 2)] = c;\n u32v[offset + (stride * 3)] = c;\n ", dynamic: false } }; exports.particleData = particleData; /***/ }), /***/ 27563: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var wgsl = "\nstruct ParticleUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uColor:vec4<f32>,\n uResolution:vec2<f32>,\n uRoundPixels:f32,\n};\n\n@group(0) @binding(0) var<uniform> uniforms: ParticleUniforms;\n\n@group(1) @binding(0) var uTexture: texture_2d<f32>;\n@group(1) @binding(1) var uSampler : sampler;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) color : vec4<f32>,\n };\n@vertex\nfn mainVertex(\n @location(0) aVertex: vec2<f32>,\n @location(1) aPosition: vec2<f32>,\n @location(2) aUV: vec2<f32>,\n @location(3) aColor: vec4<f32>,\n @location(4) aRotation: f32,\n) -> VSOutput {\n \n let v = vec2(\n aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation),\n aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation)\n ) + aPosition;\n\n let position = vec4((uniforms.uProjectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor;\n\n return VSOutput(\n position,\n aUV,\n vColor,\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) color: vec4<f32>,\n @builtin(position) position: vec4<f32>,\n) -> @location(0) vec4<f32> {\n\n var sample = textureSample(uTexture, uSampler, uv) * color;\n \n return sample;\n}"; exports["default"] = wgsl; /***/ }), /***/ 27615: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _excluded = ["texture", "anchor", "roundPixels", "width", "height"]; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var ObservablePoint = __webpack_require__(14823); var Texture = __webpack_require__(73782); var updateQuadBounds = __webpack_require__(28275); var deprecation = __webpack_require__(11225); var ViewContainer = __webpack_require__(23804); "use strict"; var Sprite = /*#__PURE__*/function (_ViewContainer$ViewCo) { /** * @param options - The options for creating the sprite. */ function Sprite() { var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Texture.Texture.EMPTY; _classCallCheck(this, Sprite); if (options instanceof Texture.Texture) { options = { texture: options }; } var _options = options, _options$texture = _options.texture, texture = _options$texture === void 0 ? Texture.Texture.EMPTY : _options$texture, anchor = _options.anchor, roundPixels = _options.roundPixels, width = _options.width, height = _options.height, rest = _objectWithoutProperties(_options, _excluded); _this = _callSuper(this, Sprite, [_objectSpread({ label: "Sprite" }, rest)]); _this.renderPipeId = "sprite"; _this.batched = true; _this._visualBounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 }; _this._anchor = new ObservablePoint.ObservablePoint({ _onUpdate: function _onUpdate() { _this.onViewUpdate(); } }); if (anchor) { _this.anchor = anchor; } else if (texture.defaultAnchor) { _this.anchor = texture.defaultAnchor; } _this.texture = texture; _this.allowChildren = false; _this.roundPixels = roundPixels !== null && roundPixels !== void 0 ? roundPixels : false; if (width !== void 0) _this.width = width; if (height !== void 0) _this.height = height; return _this; } /** * Helper function that creates a new sprite based on the source you provide. * The source can be - frame id, image, video, canvas element, video element, texture * @param source - Source to create texture from * @param [skipCache] - Whether to skip the cache or not * @returns The newly created sprite */ _inherits(Sprite, _ViewContainer$ViewCo); return _createClass(Sprite, [{ key: "texture", get: /** The texture that the sprite is using. */ function get() { return this._texture; } /** * The bounds of the sprite, taking the texture's trim into account. * @type {rendering.Bounds} */, set: function set(value) { value || (value = Texture.Texture.EMPTY); var currentTexture = this._texture; if (currentTexture === value) return; if (currentTexture && currentTexture.dynamic) currentTexture.off("update", this.onViewUpdate, this); if (value.dynamic) value.on("update", this.onViewUpdate, this); this._texture = value; if (this._width) { this._setWidth(this._width, this._texture.orig.width); } if (this._height) { this._setHeight(this._height, this._texture.orig.height); } this.onViewUpdate(); } }, { key: "visualBounds", get: function get() { updateQuadBounds.updateQuadBounds(this._visualBounds, this._anchor, this._texture); return this._visualBounds; } /** * @deprecated */ }, { key: "sourceBounds", get: function get() { deprecation.deprecation("8.6.1", "Sprite.sourceBounds is deprecated, use visualBounds instead."); return this.visualBounds; } /** @private */ }, { key: "updateBounds", value: function updateBounds() { var anchor = this._anchor; var texture = this._texture; var bounds = this._bounds; var _texture$orig = texture.orig, width = _texture$orig.width, height = _texture$orig.height; bounds.minX = -anchor._x * width; bounds.maxX = bounds.minX + width; bounds.minY = -anchor._y * height; bounds.maxY = bounds.minY + height; } /** * Destroys this sprite renderable and optionally its texture. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the current texture of the renderable as well * @param {boolean} [options.textureSource=false] - Should it destroy the textureSource of the renderable as well */ }, { key: "destroy", value: function destroy() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; _superPropGet(Sprite, "destroy", this, 3)([options]); var destroyTexture = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.texture; if (destroyTexture) { var destroyTextureSource = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.textureSource; this._texture.destroy(destroyTextureSource); } this._texture = null; this._visualBounds = null; this._bounds = null; this._anchor = null; } /** * The anchor sets the origin point of the sprite. The default value is taken from the {@link Texture} * and passed to the constructor. * * The default is `(0,0)`, this means the sprite's origin is the top left. * * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered. * * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner. * * If you pass only single parameter, it will set both x and y to the same value as shown in the example below. * @example * import { Sprite } from 'pixi.js'; * * const sprite = new Sprite({texture: Texture.WHITE}); * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5). */ }, { key: "anchor", get: function get() { return this._anchor; }, set: function set(value) { typeof value === "number" ? this._anchor.set(value) : this._anchor.copyFrom(value); } /** The width of the sprite, setting this will actually modify the scale to achieve the value set. */ }, { key: "width", get: function get() { return Math.abs(this.scale.x) * this._texture.orig.width; }, set: function set(value) { this._setWidth(value, this._texture.orig.width); this._width = value; } /** The height of the sprite, setting this will actually modify the scale to achieve the value set. */ }, { key: "height", get: function get() { return Math.abs(this.scale.y) * this._texture.orig.height; }, set: function set(value) { this._setHeight(value, this._texture.orig.height); this._height = value; } /** * Retrieves the size of the Sprite as a [Size]{@link Size} object. * This is faster than get the width and height separately. * @param out - Optional object to store the size in. * @returns - The size of the Sprite. */ }, { key: "getSize", value: function getSize(out) { out || (out = {}); out.width = Math.abs(this.scale.x) * this._texture.orig.width; out.height = Math.abs(this.scale.y) * this._texture.orig.height; return out; } /** * Sets the size of the Sprite to the specified width and height. * This is faster than setting the width and height separately. * @param value - This can be either a number or a [Size]{@link Size} object. * @param height - The height to set. Defaults to the value of `width` if not provided. */ }, { key: "setSize", value: function setSize(value, height) { if (_typeof(value) === "object") { var _value$height; height = (_value$height = value.height) !== null && _value$height !== void 0 ? _value$height : value.width; value = value.width; } else { height !== null && height !== void 0 ? height : height = value; } value !== void 0 && this._setWidth(value, this._texture.orig.width); height !== void 0 && this._setHeight(height, this._texture.orig.height); } }], [{ key: "from", value: function from(source) { var skipCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (source instanceof Texture.Texture) { return new Sprite(source); } return new Sprite(Texture.Texture.from(source, skipCache)); } }]); }(ViewContainer.ViewContainer); exports.Sprite = Sprite; /***/ }), /***/ 27628: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var ResizePlugin = /*#__PURE__*/function () { function ResizePlugin() { _classCallCheck(this, ResizePlugin); } return _createClass(ResizePlugin, null, [{ key: "init", value: /** * Initialize the plugin with scope of application instance * @static * @private * @param {object} [options] - See application options */ function init(options) { var _this = this; Object.defineProperty(this, "resizeTo", /** * The HTML element or window to automatically resize the * renderer's view element to match width and height. * @member {Window|HTMLElement} * @name resizeTo * @memberof app.Application# */ { set: function set(dom) { globalThis.removeEventListener("resize", this.queueResize); this._resizeTo = dom; if (dom) { globalThis.addEventListener("resize", this.queueResize); this.resize(); } }, get: function get() { return this._resizeTo; } }); this.queueResize = function () { if (!_this._resizeTo) { return; } _this._cancelResize(); _this._resizeId = requestAnimationFrame(function () { return _this.resize(); }); }; this._cancelResize = function () { if (_this._resizeId) { cancelAnimationFrame(_this._resizeId); _this._resizeId = null; } }; this.resize = function () { if (!_this._resizeTo) { return; } _this._cancelResize(); var width; var height; if (_this._resizeTo === globalThis.window) { width = globalThis.innerWidth; height = globalThis.innerHeight; } else { var _this$_resizeTo = _this._resizeTo, clientWidth = _this$_resizeTo.clientWidth, clientHeight = _this$_resizeTo.clientHeight; width = clientWidth; height = clientHeight; } _this.renderer.resize(width, height); _this.render(); }; this._resizeId = null; this._resizeTo = null; this.resizeTo = options.resizeTo || null; } /** * Clean up the ticker, scoped to application * @static * @private */ }, { key: "destroy", value: function destroy() { globalThis.removeEventListener("resize", this.queueResize); this._cancelResize(); this._cancelResize = null; this.queueResize = null; this.resizeTo = null; this.resize = null; } }]); }(); /** @ignore */ ResizePlugin.extension = Extensions.ExtensionType.Application; exports.ResizePlugin = ResizePlugin; /***/ }), /***/ 27847: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.arrayCompare = arrayCompare; exports.arrayIntersection = arrayIntersection; exports.arrayIsSubset = arrayIsSubset; exports.arrayLexicographicalCompare = arrayLexicographicalCompare; exports.arrayRemoveNone = arrayRemoveNone; exports.arrayShuffle = arrayShuffle; exports.arrayUnique = arrayUnique; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /*** * * @param {(string|number|boolean|null)[]} arr * @returns {(string|number|boolean|null)[]} */ function arrayUnique(arr) { var dict = {}; return arr.reduce(function (ac, cr) { var key = _typeof(cr) + '//' + cr; if (key in dict) return ac; ac.push(cr); dict[key] = true; return ac; }, []); } /*** * * @param {[]}arr * @return {[]} */ function arrayRemoveNone(arr) { return arr.filter(function (c) { return c !== null && c !== undefined; }); } function arrayIntersection(a1, a2) { var dict1 = a1.reduce(function (ac, cr) { ac[_typeof(cr) + cr] = true; return ac; }, {}); var dict2 = a2.reduce(function (ac, cr) { ac[_typeof(cr) + cr] = true; return ac; }, {}); var dictAdded = {}; var res = []; var i, k, x; for (i = 0; i < a1.length; ++i) { x = a1[i]; k = _typeof(x) + x; if (dict1[k] && dict2[k] && !dictAdded[k]) { res.push(x); dictAdded[k] = true; } } for (i = 0; i < a2.length; ++i) { x = a2[i]; k = _typeof(x) + x; if (dict1[k] && dict2[k] && !dictAdded[k]) { res.push(x); dictAdded[k] = true; } } return res; } function arrayIsSubset(childArr, parentArr) { if (!(childArr instanceof Array) || !(parentArr instanceof Array)) return false; var dict2 = parentArr.reduce(function (ac, cr) { ac[_typeof(cr) + cr] = true; return ac; }, {}); var res = true; var n = childArr.length; var k; for (var i = 0; i < n; ++i) { k = _typeof(childArr[i]) + childArr[i]; if (!dict2[k]) { res = false; break; } } return res; } /*** * * @param {[]}a1 * @param {[]}a2 * @param {boolean=} order * @returns {boolean} */ function arrayCompare(a1, a2, order) { if (a1 === a2) return true; if (!a1 || !a2) return false; if (a1.length !== a2.length) return false; if (!a1.sort || !a2.sort) return false; if (!order) { a1.sort(); a2.sort(); } var n = a1.length; for (var i = 0; i < n; ++i) { if (a1[i] !== a2[i]) return false; } return true; } /** * * @param {number[]} a1 * @param {number[]} a2 * @returns {number} */ function arrayLexicographicalCompare(a1, a2) { var minLength = Math.min(a1.length, a2.length); for (var i = 0; i < minLength; i++) { if (a1[i] < a2[i]) { return -1; // array1 nhỏ hơn array2 } else if (a1[i] > a2[i]) { return 1; // array1 lớn hơn array2 } } if (a1.length < a2.length) { return -1; } else if (a1.length > a2.length) { return 1; } else { return 0; } } /*** * * @param {Array} arr */ function arrayShuffle(arr) { var temp; var j; for (var i = 0; i < arr.length; ++i) { j = Math.floor(Math.random() * arr.length); if (i !== j) { temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } } } /***/ }), /***/ 27866: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["gpu", "gl"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var GlProgram = __webpack_require__(23896); var BindGroup = __webpack_require__(85156); var GpuProgram = __webpack_require__(57974); var types = __webpack_require__(9634); var UniformGroup = __webpack_require__(34400); var uid = __webpack_require__(90844); "use strict"; var Shader = /*#__PURE__*/function (_EventEmitter) { function Shader(options) { var _this; _classCallCheck(this, Shader); _this = _callSuper(this, Shader); /** A unique identifier for the shader */ _this.uid = uid.uid("shader"); /** * A record of the uniform groups and resources used by the shader. * This is used by WebGL renderer to sync uniform data. * @internal * @ignore */ _this._uniformBindMap = /* @__PURE__ */Object.create(null); _this._ownedBindGroups = []; var gpuProgram = options.gpuProgram, glProgram = options.glProgram, groups = options.groups, resources = options.resources, compatibleRenderers = options.compatibleRenderers, groupMap = options.groupMap; _this.gpuProgram = gpuProgram; _this.glProgram = glProgram; if (compatibleRenderers === void 0) { compatibleRenderers = 0; if (gpuProgram) compatibleRenderers |= types.RendererType.WEBGPU; if (glProgram) compatibleRenderers |= types.RendererType.WEBGL; } _this.compatibleRenderers = compatibleRenderers; var nameHash = {}; if (!resources && !groups) { resources = {}; } if (resources && groups) { throw new Error("[Shader] Cannot have both resources and groups"); } else if (!gpuProgram && groups && !groupMap) { throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead."); } else if (!gpuProgram && groups && groupMap) { for (var i in groupMap) { for (var j in groupMap[i]) { var uniformName = groupMap[i][j]; nameHash[uniformName] = { group: i, binding: j, name: uniformName }; } } } else if (gpuProgram && groups && !groupMap) { var groupData = gpuProgram.structsAndGroups.groups; groupMap = {}; groupData.forEach(function (data) { groupMap[data.group] = groupMap[data.group] || {}; groupMap[data.group][data.binding] = data.name; nameHash[data.name] = data; }); } else if (resources) { groups = {}; groupMap = {}; if (gpuProgram) { var _groupData = gpuProgram.structsAndGroups.groups; _groupData.forEach(function (data) { groupMap[data.group] = groupMap[data.group] || {}; groupMap[data.group][data.binding] = data.name; nameHash[data.name] = data; }); } var bindTick = 0; for (var _i in resources) { if (nameHash[_i]) continue; if (!groups[99]) { groups[99] = new BindGroup.BindGroup(); _this._ownedBindGroups.push(groups[99]); } nameHash[_i] = { group: 99, binding: bindTick, name: _i }; groupMap[99] = groupMap[99] || {}; groupMap[99][bindTick] = _i; bindTick++; } for (var _i2 in resources) { var name = _i2; var value = resources[_i2]; if (!value.source && !value._resourceType) { value = new UniformGroup.UniformGroup(value); } var data = nameHash[name]; if (data) { if (!groups[data.group]) { groups[data.group] = new BindGroup.BindGroup(); _this._ownedBindGroups.push(groups[data.group]); } groups[data.group].setResource(value, data.binding); } } } _this.groups = groups; _this._uniformBindMap = groupMap; _this.resources = _this._buildResourceAccessor(groups, nameHash); return _this; } /** * Sometimes a resource group will be provided later (for example global uniforms) * In such cases, this method can be used to let the shader know about the group. * @param name - the name of the resource group * @param groupIndex - the index of the group (should match the webGPU shader group location) * @param bindIndex - the index of the bind point (should match the webGPU shader bind point) */ _inherits(Shader, _EventEmitter); return _createClass(Shader, [{ key: "addResource", value: function addResource(name, groupIndex, bindIndex) { var _a, _b; (_a = this._uniformBindMap)[groupIndex] || (_a[groupIndex] = {}); (_b = this._uniformBindMap[groupIndex])[bindIndex] || (_b[bindIndex] = name); if (!this.groups[groupIndex]) { this.groups[groupIndex] = new BindGroup.BindGroup(); this._ownedBindGroups.push(this.groups[groupIndex]); } } }, { key: "_buildResourceAccessor", value: function _buildResourceAccessor(groups, nameHash) { var uniformsOut = {}; var _loop = function _loop() { var data = nameHash[i]; Object.defineProperty(uniformsOut, data.name, { get: function get() { return groups[data.group].getResource(data.binding); }, set: function set(value) { groups[data.group].setResource(value, data.binding); } }); }; for (var i in nameHash) { _loop(); } return uniformsOut; } /** * Use to destroy the shader when its not longer needed. * It will destroy the resources and remove listeners. * @param destroyPrograms - if the programs should be destroyed as well. * Make sure its not being used by other shaders! */ }, { key: "destroy", value: function destroy() { var destroyPrograms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this.emit("destroy", this); if (destroyPrograms) { var _this$gpuProgram, _this$glProgram; (_this$gpuProgram = this.gpuProgram) === null || _this$gpuProgram === void 0 || _this$gpuProgram.destroy(); (_this$glProgram = this.glProgram) === null || _this$glProgram === void 0 || _this$glProgram.destroy(); } this.gpuProgram = null; this.glProgram = null; this.removeAllListeners(); this._uniformBindMap = null; this._ownedBindGroups.forEach(function (bindGroup) { bindGroup.destroy(); }); this._ownedBindGroups = null; this.resources = null; this.groups = null; } }], [{ key: "from", value: function from(options) { var gpu = options.gpu, gl = options.gl, rest = _objectWithoutProperties(options, _excluded); var gpuProgram; var glProgram; if (gpu) { gpuProgram = GpuProgram.GpuProgram.from(gpu); } if (gl) { glProgram = GlProgram.GlProgram.from(gl); } return new Shader(_objectSpread({ gpuProgram: gpuProgram, glProgram: glProgram }, rest)); } }]); }(EventEmitter); exports.Shader = Shader; /***/ }), /***/ 28010: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var _const$1 = __webpack_require__(63548); var _const = __webpack_require__(15068); "use strict"; var StencilMaskPipe = /*#__PURE__*/function () { function StencilMaskPipe(renderer) { _classCallCheck(this, StencilMaskPipe); // used when building and also when executing.. this._maskStackHash = {}; this._maskHash = /* @__PURE__ */new WeakMap(); this._renderer = renderer; } return _createClass(StencilMaskPipe, [{ key: "push", value: function push(mask, _container, instructionSet) { var _a$renderTargetUid; var _a; var effect = mask; var renderer = this._renderer; renderer.renderPipes.batch["break"](instructionSet); renderer.renderPipes.blendMode.setBlendMode(effect.mask, "none", instructionSet); instructionSet.add({ renderPipeId: "stencilMask", action: "pushMaskBegin", mask: mask, inverse: _container._maskOptions.inverse, canBundle: false }); var maskContainer = effect.mask; maskContainer.includeInBuild = true; if (!this._maskHash.has(effect)) { this._maskHash.set(effect, { instructionsStart: 0, instructionsLength: 0 }); } var maskData = this._maskHash.get(effect); maskData.instructionsStart = instructionSet.instructionSize; maskContainer.collectRenderables(instructionSet, renderer, null); maskContainer.includeInBuild = false; renderer.renderPipes.batch["break"](instructionSet); instructionSet.add({ renderPipeId: "stencilMask", action: "pushMaskEnd", mask: mask, inverse: _container._maskOptions.inverse, canBundle: false }); var instructionsLength = instructionSet.instructionSize - maskData.instructionsStart - 1; maskData.instructionsLength = instructionsLength; var renderTargetUid = renderer.renderTarget.renderTarget.uid; (_a$renderTargetUid = (_a = this._maskStackHash)[renderTargetUid]) !== null && _a$renderTargetUid !== void 0 ? _a$renderTargetUid : _a[renderTargetUid] = 0; } }, { key: "pop", value: function pop(mask, _container, instructionSet) { var effect = mask; var renderer = this._renderer; renderer.renderPipes.batch["break"](instructionSet); renderer.renderPipes.blendMode.setBlendMode(effect.mask, "none", instructionSet); instructionSet.add({ renderPipeId: "stencilMask", action: "popMaskBegin", inverse: _container._maskOptions.inverse, canBundle: false }); var maskData = this._maskHash.get(mask); for (var i = 0; i < maskData.instructionsLength; i++) { instructionSet.instructions[instructionSet.instructionSize++] = instructionSet.instructions[maskData.instructionsStart++]; } instructionSet.add({ renderPipeId: "stencilMask", action: "popMaskEnd", canBundle: false }); } }, { key: "execute", value: function execute(instruction) { var _a$renderTargetUid2; var _a; var renderer = this._renderer; var renderTargetUid = renderer.renderTarget.renderTarget.uid; var maskStackIndex = (_a$renderTargetUid2 = (_a = this._maskStackHash)[renderTargetUid]) !== null && _a$renderTargetUid2 !== void 0 ? _a$renderTargetUid2 : _a[renderTargetUid] = 0; if (instruction.action === "pushMaskBegin") { renderer.renderTarget.ensureDepthStencil(); renderer.stencil.setStencilMode(_const.STENCIL_MODES.RENDERING_MASK_ADD, maskStackIndex); maskStackIndex++; renderer.colorMask.setMask(0); } else if (instruction.action === "pushMaskEnd") { if (instruction.inverse) { renderer.stencil.setStencilMode(_const.STENCIL_MODES.INVERSE_MASK_ACTIVE, maskStackIndex); } else { renderer.stencil.setStencilMode(_const.STENCIL_MODES.MASK_ACTIVE, maskStackIndex); } renderer.colorMask.setMask(15); } else if (instruction.action === "popMaskBegin") { renderer.colorMask.setMask(0); if (maskStackIndex !== 0) { renderer.stencil.setStencilMode(_const.STENCIL_MODES.RENDERING_MASK_REMOVE, maskStackIndex); } else { renderer.renderTarget.clear(null, _const$1.CLEAR.STENCIL); renderer.stencil.setStencilMode(_const.STENCIL_MODES.DISABLED, maskStackIndex); } maskStackIndex--; } else if (instruction.action === "popMaskEnd") { if (instruction.inverse) { renderer.stencil.setStencilMode(_const.STENCIL_MODES.INVERSE_MASK_ACTIVE, maskStackIndex); } else { renderer.stencil.setStencilMode(_const.STENCIL_MODES.MASK_ACTIVE, maskStackIndex); } renderer.colorMask.setMask(15); } this._maskStackHash[renderTargetUid] = maskStackIndex; } }, { key: "destroy", value: function destroy() { this._renderer = null; this._maskStackHash = null; this._maskHash = null; } }]); }(); StencilMaskPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "stencilMask" }; exports.StencilMaskPipe = StencilMaskPipe; /***/ }), /***/ 28085: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function validateRenderables(renderGroup, renderPipes) { var _renderGroup$children = renderGroup.childrenRenderablesToUpdate, list = _renderGroup$children.list, index = _renderGroup$children.index; var rebuildRequired = false; for (var i = 0; i < index; i++) { var container = list[i]; var renderable = container; var pipe = renderPipes[renderable.renderPipeId]; rebuildRequired = pipe.validateRenderable(container); if (rebuildRequired) { break; } } renderGroup.structureDidChange = rebuildRequired; return rebuildRequired; } exports.validateRenderables = validateRenderables; /***/ }), /***/ 28097: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var convertToList = function convertToList(input, transform) { var forceTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (!Array.isArray(input)) { input = [input]; } if (!transform) { return input; } return input.map(function (item) { if (typeof item === "string" || forceTransform) { return transform(item); } return item; }); }; exports.convertToList = convertToList; /***/ }), /***/ 28239: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; /*** * * @param {Number} x * @param {Number} y * @constructor */ function Vec2(x, y) { this.x = x; this.y = y; } /*** * * @returns {Vec2} */ Vec2.prototype.copy = function () { return new Vec2(this.x, this.y); }; /*** * * @returns {string} */ Vec2.prototype.toString = function () { return "(" + this.x + ", " + this.y + ")"; }; /*** * * @returns {number} */ Vec2.prototype.abs = function () { return Math.sqrt(this.x * this.x + this.y * this.y); }; /*** * * @returns {Vec2} */ Vec2.prototype.normalized = function () { var l = this.abs(); if (l == 0) l = 1; return this.div(l); }; /*** * * @param {number} h * @returns {Vec2} */ Vec2.prototype.mult = function (h) { return new Vec2(this.x * h, this.y * h); }; /*** * * @param {number} h * @returns {Vec2} */ Vec2.prototype.div = function (h) { return new Vec2(this.x / h, this.y / h); }; /*** * * @param v * @returns {number} */ Vec2.prototype.dist = function (v) { var dx = v.x - this.x; var dy = v.y - this.y; return Math.sqrt(dx * dx + dy * dy); }; /*** * * @param {Vec2} v * @returns {Vec2} */ Vec2.prototype.sub = function (v) { return new Vec2(this.x - v.x, this.y - v.y); }; /*** * * @param {Vec2} v * @returns {Vec2} */ Vec2.prototype.add = function (v) { return new Vec2(this.x + v.x, this.y + v.y); }; /*** * * @returns {Vec2} */ Vec2.prototype.inv = function () { return new Vec2(-this.x, -this.y); }; /*** * * @param {Vec2} v * @param {number} h * @returns {Vec2} */ Vec2.prototype.linear = function (v, h) { return new Vec2(this.x * (1 - h) + v.x * h, this.y * (1 - h) + v.y * h); }; /*** * * @param {Vec2} v1 * @returns {number} */ Vec2.prototype.dot = function (v1) { return this.x * v1.x + this.y * v1.y; }; /*** * * @param {Vec2} v1 * @returns {number} */ Vec2.prototype.cross = function (v1) { return this.x * v1.y - this.y * v1.x; }; /*** * * @returns {number} */ Vec2.prototype.direction = function () { return Math.atan2(this.y, this.x); }; /*** * * @param {Number} dx * @param {Number} dy */ Vec2.prototype.translate = function (dx, dy) { return this.add(new Vec2(dx, dy)); }; /**** * * @param {Number} angle - radian * @returns {Vec2} */ Vec2.prototype.rotate = function (angle) { var sinA = Math.sin(angle); var cosA = Math.cos(angle); var x = this.x * cosA - this.y * sinA; var y = this.x * sinA + this.y * cosA; return new Vec2(x, y); }; /*** * * @returns {Vec2} */ Vec2.prototype.rotate90 = function () { return new Vec2(-this.y, this.x); }; /*** * * @param {Vec2} b */ Vec2.prototype.equals = function (b) { return b && this.x === b.x && this.y === b.y; }; /*** * * @param {number} angle * @returns {Vec2} */ Vec2.fromDirection = function (angle) { return new Vec2(Math.cos(angle), Math.sin(angle)); }; /*** * * @param x * @param y * @returns {Vec2} */ Vec2.make = function (x, y) { if (x instanceof Array) { return new Vec2(x[0], x[1]); } else if (x instanceof Vec2) { return x.copy(); } else return new Vec2(x, y); }; Vec2.ZERO = new Vec2(0, 0); Vec2.OX = new Vec2(1, 0); Vec2.OY = new Vec2(0, 1); var _default = exports["default"] = Vec2; /***/ }), /***/ 28275: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function updateQuadBounds(bounds, anchor, texture) { var _texture$orig = texture.orig, width = _texture$orig.width, height = _texture$orig.height; var trim = texture.trim; if (trim) { var sourceWidth = trim.width; var sourceHeight = trim.height; bounds.minX = trim.x - anchor._x * width; bounds.maxX = bounds.minX + sourceWidth; bounds.minY = trim.y - anchor._y * height; bounds.maxY = bounds.minY + sourceHeight; } else { bounds.minX = -anchor._x * width; bounds.maxX = bounds.minX + width; bounds.minY = -anchor._y * height; bounds.maxY = bounds.minY + height; } } exports.updateQuadBounds = updateQuadBounds; /***/ }), /***/ 28464: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var AlphaMask = __webpack_require__(28662); var ColorMask = __webpack_require__(37078); var StencilMask = __webpack_require__(13798); var BufferImageSource = __webpack_require__(56634); var CanvasSource = __webpack_require__(35879); var ImageSource = __webpack_require__(80344); var VideoSource = __webpack_require__(19782); __webpack_require__(42268); __webpack_require__(47281); "use strict"; Extensions.extensions.add(AlphaMask.AlphaMask, ColorMask.ColorMask, StencilMask.StencilMask, VideoSource.VideoSource, ImageSource.ImageSource, CanvasSource.CanvasSource, BufferImageSource.BufferImageSource); /***/ }), /***/ 28488: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var _const = __webpack_require__(22718); "use strict"; var ApplicationInitHook = /*#__PURE__*/function () { function ApplicationInitHook() { _classCallCheck(this, ApplicationInitHook); } return _createClass(ApplicationInitHook, null, [{ key: "init", value: function init() { var _globalThis$__PIXI_AP; (_globalThis$__PIXI_AP = globalThis.__PIXI_APP_INIT__) === null || _globalThis$__PIXI_AP === void 0 || _globalThis$__PIXI_AP.call(globalThis, this, _const.VERSION); } }, { key: "destroy", value: function destroy() {} }]); }(); /** @ignore */ ApplicationInitHook.extension = Extensions.ExtensionType.Application; var RendererInitHook = /*#__PURE__*/function () { function RendererInitHook(renderer) { _classCallCheck(this, RendererInitHook); this._renderer = renderer; } return _createClass(RendererInitHook, [{ key: "init", value: function init() { var _globalThis$__PIXI_RE; (_globalThis$__PIXI_RE = globalThis.__PIXI_RENDERER_INIT__) === null || _globalThis$__PIXI_RE === void 0 || _globalThis$__PIXI_RE.call(globalThis, this._renderer, _const.VERSION); } }, { key: "destroy", value: function destroy() { this._renderer = null; } }]); }(); /** @ignore */ RendererInitHook.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem], name: "initHook", priority: -10 }; exports.ApplicationInitHook = ApplicationInitHook; exports.RendererInitHook = RendererInitHook; /***/ }), /***/ 28595: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var gpuUploadImageSource = __webpack_require__(37493); "use strict"; var gpuUploadVideoResource = { type: "video", upload: function upload(source, gpuTexture, gpu) { gpuUploadImageSource.gpuUploadImageResource.upload(source, gpuTexture, gpu); } }; exports.gpuUploadVideoResource = gpuUploadVideoResource; /***/ }), /***/ 28662: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Sprite = __webpack_require__(27615); var addMaskBounds = __webpack_require__(30597); var addMaskLocalBounds = __webpack_require__(82132); "use strict"; var AlphaMask = /*#__PURE__*/function () { function AlphaMask(options) { _classCallCheck(this, AlphaMask); this.priority = 0; this.inverse = false; this.pipe = "alphaMask"; if (options !== null && options !== void 0 && options.mask) { this.init(options.mask); } } return _createClass(AlphaMask, [{ key: "init", value: function init(mask) { this.mask = mask; this.renderMaskToTexture = !(mask instanceof Sprite.Sprite); this.mask.renderable = this.renderMaskToTexture; this.mask.includeInBuild = !this.renderMaskToTexture; this.mask.measurable = false; } }, { key: "reset", value: function reset() { this.mask.measurable = true; this.mask = null; } }, { key: "addBounds", value: function addBounds(bounds, skipUpdateTransform) { if (!this.inverse) { addMaskBounds.addMaskBounds(this.mask, bounds, skipUpdateTransform); } } }, { key: "addLocalBounds", value: function addLocalBounds(bounds, localRoot) { addMaskLocalBounds.addMaskLocalBounds(this.mask, bounds, localRoot); } }, { key: "containsPoint", value: function containsPoint(point, hitTestFn) { var mask = this.mask; return hitTestFn(mask, point); } }, { key: "destroy", value: function destroy() { this.reset(); } }], [{ key: "test", value: function test(mask) { return mask instanceof Sprite.Sprite; } }]); }(); AlphaMask.extension = Extensions.ExtensionType.MaskEffect; exports.AlphaMask = AlphaMask; /***/ }), /***/ 29501: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var promise; function detectVideoAlphaMode() { return _detectVideoAlphaMode.apply(this, arguments); } function _detectVideoAlphaMode() { _detectVideoAlphaMode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: promise !== null && promise !== void 0 ? promise : promise = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var _gl$getExtension; var canvas, gl, video, texture, framebuffer, pixel; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: canvas = document.createElement("canvas"); gl = canvas.getContext("webgl"); if (gl) { _context.n = 1; break; } return _context.a(2, "premultiply-alpha-on-upload"); case 1: _context.n = 2; return new Promise(function (resolve) { var video2 = document.createElement("video"); video2.onloadeddata = function () { return resolve(video2); }; video2.onerror = function () { return resolve(null); }; video2.autoplay = false; video2.crossOrigin = "anonymous"; video2.preload = "auto"; video2.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM="; video2.load(); }); case 2: video = _context.v; if (video) { _context.n = 3; break; } return _context.a(2, "premultiply-alpha-on-upload"); case 3: texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); framebuffer = gl.createFramebuffer(); gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video); pixel = new Uint8Array(4); gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); gl.deleteFramebuffer(framebuffer); gl.deleteTexture(texture); (_gl$getExtension = gl.getExtension("WEBGL_lose_context")) === null || _gl$getExtension === void 0 || _gl$getExtension.loseContext(); return _context.a(2, pixel[0] <= pixel[3] ? "premultiplied-alpha" : "premultiply-alpha-on-upload"); } }, _callee); }))(); return _context2.a(2, promise); } }, _callee2); })); return _detectVideoAlphaMode.apply(this, arguments); } exports.detectVideoAlphaMode = detectVideoAlphaMode; /***/ }), /***/ 29943: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 29977: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var ktx_worker = __webpack_require__(5229); var setKTXTranscoderPath = __webpack_require__(74977); "use strict"; var ktxWorker; var urlHash = {}; function getKTX2Worker(supportedTextures) { if (!ktxWorker) { ktxWorker = new ktx_worker["default"]().worker; ktxWorker.onmessage = function (messageEvent) { var _messageEvent$data = messageEvent.data, success = _messageEvent$data.success, url = _messageEvent$data.url, textureOptions = _messageEvent$data.textureOptions; if (!success) { console.warn("Failed to load KTX texture", url); } urlHash[url](textureOptions); }; ktxWorker.postMessage({ type: "init", jsUrl: setKTXTranscoderPath.ktxTranscoderUrls.jsUrl, wasmUrl: setKTXTranscoderPath.ktxTranscoderUrls.wasmUrl, supportedTextures: supportedTextures }); } return ktxWorker; } function loadKTX2onWorker(url, supportedTextures) { var ktxWorker2 = getKTX2Worker(supportedTextures); return new Promise(function (resolve) { urlHash[url] = resolve; ktxWorker2.postMessage({ type: "load", url: url }); }); } exports.loadKTX2onWorker = loadKTX2onWorker; /***/ }), /***/ 30008: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var WGSL_ALIGN_SIZE_DATA = { i32: { align: 4, size: 4 }, u32: { align: 4, size: 4 }, f32: { align: 4, size: 4 }, f16: { align: 2, size: 2 }, "vec2<i32>": { align: 8, size: 8 }, "vec2<u32>": { align: 8, size: 8 }, "vec2<f32>": { align: 8, size: 8 }, "vec2<f16>": { align: 4, size: 4 }, "vec3<i32>": { align: 16, size: 12 }, "vec3<u32>": { align: 16, size: 12 }, "vec3<f32>": { align: 16, size: 12 }, "vec3<f16>": { align: 8, size: 6 }, "vec4<i32>": { align: 16, size: 16 }, "vec4<u32>": { align: 16, size: 16 }, "vec4<f32>": { align: 16, size: 16 }, "vec4<f16>": { align: 8, size: 8 }, "mat2x2<f32>": { align: 8, size: 16 }, "mat2x2<f16>": { align: 4, size: 8 }, "mat3x2<f32>": { align: 8, size: 24 }, "mat3x2<f16>": { align: 4, size: 12 }, "mat4x2<f32>": { align: 8, size: 32 }, "mat4x2<f16>": { align: 4, size: 16 }, "mat2x3<f32>": { align: 16, size: 32 }, "mat2x3<f16>": { align: 8, size: 16 }, "mat3x3<f32>": { align: 16, size: 48 }, "mat3x3<f16>": { align: 8, size: 24 }, "mat4x3<f32>": { align: 16, size: 64 }, "mat4x3<f16>": { align: 8, size: 32 }, "mat2x4<f32>": { align: 16, size: 32 }, "mat2x4<f16>": { align: 8, size: 16 }, "mat3x4<f32>": { align: 16, size: 48 }, "mat3x4<f16>": { align: 8, size: 24 }, "mat4x4<f32>": { align: 16, size: 64 }, "mat4x4<f16>": { align: 8, size: 32 } }; function createUboElementsWGSL(uniformData) { var uboElements = uniformData.map(function (data) { return { data: data, offset: 0, size: 0 }; }); var offset = 0; for (var i = 0; i < uboElements.length; i++) { var uboElement = uboElements[i]; var size = WGSL_ALIGN_SIZE_DATA[uboElement.data.type].size; var align = WGSL_ALIGN_SIZE_DATA[uboElement.data.type].align; if (!WGSL_ALIGN_SIZE_DATA[uboElement.data.type]) { throw new Error("[Pixi.js] WebGPU UniformBuffer: Unknown type ".concat(uboElement.data.type)); } if (uboElement.data.size > 1) { size = Math.max(size, align) * uboElement.data.size; } offset = Math.ceil(offset / align) * align; uboElement.size = size; uboElement.offset = offset; offset += size; } offset = Math.ceil(offset / 16) * 16; return { uboElements: uboElements, size: offset }; } exports.WGSL_ALIGN_SIZE_DATA = WGSL_ALIGN_SIZE_DATA; exports.createUboElementsWGSL = createUboElementsWGSL; /***/ }), /***/ 30107: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Color = __webpack_require__(98828); "use strict"; exports.Color = Color.Color; /***/ }), /***/ 30145: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var genericFontFamilies = ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui"]; function fontStringFromTextStyle(style) { var fontSizeString = typeof style.fontSize === "number" ? "".concat(style.fontSize, "px") : style.fontSize; var fontFamilies = style.fontFamily; if (!Array.isArray(style.fontFamily)) { fontFamilies = style.fontFamily.split(","); } for (var i = fontFamilies.length - 1; i >= 0; i--) { var fontFamily = fontFamilies[i].trim(); if (!/([\"\'])[^\'\"]+\1/.test(fontFamily) && !genericFontFamilies.includes(fontFamily)) { fontFamily = "\"".concat(fontFamily, "\""); } fontFamilies[i] = fontFamily; } return "".concat(style.fontStyle, " ").concat(style.fontVariant, " ").concat(style.fontWeight, " ").concat(fontSizeString, " ").concat(fontFamilies.join(",")); } exports.fontStringFromTextStyle = fontStringFromTextStyle; /***/ }), /***/ 30263: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var Container = __webpack_require__(47719); var EventSystem = __webpack_require__(49556); var FederatedEventTarget = __webpack_require__(64996); "use strict"; Extensions.extensions.add(EventSystem.EventSystem); Extensions.extensions.mixin(Container.Container, FederatedEventTarget.FederatedContainer); /***/ }), /***/ 30324: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var RenderTargetSystem = __webpack_require__(50827); var GpuRenderTargetAdaptor = __webpack_require__(64884); "use strict"; var GpuRenderTargetSystem = /*#__PURE__*/function (_RenderTargetSystem$R) { function GpuRenderTargetSystem(renderer) { var _this; _classCallCheck(this, GpuRenderTargetSystem); _this = _callSuper(this, GpuRenderTargetSystem, [renderer]); _this.adaptor = new GpuRenderTargetAdaptor.GpuRenderTargetAdaptor(); _this.adaptor.init(renderer, _this); return _this; } _inherits(GpuRenderTargetSystem, _RenderTargetSystem$R); return _createClass(GpuRenderTargetSystem); }(RenderTargetSystem.RenderTargetSystem); /** @ignore */ GpuRenderTargetSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "renderTarget" }; exports.GpuRenderTargetSystem = GpuRenderTargetSystem; /***/ }), /***/ 30496: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var GraphicsContextSystem = __webpack_require__(40545); var GraphicsPipe = __webpack_require__(74199); "use strict"; Extensions.extensions.add(GraphicsPipe.GraphicsPipe); Extensions.extensions.add(GraphicsContextSystem.GraphicsContextSystem); /***/ }), /***/ 30597: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Bounds = __webpack_require__(76631); var getGlobalBounds = __webpack_require__(27182); "use strict"; var tempBounds = new Bounds.Bounds(); function addMaskBounds(mask, bounds, skipUpdateTransform) { var boundsToMask = tempBounds; mask.measurable = true; getGlobalBounds.getGlobalBounds(mask, skipUpdateTransform, boundsToMask); bounds.addBoundsMask(boundsToMask); mask.measurable = false; } exports.addMaskBounds = addMaskBounds; /***/ }), /***/ 30710: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var adapter = __webpack_require__(72450); "use strict"; function assertPath(path2) { if (typeof path2 !== "string") { throw new TypeError("Path must be a string. Received ".concat(JSON.stringify(path2))); } } function removeUrlParams(url) { var re = url.split("?")[0]; return re.split("#")[0]; } function escapeRegExp(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function replaceAll(str, find, replace) { return str.replace(new RegExp(escapeRegExp(find), "g"), replace); } function normalizeStringPosix(path2, allowAboveRoot) { var res = ""; var lastSegmentLength = 0; var lastSlash = -1; var dots = 0; var code = -1; for (var i = 0; i <= path2.length; ++i) { if (i < path2.length) { code = path2.charCodeAt(i); } else if (code === 47) { break; } else { code = 47; } if (code === 47) { if (lastSlash === i - 1 || dots === 1) {} else if (lastSlash !== i - 1 && dots === 2) { if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) { if (res.length > 2) { var lastSlashIndex = res.lastIndexOf("/"); if (lastSlashIndex !== res.length - 1) { if (lastSlashIndex === -1) { res = ""; lastSegmentLength = 0; } else { res = res.slice(0, lastSlashIndex); lastSegmentLength = res.length - 1 - res.lastIndexOf("/"); } lastSlash = i; dots = 0; continue; } } else if (res.length === 2 || res.length === 1) { res = ""; lastSegmentLength = 0; lastSlash = i; dots = 0; continue; } } if (allowAboveRoot) { if (res.length > 0) { res += "/.."; } else { res = ".."; } lastSegmentLength = 2; } } else { if (res.length > 0) { res += "/".concat(path2.slice(lastSlash + 1, i)); } else { res = path2.slice(lastSlash + 1, i); } lastSegmentLength = i - lastSlash - 1; } lastSlash = i; dots = 0; } else if (code === 46 && dots !== -1) { ++dots; } else { dots = -1; } } return res; } var path = { /** * Converts a path to posix format. * @param path - The path to convert to posix */ toPosix: function toPosix(path2) { return replaceAll(path2, "\\", "/"); }, /** * Checks if the path is a URL e.g. http://, https:// * @param path - The path to check */ isUrl: function isUrl(path2) { return /^https?:/.test(this.toPosix(path2)); }, /** * Checks if the path is a data URL * @param path - The path to check */ isDataUrl: function isDataUrl(path2) { return /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(path2); }, /** * Checks if the path is a blob URL * @param path - The path to check */ isBlobUrl: function isBlobUrl(path2) { return path2.startsWith("blob:"); }, /** * Checks if the path has a protocol e.g. http://, https://, file:///, data:, blob:, C:/ * This will return true for windows file paths * @param path - The path to check */ hasProtocol: function hasProtocol(path2) { return /^[^/:]+:/.test(this.toPosix(path2)); }, /** * Returns the protocol of the path e.g. http://, https://, file:///, data:, blob:, C:/ * @param path - The path to get the protocol from */ getProtocol: function getProtocol(path2) { assertPath(path2); path2 = this.toPosix(path2); var matchFile = /^file:\/\/\//.exec(path2); if (matchFile) { return matchFile[0]; } var matchProtocol = /^[^/:]+:\/{0,2}/.exec(path2); if (matchProtocol) { return matchProtocol[0]; } return ""; }, /** * Converts URL to an absolute path. * When loading from a Web Worker, we must use absolute paths. * If the URL is already absolute we return it as is * If it's not, we convert it * @param url - The URL to test * @param customBaseUrl - The base URL to use * @param customRootUrl - The root URL to use */ toAbsolute: function toAbsolute(url, customBaseUrl, customRootUrl) { assertPath(url); if (this.isDataUrl(url) || this.isBlobUrl(url)) return url; var baseUrl = removeUrlParams(this.toPosix(customBaseUrl !== null && customBaseUrl !== void 0 ? customBaseUrl : adapter.DOMAdapter.get().getBaseUrl())); var rootUrl = removeUrlParams(this.toPosix(customRootUrl !== null && customRootUrl !== void 0 ? customRootUrl : this.rootname(baseUrl))); url = this.toPosix(url); if (url.startsWith("/")) { return path.join(rootUrl, url.slice(1)); } var absolutePath = this.isAbsolute(url) ? url : this.join(baseUrl, url); return absolutePath; }, /** * Normalizes the given path, resolving '..' and '.' segments * @param path - The path to normalize */ normalize: function normalize(path2) { assertPath(path2); if (path2.length === 0) return "."; if (this.isDataUrl(path2) || this.isBlobUrl(path2)) return path2; path2 = this.toPosix(path2); var protocol = ""; var isAbsolute = path2.startsWith("/"); if (this.hasProtocol(path2)) { protocol = this.rootname(path2); path2 = path2.slice(protocol.length); } var trailingSeparator = path2.endsWith("/"); path2 = normalizeStringPosix(path2, false); if (path2.length > 0 && trailingSeparator) path2 += "/"; if (isAbsolute) return "/".concat(path2); return protocol + path2; }, /** * Determines if path is an absolute path. * Absolute paths can be urls, data urls, or paths on disk * @param path - The path to test */ isAbsolute: function isAbsolute(path2) { assertPath(path2); path2 = this.toPosix(path2); if (this.hasProtocol(path2)) return true; return path2.startsWith("/"); }, /** * Joins all given path segments together using the platform-specific separator as a delimiter, * then normalizes the resulting path * @param segments - The segments of the path to join */ join: function join() { if (arguments.length === 0) { return "."; } var joined; for (var i = 0; i < arguments.length; ++i) { var arg = i < 0 || arguments.length <= i ? undefined : arguments[i]; assertPath(arg); if (arg.length > 0) { if (joined === void 0) joined = arg;else { var _ref; var prevArg = (_ref = i - 1 < 0 || arguments.length <= i - 1 ? undefined : arguments[i - 1]) !== null && _ref !== void 0 ? _ref : ""; if (this.joinExtensions.includes(this.extname(prevArg).toLowerCase())) { joined += "/../".concat(arg); } else { joined += "/".concat(arg); } } } } if (joined === void 0) { return "."; } return this.normalize(joined); }, /** * Returns the directory name of a path * @param path - The path to parse */ dirname: function dirname(path2) { assertPath(path2); if (path2.length === 0) return "."; path2 = this.toPosix(path2); var code = path2.charCodeAt(0); var hasRoot = code === 47; var end = -1; var matchedSlash = true; var proto = this.getProtocol(path2); var origpath = path2; path2 = path2.slice(proto.length); for (var i = path2.length - 1; i >= 1; --i) { code = path2.charCodeAt(i); if (code === 47) { if (!matchedSlash) { end = i; break; } } else { matchedSlash = false; } } if (end === -1) return hasRoot ? "/" : this.isUrl(origpath) ? proto + path2 : proto; if (hasRoot && end === 1) return "//"; return proto + path2.slice(0, end); }, /** * Returns the root of the path e.g. /, C:/, file:///, http://domain.com/ * @param path - The path to parse */ rootname: function rootname(path2) { assertPath(path2); path2 = this.toPosix(path2); var root = ""; if (path2.startsWith("/")) root = "/";else { root = this.getProtocol(path2); } if (this.isUrl(path2)) { var index = path2.indexOf("/", root.length); if (index !== -1) { root = path2.slice(0, index); } else root = path2; if (!root.endsWith("/")) root += "/"; } return root; }, /** * Returns the last portion of a path * @param path - The path to test * @param ext - Optional extension to remove */ basename: function basename(path2, ext) { assertPath(path2); if (ext) assertPath(ext); path2 = removeUrlParams(this.toPosix(path2)); var start = 0; var end = -1; var matchedSlash = true; var i; if (ext !== void 0 && ext.length > 0 && ext.length <= path2.length) { if (ext.length === path2.length && ext === path2) return ""; var extIdx = ext.length - 1; var firstNonSlashEnd = -1; for (i = path2.length - 1; i >= 0; --i) { var code = path2.charCodeAt(i); if (code === 47) { if (!matchedSlash) { start = i + 1; break; } } else { if (firstNonSlashEnd === -1) { matchedSlash = false; firstNonSlashEnd = i + 1; } if (extIdx >= 0) { if (code === ext.charCodeAt(extIdx)) { if (--extIdx === -1) { end = i; } } else { extIdx = -1; end = firstNonSlashEnd; } } } } if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path2.length; return path2.slice(start, end); } for (i = path2.length - 1; i >= 0; --i) { if (path2.charCodeAt(i) === 47) { if (!matchedSlash) { start = i + 1; break; } } else if (end === -1) { matchedSlash = false; end = i + 1; } } if (end === -1) return ""; return path2.slice(start, end); }, /** * Returns the extension of the path, from the last occurrence of the . (period) character to end of string in the last * portion of the path. If there is no . in the last portion of the path, or if there are no . characters other than * the first character of the basename of path, an empty string is returned. * @param path - The path to parse */ extname: function extname(path2) { assertPath(path2); path2 = removeUrlParams(this.toPosix(path2)); var startDot = -1; var startPart = 0; var end = -1; var matchedSlash = true; var preDotState = 0; for (var i = path2.length - 1; i >= 0; --i) { var code = path2.charCodeAt(i); if (code === 47) { if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { matchedSlash = false; end = i + 1; } if (code === 46) { if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1; } else if (startDot !== -1) { preDotState = -1; } } if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { return ""; } return path2.slice(startDot, end); }, /** * Parses a path into an object containing the 'root', `dir`, `base`, `ext`, and `name` properties. * @param path - The path to parse */ parse: function parse(path2) { assertPath(path2); var ret = { root: "", dir: "", base: "", ext: "", name: "" }; if (path2.length === 0) return ret; path2 = removeUrlParams(this.toPosix(path2)); var code = path2.charCodeAt(0); var isAbsolute = this.isAbsolute(path2); var start; var protocol = ""; ret.root = this.rootname(path2); if (isAbsolute || this.hasProtocol(path2)) { start = 1; } else { start = 0; } var startDot = -1; var startPart = 0; var end = -1; var matchedSlash = true; var i = path2.length - 1; var preDotState = 0; for (; i >= start; --i) { code = path2.charCodeAt(i); if (code === 47) { if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { matchedSlash = false; end = i + 1; } if (code === 46) { if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1; } else if (startDot !== -1) { preDotState = -1; } } if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { if (end !== -1) { if (startPart === 0 && isAbsolute) ret.base = ret.name = path2.slice(1, end);else ret.base = ret.name = path2.slice(startPart, end); } } else { if (startPart === 0 && isAbsolute) { ret.name = path2.slice(1, startDot); ret.base = path2.slice(1, end); } else { ret.name = path2.slice(startPart, startDot); ret.base = path2.slice(startPart, end); } ret.ext = path2.slice(startDot, end); } ret.dir = this.dirname(path2); if (protocol) ret.dir = protocol + ret.dir; return ret; }, sep: "/", delimiter: ":", joinExtensions: [".html"] }; exports.path = path; /***/ }), /***/ 30815: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Cache = __webpack_require__(65278); var deprecation = __webpack_require__(11225); var warn = __webpack_require__(57371); var TextStyle = __webpack_require__(55858); var DynamicBitmapFont = __webpack_require__(2441); var getBitmapTextLayout = __webpack_require__(41914); var resolveCharacters = __webpack_require__(8448); "use strict"; var fontCount = 0; var BitmapFontManagerClass = /*#__PURE__*/function () { function BitmapFontManagerClass() { _classCallCheck(this, BitmapFontManagerClass); /** * This character set includes all the letters in the alphabet (both lower- and upper- case). * @type {string[][]} * @example * BitmapFont.from('ExampleFont', style, { chars: BitmapFont.ALPHA }) */ this.ALPHA = [["a", "z"], ["A", "Z"], " "]; /** * This character set includes all decimal digits (from 0 to 9). * @type {string[][]} * @example * BitmapFont.from('ExampleFont', style, { chars: BitmapFont.NUMERIC }) */ this.NUMERIC = [["0", "9"]]; /** * This character set is the union of `BitmapFont.ALPHA` and `BitmapFont.NUMERIC`. * @type {string[][]} */ this.ALPHANUMERIC = [["a", "z"], ["A", "Z"], ["0", "9"], " "]; /** * This character set consists of all the ASCII table. * @member {string[][]} * @see http://www.asciitable.com/ */ this.ASCII = [[" ", "~"]]; /** Default options for installing a new BitmapFont. */ this.defaultOptions = { chars: this.ALPHANUMERIC, resolution: 1, padding: 4, skipKerning: false }; } /** * Get a font for the specified text and style. * @param text - The text to get the font for * @param style - The style to use */ return _createClass(BitmapFontManagerClass, [{ key: "getFont", value: function getFont(text, style) { var _dynamicFont$ensureCh; var fontFamilyKey = "".concat(style.fontFamily, "-bitmap"); var overrideFill = true; if (style._fill.fill && !style._stroke) { fontFamilyKey += style._fill.fill.styleKey; overrideFill = false; } else if (style._stroke || style.dropShadow) { var key = style.styleKey; key = key.substring(0, key.lastIndexOf("-")); fontFamilyKey = "".concat(key, "-bitmap"); overrideFill = false; } if (!Cache.Cache.has(fontFamilyKey)) { var fnt = new DynamicBitmapFont.DynamicBitmapFont(_objectSpread({ style: style, overrideFill: overrideFill, overrideSize: true }, this.defaultOptions)); fontCount++; if (fontCount > 50) { warn.warn("BitmapText", "You have dynamically created ".concat(fontCount, " bitmap fonts, this can be inefficient. Try pre installing your font styles using `BitmapFont.install({name:\"style1\", style})`")); } fnt.once("destroy", function () { fontCount--; Cache.Cache.remove(fontFamilyKey); }); Cache.Cache.set(fontFamilyKey, fnt); } var dynamicFont = Cache.Cache.get(fontFamilyKey); (_dynamicFont$ensureCh = dynamicFont.ensureCharacters) === null || _dynamicFont$ensureCh === void 0 || _dynamicFont$ensureCh.call(dynamicFont, text); return dynamicFont; } /** * Get the layout of a text for the specified style. * @param text - The text to get the layout for * @param style - The style to use * @param trimEnd - Whether to ignore whitespaces at the end of each line */ }, { key: "getLayout", value: function getLayout(text, style) { var trimEnd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var bitmapFont = this.getFont(text, style); return getBitmapTextLayout.getBitmapTextLayout(_toConsumableArray(text), style, bitmapFont, trimEnd); } /** * Measure the text using the specified style. * @param text - The text to measure * @param style - The style to use * @param trimEnd - Whether to ignore whitespaces at the end of each line */ }, { key: "measureText", value: function measureText(text, style) { var trimEnd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; return this.getLayout(text, style, trimEnd); } // eslint-disable-next-line max-len }, { key: "install", value: function install() { var _options; var options = arguments.length <= 0 ? undefined : arguments[0]; if (typeof options === "string") { var _ref, _ref2, _ref3, _ref4; options = { name: options, style: arguments.length <= 1 ? undefined : arguments[1], chars: (_ref = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref === void 0 ? void 0 : _ref.chars, resolution: (_ref2 = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref2 === void 0 ? void 0 : _ref2.resolution, padding: (_ref3 = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref3 === void 0 ? void 0 : _ref3.padding, skipKerning: (_ref4 = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref4 === void 0 ? void 0 : _ref4.skipKerning }; deprecation.deprecation(deprecation.v8_0_0, "BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"); } var name = (_options = options) === null || _options === void 0 ? void 0 : _options.name; if (!name) { throw new Error("[BitmapFontManager] Property `name` is required."); } options = _objectSpread(_objectSpread({}, this.defaultOptions), options); var textStyle = options.style; var style = textStyle instanceof TextStyle.TextStyle ? textStyle : new TextStyle.TextStyle(textStyle); var overrideFill = style._fill.fill !== null && style._fill.fill !== void 0; var font = new DynamicBitmapFont.DynamicBitmapFont({ style: style, overrideFill: overrideFill, skipKerning: options.skipKerning, padding: options.padding, resolution: options.resolution, overrideSize: false }); var flatChars = resolveCharacters.resolveCharacters(options.chars); font.ensureCharacters(flatChars.join("")); Cache.Cache.set("".concat(name, "-bitmap"), font); font.once("destroy", function () { return Cache.Cache.remove("".concat(name, "-bitmap")); }); return font; } /** * Uninstalls a bitmap font from the cache. * @param {string} name - The name of the bitmap font to uninstall. */ }, { key: "uninstall", value: function uninstall(name) { var cacheKey = "".concat(name, "-bitmap"); var font = Cache.Cache.get(cacheKey); if (font) { font.destroy(); } } }]); }(); var BitmapFontManager = new BitmapFontManagerClass(); exports.BitmapFontManager = BitmapFontManager; /***/ }), /***/ 30942: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function insertVersion(src, isES300) { if (!isES300) return src; return "#version 300 es\n".concat(src); } exports.insertVersion = insertVersion; /***/ }), /***/ 31054: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var tilingBit = { name: "tiling-bit", vertex: { header: /* wgsl */"\n struct TilingUniforms {\n uMapCoord:mat3x3<f32>,\n uClampFrame:vec4<f32>,\n uClampOffset:vec2<f32>,\n uTextureTransform:mat3x3<f32>,\n uSizeAnchor:vec4<f32>\n };\n\n @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;\n @group(2) @binding(1) var uTexture: texture_2d<f32>;\n @group(2) @binding(2) var uSampler: sampler;\n ", main: /* wgsl */"\n uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;\n\n position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;\n " }, fragment: { header: /* wgsl */"\n struct TilingUniforms {\n uMapCoord:mat3x3<f32>,\n uClampFrame:vec4<f32>,\n uClampOffset:vec2<f32>,\n uTextureTransform:mat3x3<f32>,\n uSizeAnchor:vec4<f32>\n };\n\n @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;\n @group(2) @binding(1) var uTexture: texture_2d<f32>;\n @group(2) @binding(2) var uSampler: sampler;\n ", main: /* wgsl */"\n\n var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);\n coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;\n var unclamped = coord;\n coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);\n\n var bias = 0.;\n\n if(unclamped.x == coord.x && unclamped.y == coord.y)\n {\n bias = -32.;\n } \n\n outColor = textureSampleBias(uTexture, uSampler, coord, bias);\n " } }; var tilingBitGl = { name: "tiling-bit", vertex: { header: /* glsl */"\n uniform mat3 uTextureTransform;\n uniform vec4 uSizeAnchor;\n \n ", main: /* glsl */"\n uv = (uTextureTransform * vec3(aUV, 1.0)).xy;\n\n position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;\n " }, fragment: { header: /* glsl */"\n uniform sampler2D uTexture;\n uniform mat3 uMapCoord;\n uniform vec4 uClampFrame;\n uniform vec2 uClampOffset;\n ", main: /* glsl */"\n\n vec2 coord = vUV + ceil(uClampOffset - vUV);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n \n outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0\n \n " } }; exports.tilingBit = tilingBit; exports.tilingBitGl = tilingBitGl; /***/ }), /***/ 31216: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function getUboData(program, gl) { if (!gl.ACTIVE_UNIFORM_BLOCKS) return {}; var uniformBlocks = {}; var totalUniformsBlocks = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS); for (var i = 0; i < totalUniformsBlocks; i++) { var name = gl.getActiveUniformBlockName(program, i); var uniformBlockIndex = gl.getUniformBlockIndex(program, name); var size = gl.getActiveUniformBlockParameter(program, i, gl.UNIFORM_BLOCK_DATA_SIZE); uniformBlocks[name] = { name: name, index: uniformBlockIndex, size: size }; } return uniformBlocks; } exports.getUboData = getUboData; /***/ }), /***/ 31349: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var GLSL_TO_SIZE = { "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 mapSize(type) { return GLSL_TO_SIZE[type]; } exports.mapSize = mapSize; /***/ }), /***/ 31359: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var globalUniformsBit = { name: "global-uniforms-bit", vertex: { header: /* wgsl */"\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n " } }; var globalUniformsUBOBitGl = { name: "global-uniforms-ubo-bit", vertex: { header: /* glsl */"\n uniform globalUniforms {\n mat3 uProjectionMatrix;\n mat3 uWorldTransformMatrix;\n vec4 uWorldColorAlpha;\n vec2 uResolution;\n };\n " } }; var globalUniformsBitGl = { name: "global-uniforms-bit", vertex: { header: /* glsl */"\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n " } }; exports.globalUniformsBit = globalUniformsBit; exports.globalUniformsBitGl = globalUniformsBitGl; exports.globalUniformsUBOBitGl = globalUniformsUBOBitGl; /***/ }), /***/ 31503: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["sprite", "scale"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Matrix = __webpack_require__(20764); var Point = __webpack_require__(75544); var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var UniformGroup = __webpack_require__(34400); var Sprite = __webpack_require__(27615); var deprecation = __webpack_require__(11225); var Filter = __webpack_require__(92393); var displacement$1 = __webpack_require__(53659); var displacement = __webpack_require__(5144); var displacement$2 = __webpack_require__(70818); "use strict"; var DisplacementFilter = /*#__PURE__*/function (_Filter$Filter) { function DisplacementFilter() { var _this; _classCallCheck(this, DisplacementFilter); var options = arguments.length <= 0 ? undefined : arguments[0]; if (options instanceof Sprite.Sprite) { if (arguments.length <= 1 ? undefined : arguments[1]) { deprecation.deprecation(deprecation.v8_0_0, "DisplacementFilter now uses options object instead of params. {sprite, scale}"); } options = { sprite: options, scale: arguments.length <= 1 ? undefined : arguments[1] }; } var _options = options, sprite = _options.sprite, scaleOption = _options.scale, rest = _objectWithoutProperties(_options, _excluded); var scale = scaleOption !== null && scaleOption !== void 0 ? scaleOption : 20; if (typeof scale === "number") { scale = new Point.Point(scale, scale); } var filterUniforms = new UniformGroup.UniformGroup({ uFilterMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uScale: { value: scale, type: "vec2<f32>" }, uRotation: { value: new Float32Array([0, 0, 0, 0]), type: "mat2x2<f32>" } }); var glProgram = GlProgram.GlProgram.from({ vertex: displacement["default"], fragment: displacement$1["default"], name: "displacement-filter" }); var gpuProgram = GpuProgram.GpuProgram.from({ vertex: { source: displacement$2["default"], entryPoint: "mainVertex" }, fragment: { source: displacement$2["default"], entryPoint: "mainFragment" } }); var textureSource = sprite.texture.source; _this = _callSuper(this, DisplacementFilter, [_objectSpread(_objectSpread({}, rest), {}, { gpuProgram: gpuProgram, glProgram: glProgram, resources: { filterUniforms: filterUniforms, uMapTexture: textureSource, uMapSampler: textureSource.style } })]); _this._sprite = options.sprite; _this._sprite.renderable = false; return _this; } /** * Applies the filter. * @param filterManager - The manager. * @param input - The input target. * @param output - The output target. * @param clearMode - clearMode. */ _inherits(DisplacementFilter, _Filter$Filter); return _createClass(DisplacementFilter, [{ key: "apply", value: function apply(filterManager, input, output, clearMode) { var uniforms = this.resources.filterUniforms.uniforms; filterManager.calculateSpriteMatrix(uniforms.uFilterMatrix, this._sprite); var wt = this._sprite.worldTransform; var lenX = Math.sqrt(wt.a * wt.a + wt.b * wt.b); var lenY = Math.sqrt(wt.c * wt.c + wt.d * wt.d); if (lenX !== 0 && lenY !== 0) { uniforms.uRotation[0] = wt.a / lenX; uniforms.uRotation[1] = wt.b / lenX; uniforms.uRotation[2] = wt.c / lenY; uniforms.uRotation[3] = wt.d / lenY; } this.resources.uMapTexture = this._sprite.texture.source; filterManager.applyFilter(this, input, output, clearMode); } /** scaleX, scaleY for displacements */ }, { key: "scale", get: function get() { return this.resources.filterUniforms.uniforms.uScale; } }]); }(Filter.Filter); exports.DisplacementFilter = DisplacementFilter; /***/ }), /***/ 31594: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var FilterEffect = __webpack_require__(51856); var MaskEffectManager = __webpack_require__(47281); "use strict"; var effectsMixin = { _maskEffect: null, _maskOptions: { inverse: false }, _filterEffect: null, /** * @todo Needs docs. * @memberof scene.Container# * @type {Array<Effect>} */ effects: [], _markStructureAsChanged: function _markStructureAsChanged() { var renderGroup = this.renderGroup || this.parentRenderGroup; if (renderGroup) { renderGroup.structureDidChange = true; } }, /** * @todo Needs docs. * @param effect - The effect to add. * @memberof scene.Container# * @ignore */ addEffect: function addEffect(effect) { var index = this.effects.indexOf(effect); if (index !== -1) return; this.effects.push(effect); this.effects.sort(function (a, b) { return a.priority - b.priority; }); this._markStructureAsChanged(); this._updateIsSimple(); }, /** * @todo Needs docs. * @param effect - The effect to remove. * @memberof scene.Container# * @ignore */ removeEffect: function removeEffect(effect) { var index = this.effects.indexOf(effect); if (index === -1) return; this.effects.splice(index, 1); this._markStructureAsChanged(); this._updateIsSimple(); }, set mask(value) { var effect = this._maskEffect; if ((effect === null || effect === void 0 ? void 0 : effect.mask) === value) return; if (effect) { this.removeEffect(effect); MaskEffectManager.MaskEffectManager.returnMaskEffect(effect); this._maskEffect = null; } if (value === null || value === void 0) return; this._maskEffect = MaskEffectManager.MaskEffectManager.getMaskEffect(value); this.addEffect(this._maskEffect); }, /** * Used to set mask and control mask options. * @param options * @example * import { Graphics, Sprite } from 'pixi.js'; * * const graphics = new Graphics(); * graphics.beginFill(0xFF3300); * graphics.drawRect(50, 250, 100, 100); * graphics.endFill(); * * const sprite = new Sprite(texture); * sprite.setMask({ * mask: graphics, * inverse: true, * }); * @memberof scene.Container# */ setMask: function setMask(options) { this._maskOptions = _objectSpread(_objectSpread({}, this._maskOptions), options); if (options.mask) { this.mask = options.mask; } this._markStructureAsChanged(); }, /** * Sets a mask for the displayObject. A mask is an object that limits the visibility of an * object to the shape of the mask applied to it. In PixiJS a regular mask must be a * {@link Graphics} or a {@link Sprite} object. This allows for much faster masking in canvas as it * utilities shape clipping. Furthermore, a mask of an object must be in the subtree of its parent. * Otherwise, `getLocalBounds` may calculate incorrect bounds, which makes the container's width and height wrong. * To remove a mask, set this property to `null`. * * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. * @example * import { Graphics, Sprite } from 'pixi.js'; * * const graphics = new Graphics(); * graphics.beginFill(0xFF3300); * graphics.drawRect(50, 250, 100, 100); * graphics.endFill(); * * const sprite = new Sprite(texture); * sprite.mask = graphics; * @memberof scene.Container# */ get mask() { var _this$_maskEffect; return (_this$_maskEffect = this._maskEffect) === null || _this$_maskEffect === void 0 ? void 0 : _this$_maskEffect.mask; }, set filters(value) { var _value, _effect$filters; if (!Array.isArray(value) && value) value = [value]; var effect = this._filterEffect || (this._filterEffect = new FilterEffect.FilterEffect()); value = value; var hasFilters = ((_value = value) === null || _value === void 0 ? void 0 : _value.length) > 0; var hadFilters = ((_effect$filters = effect.filters) === null || _effect$filters === void 0 ? void 0 : _effect$filters.length) > 0; var didChange = hasFilters !== hadFilters; value = Array.isArray(value) ? value.slice(0) : value; effect.filters = Object.freeze(value); if (didChange) { if (hasFilters) { this.addEffect(effect); } else { this.removeEffect(effect); effect.filters = value !== null && value !== void 0 ? value : null; } } }, /** * Sets the filters for the displayObject. * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. * To remove filters simply set this property to `'null'`. * @memberof scene.Container# */ get filters() { var _this$_filterEffect; return (_this$_filterEffect = this._filterEffect) === null || _this$_filterEffect === void 0 ? void 0 : _this$_filterEffect.filters; }, set filterArea(value) { this._filterEffect || (this._filterEffect = new FilterEffect.FilterEffect()); this._filterEffect.filterArea = value; }, /** * The area the filter is applied to. This is used as more of an optimization * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. * * Also works as an interaction mask. * @memberof scene.Container# */ get filterArea() { var _this$_filterEffect2; return (_this$_filterEffect2 = this._filterEffect) === null || _this$_filterEffect2 === void 0 ? void 0 : _this$_filterEffect2.filterArea; } }; exports.effectsMixin = effectsMixin; /***/ }), /***/ 31598: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var PlaneGeometry = __webpack_require__(45301); "use strict"; var _NineSliceGeometry = /*#__PURE__*/function (_PlaneGeometry$PlaneG) { function _NineSliceGeometry() { var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _NineSliceGeometry); options = _objectSpread(_objectSpread({}, _NineSliceGeometry.defaultOptions), options); _this = _callSuper(this, _NineSliceGeometry, [{ width: options.width, height: options.height, verticesX: 4, verticesY: 4 }]); _this.update(options); return _this; } /** * Updates the NineSliceGeometry with the options. * @param options - The options of the NineSliceGeometry. */ _inherits(_NineSliceGeometry, _PlaneGeometry$PlaneG); return _createClass(_NineSliceGeometry, [{ key: "update", value: function update(options) { var _options$width, _options$height, _options$originalWidt, _options$originalHeig, _options$leftWidth, _options$rightWidth, _options$topHeight, _options$bottomHeight, _options$anchor, _options$anchor2; this.width = (_options$width = options.width) !== null && _options$width !== void 0 ? _options$width : this.width; this.height = (_options$height = options.height) !== null && _options$height !== void 0 ? _options$height : this.height; this._originalWidth = (_options$originalWidt = options.originalWidth) !== null && _options$originalWidt !== void 0 ? _options$originalWidt : this._originalWidth; this._originalHeight = (_options$originalHeig = options.originalHeight) !== null && _options$originalHeig !== void 0 ? _options$originalHeig : this._originalHeight; this._leftWidth = (_options$leftWidth = options.leftWidth) !== null && _options$leftWidth !== void 0 ? _options$leftWidth : this._leftWidth; this._rightWidth = (_options$rightWidth = options.rightWidth) !== null && _options$rightWidth !== void 0 ? _options$rightWidth : this._rightWidth; this._topHeight = (_options$topHeight = options.topHeight) !== null && _options$topHeight !== void 0 ? _options$topHeight : this._topHeight; this._bottomHeight = (_options$bottomHeight = options.bottomHeight) !== null && _options$bottomHeight !== void 0 ? _options$bottomHeight : this._bottomHeight; this._anchorX = (_options$anchor = options.anchor) === null || _options$anchor === void 0 ? void 0 : _options$anchor.x; this._anchorY = (_options$anchor2 = options.anchor) === null || _options$anchor2 === void 0 ? void 0 : _options$anchor2.y; this.updateUvs(); this.updatePositions(); } /** Updates the positions of the vertices. */ }, { key: "updatePositions", value: function updatePositions() { var p = this.positions; var width = this.width, height = this.height, _leftWidth = this._leftWidth, _rightWidth = this._rightWidth, _topHeight = this._topHeight, _bottomHeight = this._bottomHeight, _anchorX = this._anchorX, _anchorY = this._anchorY; var w = _leftWidth + _rightWidth; var scaleW = width > w ? 1 : width / w; var h = _topHeight + _bottomHeight; var scaleH = height > h ? 1 : height / h; var scale = Math.min(scaleW, scaleH); var anchorOffsetX = _anchorX * width; var anchorOffsetY = _anchorY * height; p[0] = p[8] = p[16] = p[24] = -anchorOffsetX; p[2] = p[10] = p[18] = p[26] = _leftWidth * scale - anchorOffsetX; p[4] = p[12] = p[20] = p[28] = width - _rightWidth * scale - anchorOffsetX; p[6] = p[14] = p[22] = p[30] = width - anchorOffsetX; p[1] = p[3] = p[5] = p[7] = -anchorOffsetY; p[9] = p[11] = p[13] = p[15] = _topHeight * scale - anchorOffsetY; p[17] = p[19] = p[21] = p[23] = height - _bottomHeight * scale - anchorOffsetY; p[25] = p[27] = p[29] = p[31] = height - anchorOffsetY; this.getBuffer("aPosition").update(); } /** Updates the UVs of the vertices. */ }, { key: "updateUvs", value: function updateUvs() { var uvs = this.uvs; uvs[0] = uvs[8] = uvs[16] = uvs[24] = 0; uvs[1] = uvs[3] = uvs[5] = uvs[7] = 0; uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1; uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1; var _uvw = 1 / this._originalWidth; var _uvh = 1 / this._originalHeight; uvs[2] = uvs[10] = uvs[18] = uvs[26] = _uvw * this._leftWidth; uvs[9] = uvs[11] = uvs[13] = uvs[15] = _uvh * this._topHeight; uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - _uvw * this._rightWidth; uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - _uvh * this._bottomHeight; this.getBuffer("aUV").update(); } }]); }(PlaneGeometry.PlaneGeometry); /** The default options for the NineSliceGeometry. */ _NineSliceGeometry.defaultOptions = { /** The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */ width: 100, /** The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */ height: 100, /** The width of the left column. */ leftWidth: 10, /** The height of the top row. */ topHeight: 10, /** The width of the right column. */ rightWidth: 10, /** The height of the bottom row. */ bottomHeight: 10, /** The original width of the texture */ originalWidth: 100, /** The original height of the texture */ originalHeight: 100 }; var NineSliceGeometry = _NineSliceGeometry; exports.NineSliceGeometry = NineSliceGeometry; /***/ }), /***/ 31863: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 31932: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Buffer = __webpack_require__(59832); var _const = __webpack_require__(33843); var Geometry = __webpack_require__(18964); "use strict"; var placeHolderBufferData = new Float32Array(1); var placeHolderIndexData = new Uint32Array(1); var BatchGeometry = /*#__PURE__*/function (_Geometry$Geometry) { function BatchGeometry() { _classCallCheck(this, BatchGeometry); var vertexSize = 6; var attributeBuffer = new Buffer.Buffer({ data: placeHolderBufferData, label: "attribute-batch-buffer", usage: _const.BufferUsage.VERTEX | _const.BufferUsage.COPY_DST, shrinkToFit: false }); var indexBuffer = new Buffer.Buffer({ data: placeHolderIndexData, label: "index-batch-buffer", usage: _const.BufferUsage.INDEX | _const.BufferUsage.COPY_DST, // | BufferUsage.STATIC, shrinkToFit: false }); var stride = vertexSize * 4; return _callSuper(this, BatchGeometry, [{ attributes: { aPosition: { buffer: attributeBuffer, format: "float32x2", stride: stride, offset: 0 }, aUV: { buffer: attributeBuffer, format: "float32x2", stride: stride, offset: 2 * 4 }, aColor: { buffer: attributeBuffer, format: "unorm8x4", stride: stride, offset: 4 * 4 }, aTextureIdAndRound: { buffer: attributeBuffer, format: "uint16x2", stride: stride, offset: 5 * 4 } }, indexBuffer: indexBuffer }]); } _inherits(BatchGeometry, _Geometry$Geometry); return _createClass(BatchGeometry); }(Geometry.Geometry); exports.BatchGeometry = BatchGeometry; /***/ }), /***/ 32012: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function extractOutputs(fragmentSource, out) { var match; var regex = /@out\s+([^;]+);/g; while ((match = regex.exec(fragmentSource)) !== null) { out.push(match[1]); } } function extractVariableName(value) { var regex = /\b(\w+)\s*:/g; var match = regex.exec(value); return match ? match[1] : ""; } function stripVariable(value) { var regex = /@.*?\s+/g; return value.replace(regex, ""); } function compileOutputs(fragments, template) { var results = []; extractOutputs(template, results); fragments.forEach(function (fragment) { if (fragment.header) { extractOutputs(fragment.header, results); } }); var index = 0; var mainStruct = results.sort().map(function (inValue) { if (inValue.indexOf("builtin") > -1) { return inValue; } return "@location(".concat(index++, ") ").concat(inValue); }).join(",\n"); var mainStart = results.sort().map(function (inValue) { return " var ".concat(stripVariable(inValue), ";"); }).join("\n"); var mainEnd = "return VSOutput(\n ".concat(results.sort().map(function (inValue) { return " ".concat(extractVariableName(inValue)); }).join(",\n"), ");"); var compiledCode = template.replace(/@out\s+[^;]+;\s*/g, ""); compiledCode = compiledCode.replace("{{struct}}", "\n".concat(mainStruct, "\n")); compiledCode = compiledCode.replace("{{start}}", "\n".concat(mainStart, "\n")); compiledCode = compiledCode.replace("{{return}}", "\n".concat(mainEnd, "\n")); return compiledCode; } exports.compileOutputs = compileOutputs; /***/ }), /***/ 32160: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var deprecation = __webpack_require__(11225); "use strict"; function getFastGlobalBounds(target, bounds) { deprecation.deprecation("8.7.0", "Use container.getFastGlobalBounds() instead"); return target.getFastGlobalBounds(true, bounds); } exports.getFastGlobalBounds = getFastGlobalBounds; /***/ }), /***/ 32230: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _AbstractScene = _interopRequireDefault(__webpack_require__(33186)); var _OOP = __webpack_require__(64181); var _AllianceObjects = __webpack_require__(2352); var _pixi = __webpack_require__(3635); var _random = __webpack_require__(96212); var _EnemyObjects = __webpack_require__(97779); var _util = __webpack_require__(19330); var _FCore = __webpack_require__(49997); var _FileSaver = __webpack_require__(91494); var _stringGenerate = __webpack_require__(356); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @extends AbstractScene * @constructor */ function PreviewScene() { _AbstractScene["default"].apply(this, arguments); } (0, _OOP.mixClass)(PreviewScene, _AbstractScene["default"]); function normalSaveAs(blob, name, opts) { var URL = window.URL || window.webkitURL; var a = document.createElement('a'); name = name || blob.name || 'download'; a.download = name; a.rel = 'noopener'; if (typeof blob === 'string') { a.href = blob; if (a.origin !== location.origin) { corsEnabled(a.href).then(function (result) { if (result) { download(blob, name, opts); } else { a.target = '_blank'; click(a); } }); } else { click(a); } } else { a.href = URL.createObjectURL(blob); setTimeout(function () {}, opts && opts.revokeTimeout || 4E4); setTimeout(function () { click(a); }, 0); } } function click(node) { try { node.dispatchEvent(new MouseEvent('click')); } catch (e) { var evt = document.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); node.dispatchEvent(evt); } } PreviewScene.prototype.imageSize = { width: 131, height: 131 }; PreviewScene.prototype.imageOffset = { y: 109, x: 131 / 2 }; PreviewScene.prototype.scaleDuration = 1000; PreviewScene.prototype.attack = 1; PreviewScene.prototype.imageRes = 'bo_tri'; PreviewScene.prototype.minScale = 0.9; PreviewScene.prototype.maxScale = 1; PreviewScene.prototype.width = 1; PreviewScene.prototype.height = 1; PreviewScene.prototype.speed = 0.5; PreviewScene.prototype.coins = 3; PreviewScene.prototype.hp = 60; PreviewScene.prototype.create = function () { var _this = this; this.texture = this.assetMng.getTexture('a_nhip'); this.sprite = new _pixi.Sprite(this.texture); this.sprite.x = -this.imageOffset.x; this.sprite.y = -this.imageOffset.y; this.stand = new _pixi.Container(); this.stand.addChild(this.sprite); this.root = new _pixi.Container(); this.root.addChild(this.stand); this.root.x = 200; this.root.y = 200; var width = this.imageSize.width; var height = this.imageSize.height; var oX = this.imageOffset.x; var oY = this.imageOffset.y; /** * @type {HTMLCanvasElement} */ var renderCanvas = (0, _FCore._)({ tag: 'canvas', style: { position: 'fixed', zIndex: 1e8, top: '30px', left: '30px' }, attr: { width: width, height: height } }).addTo(document.body); var a = document.createElement("a"); /** * @type {CanvasRenderingContext2D} */ var renderCtx = renderCanvas.getContext('2d'); var pvCanvas = this.$canvas; var k = 0; var imgIdx = 0; var pre = (0, _stringGenerate.randomIdent)(4); this.$background.addStyle('background', 'white'); var imgList = ['a_nhip', 'bau_dat', 'dao_ln_hot', 'anh_trang', 'tia_nang', 'may', 'bo_tri', 'vi_khuan', 'sau', 'oc_sen', 'nam_benh', 'bo_canh_cung', 'bo_rep', 'ngoc_linh', 'linh_chi', 'ca_phe', 'sau_rieng', 'ca_cao']; var image = this.assetMng.getImage('a_nhip'); var _render = function render() { if (k >= 32) { k = 0; imgIdx++; if (imgIdx >= imgList.length) { return; } image = _this.assetMng.getImage(imgList[imgIdx]); } var imageName = imgList[imgIdx]; var itext = '' + k; if (itext.length < 2) itext = '0' + itext; console.log('Render ' + imageName + ":" + itext); var t = (0, _util.bezierBlend)(k / 32); if (t < 0.5) t = t * 2;else t = (1 - t) * 2; var scaleY = _this.minScale + (_this.maxScale - _this.minScale) * t; renderCtx.clearRect(0, 0, width, height); renderCtx.drawImage(image, 0, 0, width, height, 0, oY - oY * scaleY, width, height * scaleY); renderCanvas.toBlob(function (blob) { normalSaveAs(blob, pre + '_' + imageName + '_' + itext + '.png'); k++; setTimeout(function () { _render(); }, 500); }); }; setTimeout(_render, 100); }; PreviewScene.prototype.update = function (deltaTime) { var key; for (key in this.alliances) { this.alliances[key].update(deltaTime); } for (key in this.enemies) { this.enemies[key].update(deltaTime); } }; PreviewScene.prototype.onStop = function () { Object.values(this.alliances).forEach(function (obj) { return obj.remove(); }); Object.values(this.enemies).forEach(function (obj) { return obj.remove(); }); }; var _default = exports["default"] = PreviewScene; /***/ }), /***/ 32231: /***/ ((module) => { "use strict"; module.exports = earcut; module.exports["default"] = earcut; function earcut(data, holeIndices, dim) { dim = dim || 2; var hasHoles = holeIndices && holeIndices.length, outerLen = hasHoles ? holeIndices[0] * dim : data.length, outerNode = linkedList(data, 0, outerLen, dim, true), triangles = []; if (!outerNode || outerNode.next === outerNode.prev) return triangles; var minX, minY, maxX, maxY, x, y, invSize; if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim); // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox if (data.length > 80 * dim) { minX = maxX = data[0]; minY = maxY = data[1]; for (var i = dim; i < outerLen; i += dim) { x = data[i]; y = data[i + 1]; if (x < minX) minX = x; if (y < minY) minY = y; if (x > maxX) maxX = x; if (y > maxY) maxY = y; } // minX, minY and invSize are later used to transform coords into integers for z-order calculation invSize = Math.max(maxX - minX, maxY - minY); invSize = invSize !== 0 ? 32767 / invSize : 0; } earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0); return triangles; } // create a circular doubly linked list from polygon points in the specified winding order function linkedList(data, start, end, dim, clockwise) { var i, last; if (clockwise === signedArea(data, start, end, dim) > 0) { for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last); } else { for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last); } if (last && equals(last, last.next)) { removeNode(last); last = last.next; } return last; } // eliminate colinear or duplicate points function filterPoints(start, end) { if (!start) return start; if (!end) end = start; var p = start, again; do { again = false; if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) { removeNode(p); p = end = p.prev; if (p === p.next) break; again = true; } else { p = p.next; } } while (again || p !== end); return end; } // main ear slicing loop which triangulates a polygon (given as a linked list) function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) { if (!ear) return; // interlink polygon nodes in z-order if (!pass && invSize) indexCurve(ear, minX, minY, invSize); var stop = ear, prev, next; // iterate through ears, slicing them one by one while (ear.prev !== ear.next) { prev = ear.prev; next = ear.next; if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) { // cut off the triangle triangles.push(prev.i / dim | 0); triangles.push(ear.i / dim | 0); triangles.push(next.i / dim | 0); removeNode(ear); // skipping the next vertex leads to less sliver triangles ear = next.next; stop = next.next; continue; } ear = next; // if we looped through the whole remaining polygon and can't find any more ears if (ear === stop) { // try filtering points and slicing again if (!pass) { earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1); // if this didn't work, try curing all small self-intersections locally } else if (pass === 1) { ear = cureLocalIntersections(filterPoints(ear), triangles, dim); earcutLinked(ear, triangles, dim, minX, minY, invSize, 2); // as a last resort, try splitting the remaining polygon into two } else if (pass === 2) { splitEarcut(ear, triangles, dim, minX, minY, invSize); } break; } } } // check whether a polygon node forms a valid ear with adjacent nodes function isEar(ear) { var a = ear.prev, b = ear, c = ear.next; if (area(a, b, c) >= 0) return false; // reflex, can't be an ear // now make sure we don't have other points inside the potential ear var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y; // triangle bbox; min & max are calculated like this for speed var x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy; var p = c.next; while (p !== a) { if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; p = p.next; } return true; } function isEarHashed(ear, minX, minY, invSize) { var a = ear.prev, b = ear, c = ear.next; if (area(a, b, c) >= 0) return false; // reflex, can't be an ear var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y; // triangle bbox; min & max are calculated like this for speed var x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy; // z-order range for the current triangle bbox; var minZ = zOrder(x0, y0, minX, minY, invSize), maxZ = zOrder(x1, y1, minX, minY, invSize); var p = ear.prevZ, n = ear.nextZ; // look for points inside the triangle in both directions while (p && p.z >= minZ && n && n.z <= maxZ) { if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; p = p.prevZ; if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false; n = n.nextZ; } // look for remaining points in decreasing z-order while (p && p.z >= minZ) { if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; p = p.prevZ; } // look for remaining points in increasing z-order while (n && n.z <= maxZ) { if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false; n = n.nextZ; } return true; } // go through all polygon nodes and cure small local self-intersections function cureLocalIntersections(start, triangles, dim) { var p = start; do { var a = p.prev, b = p.next.next; if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) { triangles.push(a.i / dim | 0); triangles.push(p.i / dim | 0); triangles.push(b.i / dim | 0); // remove two nodes involved removeNode(p); removeNode(p.next); p = start = b; } p = p.next; } while (p !== start); return filterPoints(p); } // try splitting polygon into two and triangulate them independently function splitEarcut(start, triangles, dim, minX, minY, invSize) { // look for a valid diagonal that divides the polygon into two var a = start; do { var b = a.next.next; while (b !== a.prev) { if (a.i !== b.i && isValidDiagonal(a, b)) { // split the polygon in two by the diagonal var c = splitPolygon(a, b); // filter colinear points around the cuts a = filterPoints(a, a.next); c = filterPoints(c, c.next); // run earcut on each half earcutLinked(a, triangles, dim, minX, minY, invSize, 0); earcutLinked(c, triangles, dim, minX, minY, invSize, 0); return; } b = b.next; } a = a.next; } while (a !== start); } // link every hole into the outer loop, producing a single-ring polygon without holes function eliminateHoles(data, holeIndices, outerNode, dim) { var queue = [], i, len, start, end, list; for (i = 0, len = holeIndices.length; i < len; i++) { start = holeIndices[i] * dim; end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; list = linkedList(data, start, end, dim, false); if (list === list.next) list.steiner = true; queue.push(getLeftmost(list)); } queue.sort(compareX); // process holes from left to right for (i = 0; i < queue.length; i++) { outerNode = eliminateHole(queue[i], outerNode); } return outerNode; } function compareX(a, b) { return a.x - b.x; } // find a bridge between vertices that connects hole with an outer ring and and link it function eliminateHole(hole, outerNode) { var bridge = findHoleBridge(hole, outerNode); if (!bridge) { return outerNode; } var bridgeReverse = splitPolygon(bridge, hole); // filter collinear points around the cuts filterPoints(bridgeReverse, bridgeReverse.next); return filterPoints(bridge, bridge.next); } // David Eberly's algorithm for finding a bridge between hole and outer polygon function findHoleBridge(hole, outerNode) { var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m; // find a segment intersected by a ray from the hole's leftmost point to the left; // segment's endpoint with lesser x will be potential connection point do { if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) { var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y); if (x <= hx && x > qx) { qx = x; m = p.x < p.next.x ? p : p.next; if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint } } p = p.next; } while (p !== outerNode); if (!m) return null; // look for points inside the triangle of hole point, segment intersection and endpoint; // if there are no points found, we have a valid connection; // otherwise choose the point of the minimum angle with the ray as connection point var stop = m, mx = m.x, my = m.y, tanMin = Infinity, tan; p = m; do { if (hx >= p.x && p.x >= mx && hx !== p.x && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) { tan = Math.abs(hy - p.y) / (hx - p.x); // tangential if (locallyInside(p, hole) && (tan < tanMin || tan === tanMin && (p.x > m.x || p.x === m.x && sectorContainsSector(m, p)))) { m = p; tanMin = tan; } } p = p.next; } while (p !== stop); return m; } // whether sector in vertex m contains sector in vertex p in the same coordinates function sectorContainsSector(m, p) { return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0; } // interlink polygon nodes in z-order function indexCurve(start, minX, minY, invSize) { var p = start; do { if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize); p.prevZ = p.prev; p.nextZ = p.next; p = p.next; } while (p !== start); p.prevZ.nextZ = null; p.prevZ = null; sortLinked(p); } // Simon Tatham's linked list merge sort algorithm // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html function sortLinked(list) { var i, p, q, e, tail, numMerges, pSize, qSize, inSize = 1; do { p = list; list = null; tail = null; numMerges = 0; while (p) { numMerges++; q = p; pSize = 0; for (i = 0; i < inSize; i++) { pSize++; q = q.nextZ; if (!q) break; } qSize = inSize; while (pSize > 0 || qSize > 0 && q) { if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) { e = p; p = p.nextZ; pSize--; } else { e = q; q = q.nextZ; qSize--; } if (tail) tail.nextZ = e;else list = e; e.prevZ = tail; tail = e; } p = q; } tail.nextZ = null; inSize *= 2; } while (numMerges > 1); return list; } // z-order of a point given coords and inverse of the longer side of data bbox function zOrder(x, y, minX, minY, invSize) { // coords are transformed into non-negative 15-bit integer range x = (x - minX) * invSize | 0; y = (y - minY) * invSize | 0; x = (x | x << 8) & 0x00FF00FF; x = (x | x << 4) & 0x0F0F0F0F; x = (x | x << 2) & 0x33333333; x = (x | x << 1) & 0x55555555; y = (y | y << 8) & 0x00FF00FF; y = (y | y << 4) & 0x0F0F0F0F; y = (y | y << 2) & 0x33333333; y = (y | y << 1) & 0x55555555; return x | y << 1; } // find the leftmost node of a polygon ring function getLeftmost(start) { var p = start, leftmost = start; do { if (p.x < leftmost.x || p.x === leftmost.x && p.y < leftmost.y) leftmost = p; p = p.next; } while (p !== start); return leftmost; } // check if a point lies within a convex triangle function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) { return (cx - px) * (ay - py) >= (ax - px) * (cy - py) && (ax - px) * (by - py) >= (bx - px) * (ay - py) && (bx - px) * (cy - py) >= (cx - px) * (by - py); } // check if a diagonal between two polygon nodes is valid (lies in polygon interior) function isValidDiagonal(a, b) { return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && ( // dones't intersect other edges locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && ( // locally visible area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case } // signed area of a triangle function area(p, q, r) { return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); } // check if two points are equal function equals(p1, p2) { return p1.x === p2.x && p1.y === p2.y; } // check if two segments intersect function intersects(p1, q1, p2, q2) { var o1 = sign(area(p1, q1, p2)); var o2 = sign(area(p1, q1, q2)); var o3 = sign(area(p2, q2, p1)); var o4 = sign(area(p2, q2, q1)); if (o1 !== o2 && o3 !== o4) return true; // general case if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1 if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1 if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2 if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2 return false; } // for collinear points p, q, r, check if point q lies on segment pr function onSegment(p, q, r) { 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); } function sign(num) { return num > 0 ? 1 : num < 0 ? -1 : 0; } // check if a polygon diagonal intersects any polygon segments function intersectsPolygon(a, b) { var p = a; do { if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true; p = p.next; } while (p !== a); return false; } // check if a polygon diagonal is locally inside the polygon function locallyInside(a, b) { return area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0; } // check if the middle point of a polygon diagonal is inside the polygon function middleInside(a, b) { var p = a, inside = false, px = (a.x + b.x) / 2, py = (a.y + b.y) / 2; do { if (p.y > py !== p.next.y > py && p.next.y !== p.y && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x) inside = !inside; p = p.next; } while (p !== a); return inside; } // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; // if one belongs to the outer ring and another to a hole, it merges it into a single ring function splitPolygon(a, b) { var a2 = new Node(a.i, a.x, a.y), b2 = new Node(b.i, b.x, b.y), an = a.next, bp = b.prev; a.next = b; b.prev = a; a2.next = an; an.prev = a2; b2.next = a2; a2.prev = b2; bp.next = b2; b2.prev = bp; return b2; } // create a node and optionally link it with previous one (in a circular doubly linked list) function insertNode(i, x, y, last) { var p = new Node(i, x, y); if (!last) { p.prev = p; p.next = p; } else { p.next = last.next; p.prev = last; last.next.prev = p; last.next = p; } return p; } function removeNode(p) { p.next.prev = p.prev; p.prev.next = p.next; if (p.prevZ) p.prevZ.nextZ = p.nextZ; if (p.nextZ) p.nextZ.prevZ = p.prevZ; } function Node(i, x, y) { // vertex index in coordinates array this.i = i; // vertex coordinates this.x = x; this.y = y; // previous and next vertex nodes in a polygon ring this.prev = null; this.next = null; // z-order curve value this.z = 0; // previous and next nodes in z-order this.prevZ = null; this.nextZ = null; // indicates whether this is a steiner point this.steiner = false; } // return a percentage difference between the polygon area and its triangulation area; // used to verify correctness of triangulation earcut.deviation = function (data, holeIndices, dim, triangles) { var hasHoles = holeIndices && holeIndices.length; var outerLen = hasHoles ? holeIndices[0] * dim : data.length; var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim)); if (hasHoles) { for (var i = 0, len = holeIndices.length; i < len; i++) { var start = holeIndices[i] * dim; var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; polygonArea -= Math.abs(signedArea(data, start, end, dim)); } } var trianglesArea = 0; for (i = 0; i < triangles.length; i += 3) { var a = triangles[i] * dim; var b = triangles[i + 1] * dim; var c = triangles[i + 2] * dim; trianglesArea += Math.abs((data[a] - data[c]) * (data[b + 1] - data[a + 1]) - (data[a] - data[b]) * (data[c + 1] - data[a + 1])); } return polygonArea === 0 && trianglesArea === 0 ? 0 : Math.abs((trianglesArea - polygonArea) / polygonArea); }; function signedArea(data, start, end, dim) { var sum = 0; for (var i = start, j = end - dim; i < end; i += dim) { sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]); j = i; } return sum; } // turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts earcut.flatten = function (data) { var dim = data[0][0].length, result = { vertices: [], holes: [], dimensions: dim }, holeIndex = 0; for (var i = 0; i < data.length; i++) { for (var j = 0; j < data[i].length; j++) { for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]); } if (i > 0) { holeIndex += data[i - 1].length; result.holes.push(holeIndex); } } return result; }; /***/ }), /***/ 32632: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _ContextManager = _interopRequireDefault(__webpack_require__(52962)); var _GrandContext = _interopRequireDefault(__webpack_require__(60517)); var _OOP = _interopRequireDefault(__webpack_require__(64181)); var _noop = _interopRequireDefault(__webpack_require__(37530)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /*** * @extends GrandContext * @constructor */ function Fragment() { _GrandContext["default"].call(this); } _OOP["default"].mixClass(Fragment, _GrandContext["default"]); Fragment.prototype.createView = function () { throw new Error("Not implement!"); }; Fragment.prototype.getView = function () { if (this.$view) return this.$view; this.$view = this.createView() || this.$view; if (!this.$view) throw new Error("this.$view must be not null!"); if (this.onCreated) this.onCreated(); return this.$view; }; Fragment.prototype.onCreated = _noop["default"]; Fragment.prototype.revokeResource = function () { this.destroy(); }; var _default = exports["default"] = Fragment; /***/ }), /***/ 32680: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var buildAdaptiveBezier = __webpack_require__(80556); "use strict"; var TAU = Math.PI * 2; var out = { centerX: 0, centerY: 0, ang1: 0, ang2: 0 }; var mapToEllipse = function mapToEllipse(_ref, rx, ry, cosPhi, sinPhi, centerX, centerY, out2) { var x = _ref.x, y = _ref.y; x *= rx; y *= ry; var xp = cosPhi * x - sinPhi * y; var yp = sinPhi * x + cosPhi * y; out2.x = xp + centerX; out2.y = yp + centerY; return out2; }; function approxUnitArc(ang1, ang2) { var a1 = ang2 === -1.5707963267948966 ? -0.551915024494 : 4 / 3 * Math.tan(ang2 / 4); var a = ang2 === 1.5707963267948966 ? 0.551915024494 : a1; var x1 = Math.cos(ang1); var y1 = Math.sin(ang1); var x2 = Math.cos(ang1 + ang2); var y2 = Math.sin(ang1 + ang2); return [{ x: x1 - y1 * a, y: y1 + x1 * a }, { x: x2 + y2 * a, y: y2 - x2 * a }, { x: x2, y: y2 }]; } var vectorAngle = function vectorAngle(ux, uy, vx, vy) { var sign = ux * vy - uy * vx < 0 ? -1 : 1; var dot = ux * vx + uy * vy; if (dot > 1) { dot = 1; } if (dot < -1) { dot = -1; } return sign * Math.acos(dot); }; var getArcCenter = function getArcCenter(px, py, cx, cy, rx, ry, largeArcFlag, sweepFlag, sinPhi, cosPhi, pxp, pyp, out2) { var rxSq = Math.pow(rx, 2); var rySq = Math.pow(ry, 2); var pxpSq = Math.pow(pxp, 2); var pypSq = Math.pow(pyp, 2); var radicant = rxSq * rySq - rxSq * pypSq - rySq * pxpSq; if (radicant < 0) { radicant = 0; } radicant /= rxSq * pypSq + rySq * pxpSq; radicant = Math.sqrt(radicant) * (largeArcFlag === sweepFlag ? -1 : 1); var centerXp = radicant * rx / ry * pyp; var centerYp = radicant * -ry / rx * pxp; var centerX = cosPhi * centerXp - sinPhi * centerYp + (px + cx) / 2; var centerY = sinPhi * centerXp + cosPhi * centerYp + (py + cy) / 2; var vx1 = (pxp - centerXp) / rx; var vy1 = (pyp - centerYp) / ry; var vx2 = (-pxp - centerXp) / rx; var vy2 = (-pyp - centerYp) / ry; var ang1 = vectorAngle(1, 0, vx1, vy1); var ang2 = vectorAngle(vx1, vy1, vx2, vy2); if (sweepFlag === 0 && ang2 > 0) { ang2 -= TAU; } if (sweepFlag === 1 && ang2 < 0) { ang2 += TAU; } out2.centerX = centerX; out2.centerY = centerY; out2.ang1 = ang1; out2.ang2 = ang2; }; function buildArcToSvg(points, px, py, cx, cy, rx, ry) { var xAxisRotation = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0; var largeArcFlag = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 0; var sweepFlag = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : 0; if (rx === 0 || ry === 0) { return; } var sinPhi = Math.sin(xAxisRotation * TAU / 360); var cosPhi = Math.cos(xAxisRotation * TAU / 360); var pxp = cosPhi * (px - cx) / 2 + sinPhi * (py - cy) / 2; var pyp = -sinPhi * (px - cx) / 2 + cosPhi * (py - cy) / 2; if (pxp === 0 && pyp === 0) { return; } rx = Math.abs(rx); ry = Math.abs(ry); var lambda = Math.pow(pxp, 2) / Math.pow(rx, 2) + Math.pow(pyp, 2) / Math.pow(ry, 2); if (lambda > 1) { rx *= Math.sqrt(lambda); ry *= Math.sqrt(lambda); } getArcCenter(px, py, cx, cy, rx, ry, largeArcFlag, sweepFlag, sinPhi, cosPhi, pxp, pyp, out); var ang1 = out.ang1, ang2 = out.ang2; var centerX = out.centerX, centerY = out.centerY; var ratio = Math.abs(ang2) / (TAU / 4); if (Math.abs(1 - ratio) < 1e-7) { ratio = 1; } var segments = Math.max(Math.ceil(ratio), 1); ang2 /= segments; var lastX = points[points.length - 2]; var lastY = points[points.length - 1]; var outCurvePoint = { x: 0, y: 0 }; for (var i = 0; i < segments; i++) { var curve = approxUnitArc(ang1, ang2); var _mapToEllipse = mapToEllipse(curve[0], rx, ry, cosPhi, sinPhi, centerX, centerY, outCurvePoint), x1 = _mapToEllipse.x, y1 = _mapToEllipse.y; var _mapToEllipse2 = mapToEllipse(curve[1], rx, ry, cosPhi, sinPhi, centerX, centerY, outCurvePoint), x2 = _mapToEllipse2.x, y2 = _mapToEllipse2.y; var _mapToEllipse3 = mapToEllipse(curve[2], rx, ry, cosPhi, sinPhi, centerX, centerY, outCurvePoint), x = _mapToEllipse3.x, y = _mapToEllipse3.y; buildAdaptiveBezier.buildAdaptiveBezier(points, lastX, lastY, x1, y1, x2, y2, x, y); lastX = x; lastY = y; ang1 += ang2; } } exports.buildArcToSvg = buildArcToSvg; /***/ }), /***/ 33102: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var findHooksRx = /\{\{(.*?)\}\}/g; function compileHooks(programSrc) { var _programSrc$match$map, _programSrc$match; var parts = {}; var partMatches = (_programSrc$match$map = (_programSrc$match = programSrc.match(findHooksRx)) === null || _programSrc$match === void 0 ? void 0 : _programSrc$match.map(function (hook) { return hook.replace(/[{()}]/g, ""); })) !== null && _programSrc$match$map !== void 0 ? _programSrc$match$map : []; partMatches.forEach(function (hook) { parts[hook] = []; }); return parts; } exports.compileHooks = compileHooks; exports.findHooksRx = findHooksRx; /***/ }), /***/ 33173: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var compressedFormatMap = { "bc1-rgba-unorm": true, "bc1-rgba-unorm-srgb": true, "bc2-rgba-unorm": true, "bc2-rgba-unorm-srgb": true, "bc3-rgba-unorm": true, "bc3-rgba-unorm-srgb": true, "bc4-r-unorm": true, "bc4-r-snorm": true, "bc5-rg-unorm": true, "bc5-rg-snorm": true, "bc6h-rgb-ufloat": true, "bc6h-rgb-float": true, "bc7-rgba-unorm": true, "bc7-rgba-unorm-srgb": true, // ETC2 compressed formats usable if "texture-compression-etc2" is both // supported by the device/user agent and enabled in requestDevice. "etc2-rgb8unorm": true, "etc2-rgb8unorm-srgb": true, "etc2-rgb8a1unorm": true, "etc2-rgb8a1unorm-srgb": true, "etc2-rgba8unorm": true, "etc2-rgba8unorm-srgb": true, "eac-r11unorm": true, "eac-r11snorm": true, "eac-rg11unorm": true, "eac-rg11snorm": true, // ASTC compressed formats usable if "texture-compression-astc" is both // supported by the device/user agent and enabled in requestDevice. "astc-4x4-unorm": true, "astc-4x4-unorm-srgb": true, "astc-5x4-unorm": true, "astc-5x4-unorm-srgb": true, "astc-5x5-unorm": true, "astc-5x5-unorm-srgb": true, "astc-6x5-unorm": true, "astc-6x5-unorm-srgb": true, "astc-6x6-unorm": true, "astc-6x6-unorm-srgb": true, "astc-8x5-unorm": true, "astc-8x5-unorm-srgb": true, "astc-8x6-unorm": true, "astc-8x6-unorm-srgb": true, "astc-8x8-unorm": true, "astc-8x8-unorm-srgb": true, "astc-10x5-unorm": true, "astc-10x5-unorm-srgb": true, "astc-10x6-unorm": true, "astc-10x6-unorm-srgb": true, "astc-10x8-unorm": true, "astc-10x8-unorm-srgb": true, "astc-10x10-unorm": true, "astc-10x10-unorm-srgb": true, "astc-12x10-unorm": true, "astc-12x10-unorm-srgb": true, "astc-12x12-unorm": true, "astc-12x12-unorm-srgb": true }; var glUploadCompressedTextureResource = { id: "compressed", upload: function upload(source, glTexture, gl) { gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4); var mipWidth = source.pixelWidth; var mipHeight = source.pixelHeight; var compressed = !!compressedFormatMap[source.format]; for (var i = 0; i < source.resource.length; i++) { var levelBuffer = source.resource[i]; if (compressed) { gl.compressedTexImage2D(gl.TEXTURE_2D, i, glTexture.internalFormat, mipWidth, mipHeight, 0, levelBuffer); } else { gl.texImage2D(gl.TEXTURE_2D, i, glTexture.internalFormat, mipWidth, mipHeight, 0, glTexture.format, glTexture.type, levelBuffer); } mipWidth = Math.max(mipWidth >> 1, 1); mipHeight = Math.max(mipHeight >> 1, 1); } } }; exports.glUploadCompressedTextureResource = glUploadCompressedTextureResource; /***/ }), /***/ 33186: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _GrandContext = _interopRequireDefault(__webpack_require__(60517)); var _OOP = __webpack_require__(64181); var _pixi = __webpack_require__(3635); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @param {FlavorAdventure} app * @param {object} bundle * @extends GrandContext * @constructor */ function AbstractScene(app, bundle) { _GrandContext["default"].apply(this, arguments); this.app = app; this.bundle = bundle; this.$foreground = this.app.$foreground; this.$canvas = this.app.$canvas; /** * * @type {import("pixi.js").Application<Renderer>} */ this.pixi = this.app.pixi; this.$background = this.app.$background; /** * * @type {AssetManager} */ this.assetMng = this.app.assetMng; this.create(); /** * @type {FlavorAdventure} * @name parent * @memberof AbstractScene# */ } (0, _OOP.mixClass)(AbstractScene, _GrandContext["default"]); AbstractScene.prototype.update = function (deltaTime) { // console.log(deltaTime); // This method can be overridden by subclasses to update the scene }; AbstractScene.prototype.attach = function (parent) { this.$background = parent.$background; this.$foreground = parent.$foreground; this.$canvas = parent.$canvas; /** * * @type {FlavorAdventure} */ this.app = parent.app; this.pixi = parent.pixi; this.assetMng = parent.assetMng; _GrandContext["default"].prototype.attach.call(this, parent); }; AbstractScene.prototype.create = function () {}; AbstractScene.prototype.onPointerDown = function (point) {}; AbstractScene.prototype.onPointerUp = function (point) {}; var _default = exports["default"] = AbstractScene; /***/ }), /***/ 33490: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function isRenderingToScreen(renderTarget) { var resource = renderTarget.colorTexture.source.resource; return globalThis.HTMLCanvasElement && resource instanceof HTMLCanvasElement && document.body.contains(resource); } exports.isRenderingToScreen = isRenderingToScreen; /***/ }), /***/ 33552: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var adapter = __webpack_require__(72450); "use strict"; function isSafari() { var _adapter$DOMAdapter$g = adapter.DOMAdapter.get().getNavigator(), userAgent = _adapter$DOMAdapter$g.userAgent; return /^((?!chrome|android).)*safari/i.test(userAgent); } exports.isSafari = isSafari; /***/ }), /***/ 33634: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); var testImageFormat = __webpack_require__(13714); "use strict"; var detectAvif = { extension: { type: Extensions.ExtensionType.DetectionParser, priority: 1 }, test: function () { var _test = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: return _context.a(2, testImageFormat.testImageFormat( // eslint-disable-next-line max-len "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=")); } }, _callee); })); function test() { return _test.apply(this, arguments); } return test; }(), add: function () { var _add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(formats) { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: return _context2.a(2, [].concat(_toConsumableArray(formats), ["avif"])); } }, _callee2); })); function add(_x) { return _add.apply(this, arguments); } return add; }(), remove: function () { var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(formats) { return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: return _context3.a(2, formats.filter(function (f) { return f !== "avif"; })); } }, _callee3); })); function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() }; exports.detectAvif = detectAvif; /***/ }), /***/ 33843: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var BufferUsage = /* @__PURE__ */function (BufferUsage2) { BufferUsage2[BufferUsage2["MAP_READ"] = 1] = "MAP_READ"; BufferUsage2[BufferUsage2["MAP_WRITE"] = 2] = "MAP_WRITE"; BufferUsage2[BufferUsage2["COPY_SRC"] = 4] = "COPY_SRC"; BufferUsage2[BufferUsage2["COPY_DST"] = 8] = "COPY_DST"; BufferUsage2[BufferUsage2["INDEX"] = 16] = "INDEX"; BufferUsage2[BufferUsage2["VERTEX"] = 32] = "VERTEX"; BufferUsage2[BufferUsage2["UNIFORM"] = 64] = "UNIFORM"; BufferUsage2[BufferUsage2["STORAGE"] = 128] = "STORAGE"; BufferUsage2[BufferUsage2["INDIRECT"] = 256] = "INDIRECT"; BufferUsage2[BufferUsage2["QUERY_RESOLVE"] = 512] = "QUERY_RESOLVE"; BufferUsage2[BufferUsage2["STATIC"] = 1024] = "STATIC"; return BufferUsage2; }(BufferUsage || {}); exports.BufferUsage = BufferUsage; /***/ }), /***/ 33925: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function createIndicesForQuads(size) { var outBuffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var totalIndices = size * 6; if (totalIndices > 65535) { outBuffer || (outBuffer = new Uint32Array(totalIndices)); } else { outBuffer || (outBuffer = new Uint16Array(totalIndices)); } if (outBuffer.length !== totalIndices) { throw new Error("Out buffer length is incorrect, got ".concat(outBuffer.length, " and expected ").concat(totalIndices)); } for (var i = 0, j = 0; i < totalIndices; i += 6, j += 4) { outBuffer[i + 0] = j + 0; outBuffer[i + 1] = j + 1; outBuffer[i + 2] = j + 2; outBuffer[i + 3] = j + 0; outBuffer[i + 4] = j + 2; outBuffer[i + 5] = j + 3; } return outBuffer; } exports.createIndicesForQuads = createIndicesForQuads; /***/ }), /***/ 34060: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function squaredDistanceToLineSegment(x, y, x1, y1, x2, y2) { var a = x - x1; var b = y - y1; var c = x2 - x1; var d = y2 - y1; var dot = a * c + b * d; var lenSq = c * c + d * d; var param = -1; if (lenSq !== 0) { param = dot / lenSq; } var xx; var yy; if (param < 0) { xx = x1; yy = y1; } else if (param > 1) { xx = x2; yy = y2; } else { xx = x1 + param * c; yy = y1 + param * d; } var dx = x - xx; var dy = y - yy; return dx * dx + dy * dy; } exports.squaredDistanceToLineSegment = squaredDistanceToLineSegment; /***/ }), /***/ 34073: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _AElement = _interopRequireDefault(__webpack_require__(94278)); var _OOP = _interopRequireDefault(__webpack_require__(64181)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /*** * @augments AElement * @augments SVGGraphicsElement * @constructor */ function AElementNS() { _AElement["default"].call(this); } _AElement["default"].prototype.afterAttached = function () { if (this.isDescendantOf(document.body)) return Promise.resolve(); var attachHookElt = this.$attachhook || this.querySelector('.absol-attachhook'); if (!attachHookElt) { var constructor; if (this.tagName.toLowerCase() === 'svg' || this.getBBox) { attachHookElt = document.createElementNS('http://www.w3.org/2000/svg', 'image'); attachHookElt.setAttributeNS(null, 'href', ''); constructor = AElementNS; } else { attachHookElt = document.createElement('img'); attachHookElt.src = ''; constructor = AElementNS; } attachHookElt.classList.add('absol-attachhook'); Object.assign(attachHookElt, constructor.prototype); constructor.call(attachHookElt); attachHookElt.defineEvent('attached'); this.$attachhook = attachHookElt; this.$attachhook.on('error', function (event) { if (this.isDescendantOf(document.body)) this.emit('attached', event, this); }); this.appendChild(attachHookElt); } return new Promise(function (rs) { attachHookElt.once('attached', rs); }); }; _OOP["default"].mixClass(AElementNS, _AElement["default"]); AElementNS.prototype.attr = function () { if (arguments.length == 1) { if (typeof arguments[0] == 'string') { if (this._azar_extendAttributes[arguments[0]]) { return this._azar_extendAttributes[arguments[0]].get.call(this); } else return this.getAttributeNS(null, arguments[0]); } else { for (var key in arguments[0]) { this.attr(key, arguments[0][key]); } } } else { if (arguments.length == 2) { if (arguments[1] === null || arguments[1] === undefined) { if (this._azar_extendAttributes[arguments[0]]) { this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]); } else this.removeAttributeNS(null, arguments[0]); } else { if (this._azar_extendAttributes[arguments[0]]) { this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]); } else { this.setAttributeNS(null, arguments[0], arguments[1]); } } } } return this; }; var _default = exports["default"] = AElementNS; /***/ }), /***/ 34102: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var sayHello = __webpack_require__(59668); var types = __webpack_require__(9634); "use strict"; var HelloSystem = /*#__PURE__*/function () { function HelloSystem(renderer) { _classCallCheck(this, HelloSystem); this._renderer = renderer; } /** * It all starts here! This initiates every system, passing in the options for any system by name. * @param options - the config for the renderer and all its systems */ return _createClass(HelloSystem, [{ key: "init", value: function init(options) { if (options.hello) { var name = this._renderer.name; if (this._renderer.type === types.RendererType.WEBGL) { name += " ".concat(this._renderer.context.webGLVersion); } sayHello.sayHello(name); } } }]); }(); /** @ignore */ HelloSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "hello", priority: -2 }; /** The default options for the system. */ HelloSystem.defaultOptions = { /** {@link WebGLOptions.hello} */ hello: false }; exports.HelloSystem = HelloSystem; /***/ }), /***/ 34278: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var vertTemplate = "\n in vec2 aPosition;\n\n uniform float uStrength;\n\n out vec2 vBlurTexCoords[%size%];\n\n uniform vec4 uInputSize;\n uniform vec4 uOutputFrame;\n uniform vec4 uOutputTexture;\n\n vec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\n vec2 filterTextureCoord( void )\n {\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n float pixelStrength = uInputSize.%dimension% * uStrength;\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }"; function generateBlurVertSource(kernelSize, x) { var halfLength = Math.ceil(kernelSize / 2); var vertSource = vertTemplate; var blurLoop = ""; var template; if (x) { template = "vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * pixelStrength, 0.0);"; } else { template = "vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * pixelStrength);"; } for (var i = 0; i < kernelSize; i++) { var blur = template.replace("%index%", i.toString()); blur = blur.replace("%sampleIndex%", "".concat(i - (halfLength - 1), ".0")); blurLoop += blur; blurLoop += "\n"; } vertSource = vertSource.replace("%blur%", blurLoop); vertSource = vertSource.replace("%size%", kernelSize.toString()); vertSource = vertSource.replace("%dimension%", x ? "z" : "w"); return vertSource; } exports.generateBlurVertSource = generateBlurVertSource; /***/ }), /***/ 34400: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var uid = __webpack_require__(90844); var createIdFromString = __webpack_require__(79471); var types = __webpack_require__(4386); var getDefaultUniformValue = __webpack_require__(15489); "use strict"; var _UniformGroup = /*#__PURE__*/function () { /** * Create a new Uniform group * @param uniformStructures - The structures of the uniform group * @param options - The optional parameters of this uniform group */ function _UniformGroup(uniformStructures, options) { _classCallCheck(this, _UniformGroup); /** used internally to know if a uniform group was used in the last render pass */ this._touched = 0; /** a unique id for this uniform group used through the renderer */ this.uid = uid.uid("uniform"); /** a resource type, used to identify how to handle it when its in a bind group / shader resource */ this._resourceType = "uniformGroup"; /** the resource id used internally by the renderer to build bind group keys */ this._resourceId = uid.uid("resource"); /** used ito identify if this is a uniform group */ this.isUniformGroup = true; /** * used to flag if this Uniform groups data is different from what it has stored in its buffer / on the GPU * @internal * @ignore */ this._dirtyId = 0; // implementing the interface - UniformGroup are not destroyed this.destroyed = false; options = _objectSpread(_objectSpread({}, _UniformGroup.defaultOptions), options); this.uniformStructures = uniformStructures; var uniforms = {}; for (var i in uniformStructures) { var _uniformData$size, _uniformData$value; var uniformData = uniformStructures[i]; uniformData.name = i; uniformData.size = (_uniformData$size = uniformData.size) !== null && _uniformData$size !== void 0 ? _uniformData$size : 1; if (!types.UNIFORM_TYPES_MAP[uniformData.type]) { throw new Error("Uniform type ".concat(uniformData.type, " is not supported. Supported uniform types are: ").concat(types.UNIFORM_TYPES_VALUES.join(", "))); } (_uniformData$value = uniformData.value) !== null && _uniformData$value !== void 0 ? _uniformData$value : uniformData.value = getDefaultUniformValue.getDefaultUniformValue(uniformData.type, uniformData.size); uniforms[i] = uniformData.value; } this.uniforms = uniforms; this._dirtyId = 1; this.ubo = options.ubo; this.isStatic = options.isStatic; this._signature = createIdFromString.createIdFromString(Object.keys(uniforms).map(function (i) { return "".concat(i, "-").concat(uniformStructures[i].type); }).join("-"), "uniform-group"); } /** Call this if you want the uniform groups data to be uploaded to the GPU only useful if `isStatic` is true. */ return _createClass(_UniformGroup, [{ key: "update", value: function update() { this._dirtyId++; } }]); }(); /** The default options used by the uniform group. */ _UniformGroup.defaultOptions = { /** if true the UniformGroup is handled as an Uniform buffer object. */ ubo: false, /** if true, then you are responsible for when the data is uploaded to the GPU by calling `update()` */ isStatic: false }; var UniformGroup = _UniformGroup; exports.UniformGroup = UniformGroup; /***/ }), /***/ 34413: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var getAttributeInfoFromFormat = __webpack_require__(63421); "use strict"; function generateParticleUpdateFunction(properties) { return { dynamicUpdate: generateUpdateFunction(properties, true), staticUpdate: generateUpdateFunction(properties, false) }; } function generateUpdateFunction(properties, dynamic) { var funcFragments = []; funcFragments.push("\n \n var index = 0;\n\n for (let i = 0; i < ps.length; ++i)\n {\n const p = ps[i];\n\n "); var offset = 0; for (var i in properties) { var property = properties[i]; if (dynamic !== property.dynamic) continue; funcFragments.push("offset = index + ".concat(offset)); funcFragments.push(property.code); var attributeInfo = getAttributeInfoFromFormat.getAttributeInfoFromFormat(property.format); offset += attributeInfo.stride / 4; } funcFragments.push("\n index += stride * 4;\n }\n "); funcFragments.unshift("\n var stride = ".concat(offset, ";\n ")); var functionSource = funcFragments.join("\n"); return new Function("ps", "f32v", "u32v", functionSource); } exports.generateParticleUpdateFunction = generateParticleUpdateFunction; /***/ }), /***/ 34453: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var autoDetectRenderer = __webpack_require__(68556); var Container = __webpack_require__(47719); var globalHooks = __webpack_require__(28488); var deprecation = __webpack_require__(11225); "use strict"; var _Application = /*#__PURE__*/function () { /** @ignore */ function _Application() { _classCallCheck(this, _Application); /** The root display container that's rendered. */ this.stage = new Container.Container(); if ((arguments.length <= 0 ? undefined : arguments[0]) !== void 0) { deprecation.deprecation(deprecation.v8_0_0, "Application constructor options are deprecated, please use Application.init() instead."); } } /** * @param options - The optional application and renderer parameters. */ return _createClass(_Application, [{ key: "init", value: (function () { var _init = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) { var _this = this; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: options = _objectSpread({}, options); _context.n = 1; return autoDetectRenderer.autoDetectRenderer(options); case 1: this.renderer = _context.v; _Application._plugins.forEach(function (plugin) { plugin.init.call(_this, options); }); case 2: return _context.a(2); } }, _callee, this); })); function init(_x) { return _init.apply(this, arguments); } return init; }() /** Render the current stage. */) }, { key: "render", value: function render() { this.renderer.render({ container: this.stage }); } /** * Reference to the renderer's canvas element. * @readonly * @member {HTMLCanvasElement} */ }, { key: "canvas", get: function get() { return this.renderer.canvas; } /** * Reference to the renderer's canvas element. * @member {HTMLCanvasElement} * @deprecated since 8.0.0 */ }, { key: "view", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "Application.view is deprecated, please use Application.canvas instead."); return this.renderer.canvas; } /** * Reference to the renderer's screen rectangle. Its safe to use as `filterArea` or `hitArea` for the whole screen. * @readonly */ }, { key: "screen", get: function get() { return this.renderer.screen; } /** * Destroys the application and all of its resources. * @param {object|boolean}[rendererDestroyOptions=false] - The options for destroying the renderer. * @param {boolean}[rendererDestroyOptions.removeView=false] - Removes the Canvas element from the DOM. * @param {object|boolean} [options=false] - The options for destroying the stage. * @param {boolean} [options.children=false] - If set to true, all the children will have their destroy method * called as well. `options` will be passed on to those calls. * @param {boolean} [options.texture=false] - Only used for children with textures e.g. Sprites. * If options.children is set to true, * it should destroy the texture of the child sprite. * @param {boolean} [options.textureSource=false] - Only used for children with textures e.g. Sprites. * If options.children is set to true, * it should destroy the texture source of the child sprite. * @param {boolean} [options.context=false] - Only used for children with graphicsContexts e.g. Graphics. * If options.children is set to true, * it should destroy the context of the child graphics. */ }, { key: "destroy", value: function destroy() { var _this2 = this; var rendererDestroyOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var plugins = _Application._plugins.slice(0); plugins.reverse(); plugins.forEach(function (plugin) { plugin.destroy.call(_this2); }); this.stage.destroy(options); this.stage = null; this.renderer.destroy(rendererDestroyOptions); this.renderer = null; } }]); }(); /** * Collection of installed plugins. * @alias _plugins */ _Application._plugins = []; var Application = _Application; Extensions.extensions.handleByList(Extensions.ExtensionType.Application, Application._plugins); Extensions.extensions.add(globalHooks.ApplicationInitHook); exports.Application = Application; /***/ }), /***/ 34478: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _Vec = _interopRequireDefault(__webpack_require__(28239)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height */ function Rectangle(x, y, width, height) { this.width = width; this.height = height; this.x = x; this.y = y; } /** * * @return {Vec2} * @constructor */ Rectangle.prototype.A = function () { return new _Vec["default"](this.x, this.y); }; /*** * * @return {Vec2} * @constructor */ Rectangle.prototype.B = function () { return new _Vec["default"](this.x + this.width, this.y); }; /*** * * @return {Vec2} * @constructor */ Rectangle.prototype.C = function () { return new _Vec["default"](this.x + this.width, this.y + this.height); }; /*** * * @return {Vec2} * @constructor */ Rectangle.prototype.D = function () { return new _Vec["default"](this.x, this.y + this.height); }; /*** * * @return {number} */ Rectangle.prototype.square = function () { return this.width * this.height; }; Rectangle.prototype.nearestPoint = function (arg0, arg1) { if (arg1) arg0 = _Vec["default"].make(arg0, arg1); var res = this.A(); var mind = res.dist(arg0); var d = this.B().dist(arg0); if (d < mind) { mind = d; res = this.B(); } d = this.C().dist(arg0); if (d < mind) { mind = d; res = this.C(); } d = this.D().dist(arg0); if (d < mind) { mind = d; res = this.D(); } return res; }; Rectangle.prototype.centerPoint = function () { return new _Vec["default"](this.x + this.width / 2, this.y + this.height / 2); }; /*** * * @param {Rectangle} r * @param {number=} margin * @return {boolean} */ Rectangle.prototype.isCollapse = function (r, margin) { if (!margin) margin = 0; return !(this.x >= r.x + r.width + margin || this.y >= r.y + r.height + margin || r.x >= this.x + this.width + margin || r.y >= this.y + this.height + margin); }; /*** * * @param {Rectangle} r * @return {number} */ Rectangle.prototype.collapsedSquare = function (r) { var collapseRect = this.collapsedRect(r); if (collapseRect) { return collapseRect.square(); } else { return 0; } }; /*** * * @param {Rectangle} r * @return {Rectangle} */ Rectangle.prototype.collapsedRect = function (r) { var maxX, minX, maxY, minY, width, height; minX = Math.max(this.x, r.x); minY = Math.max(this.y, r.y); maxX = Math.min(this.x + this.width, r.x + r.width); maxY = Math.min(this.y + this.height, r.y + r.height); width = maxX - minX; height = maxY - minY; if (width >= 0 && height >= 0) { return new Rectangle(minX, minY, width, height); } return null; }; /** * @param {Rectangle} r * @returns {Boolean} */ Rectangle.prototype.contains = function (r) { return this.x <= r.x && this.y <= r.y && this.x + this.width >= r.x + r.width && this.y + this.height >= r.y + r.height; }; /** * @param {Vec2} p * @returns {Boolean} */ Rectangle.prototype.containsPoint = function (p) { return this.x <= p.x && this.y <= p.y && this.x + this.width >= p.x && this.y + this.height >= p.y; }; /** * @param {Rectangle} other * @returns {Rectangle} */ Rectangle.prototype.merge = function (other) { var left = Math.min(this.x, other.x); var top = Math.min(this.y, other.y); var right = Math.max(this.x + this.width, other.x + other.width); var bottom = Math.max(this.y + this.height, other.y + other.height); return new Rectangle(left, top, right - left, bottom - top); }; /** * @returns {Rectangle} */ Rectangle.prototype.copy = function () { return new Rectangle(this.x, this.y, this.width, this.height); }; /** * @returns {Rectangle} */ Rectangle.prototype.clone = function () { return this.copy(); }; /*** * * @param {Rectangle} r */ Rectangle.prototype.equals = function (r) { return this.x === r.x && this.y === r.y && this.height === r.height && this.width === r.width; }; /** * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height * @returns {Rectangle} */ Rectangle.make = function (x, y, width, height) { return new Rectangle(x, y, width, height); }; /** * @param {Number} x * @param {Number} y * @param {Number} width * @param {Number} height * @returns {Rectangle} */ Rectangle.makeCenter = function (x, y, width, height) { return new Rectangle(x - width / 2, y - height / 2, width, height); }; /** * @param {ClientRect|DOMRect} clientRect * @returns {Rectangle} */ Rectangle.fromClientRect = function (clientRect) { return new Rectangle(clientRect.left, clientRect.top, clientRect.width, clientRect.height); }; /*** * * @param {Vec2[]} points * @returns {Rectangle} */ Rectangle.boundingPoints = function (points) { var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity; var point; for (var i = 0; i < points.length; ++i) { point = points[i]; minX = Math.min(minX, point.x); maxX = Math.max(maxX, point.x); minY = Math.min(minY, point.y); maxY = Math.max(maxY, point.y); } return new Rectangle(minX, minY, maxX - minX, maxY - minY); }; var _default = exports["default"] = Rectangle; /***/ }), /***/ 34924: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 34979: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var groupD8 = __webpack_require__(56018); var Matrix = __webpack_require__(20764); var _const = __webpack_require__(83987); var pow2 = __webpack_require__(52878); __webpack_require__(7107); var squaredDistanceToLineSegment = __webpack_require__(34060); var ObservablePoint = __webpack_require__(14823); var Point = __webpack_require__(75544); __webpack_require__(63232); var pointInTriangle = __webpack_require__(89675); __webpack_require__(85503); var Circle = __webpack_require__(37764); var Ellipse = __webpack_require__(10816); var Polygon = __webpack_require__(53932); var Rectangle = __webpack_require__(74731); var RoundedRectangle = __webpack_require__(54122); __webpack_require__(1226); var Triangle = __webpack_require__(56400); "use strict"; exports.groupD8 = groupD8.groupD8; exports.Matrix = Matrix.Matrix; exports.DEG_TO_RAD = _const.DEG_TO_RAD; exports.PI_2 = _const.PI_2; exports.RAD_TO_DEG = _const.RAD_TO_DEG; exports.isPow2 = pow2.isPow2; exports.log2 = pow2.log2; exports.nextPow2 = pow2.nextPow2; exports.squaredDistanceToLineSegment = squaredDistanceToLineSegment.squaredDistanceToLineSegment; exports.ObservablePoint = ObservablePoint.ObservablePoint; exports.Point = Point.Point; exports.pointInTriangle = pointInTriangle.pointInTriangle; exports.Circle = Circle.Circle; exports.Ellipse = Ellipse.Ellipse; exports.Polygon = Polygon.Polygon; exports.Rectangle = Rectangle.Rectangle; exports.RoundedRectangle = RoundedRectangle.RoundedRectangle; exports.Triangle = Triangle.Triangle; /***/ }), /***/ 35268: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var roundPixelsBit = { name: "round-pixels-bit", vertex: { header: /* wgsl */"\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32> \n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n " } }; var roundPixelsBitGl = { name: "round-pixels-bit", vertex: { header: /* glsl */" \n vec2 roundPixels(vec2 position, vec2 targetSize)\n { \n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n " } }; exports.roundPixelsBit = roundPixelsBit; exports.roundPixelsBitGl = roundPixelsBitGl; /***/ }), /***/ 35298: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var LinearDodgeBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function LinearDodgeBlend() { _classCallCheck(this, LinearDodgeBlend); return _callSuper(this, LinearDodgeBlend, [{ gl: { functions: "\n float linearDodge(float base, float blend) {\n return min(1.0, base + blend);\n }\n\n vec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) {\n vec3 blended = vec3(\n linearDodge(base.r, blend.r),\n linearDodge(base.g, blend.g),\n linearDodge(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendLinearDodge(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn linearDodge(base: f32, blend: f32) -> f32\n {\n return min(1, base + blend);\n }\n\n fn blendLinearDodge(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n linearDodge(base.r, blend.r),\n linearDodge(base.g, blend.g),\n linearDodge(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendLinearDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(LinearDodgeBlend, _BlendModeFilter$Blen); return _createClass(LinearDodgeBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ LinearDodgeBlend.extension = { name: "linear-dodge", type: Extensions.ExtensionType.BlendMode }; exports.LinearDodgeBlend = LinearDodgeBlend; /***/ }), /***/ 35513: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.copyEvent = copyEvent; exports.copyTouch = copyTouch; exports.eventProperties = exports["default"] = void 0; exports.findChangedTouchByIdent = findChangedTouchByIdent; exports.findTouchByIdent = findTouchByIdent; exports.hitElement = hitElement; exports.isMouseLeft = isMouseLeft; exports.isMouseMiddle = isMouseMiddle; exports.isMouseRight = isMouseRight; exports.touchProperties = void 0; var _safeThrow = _interopRequireDefault(__webpack_require__(91131)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function EventEmitter() { if (!this._azar_extendEvents) { Object.defineProperty(this, '_azar_extendEvents', { enumerable: false, value: this._azar_extendEvents || { supported: {}, prioritize: {}, nonprioritize: {} } }); Object.defineProperty(this, '__azar_force', { value: !((typeof Node === "undefined" ? "undefined" : _typeof(Node)) === "object" ? this instanceof Node : this && _typeof(this) === "object" && typeof this.nodeType === "number" && typeof this.nodeName === "string"), enumerable: false }); } } EventEmitter.prototype.defineEvent = function (name) { if (name instanceof Array) { for (var i = 0; i < name.length; ++i) this._azar_extendEvents.supported[name[i]] = true; } else this._azar_extendEvents.supported[name] = true; return this; }; EventEmitter.prototype.isSupportedEvent = function (name) { return this.__azar_force || !!this._azar_extendEvents.supported[name]; }; EventEmitter.prototype.emit = function (eventName, data) { this.fire.apply(this, arguments); }; EventEmitter.prototype.fire = function (eventName, data) { var others = Array.prototype.slice.call(arguments, 1); var listenerList; var i; var startTime, endTime; if (this.isSupportedEvent(eventName)) { if (this._azar_extendEvents.prioritize[eventName]) { listenerList = this._azar_extendEvents.prioritize[eventName].slice(); for (i = 0; i < listenerList.length; ++i) { try { startTime = Date.now(); listenerList[i].wrappedCallback.apply(this, others); endTime = Date.now(); if (endTime - startTime > 200) { console.log('slow function call (' + (endTime - startTime) + ')', listenerList[i]); } } catch (e) { (0, _safeThrow["default"])(e); } } } if (this._azar_extendEvents.nonprioritize[eventName]) { listenerList = this._azar_extendEvents.nonprioritize[eventName].slice(); for (i = 0; i < listenerList.length; ++i) { try { startTime = Date.now(); listenerList[i].wrappedCallback.apply(this, others); endTime = Date.now(); if (endTime - startTime > 200) { console.log('slow function call (' + (endTime - startTime) + ')', listenerList[i]); } } catch (e) { (0, _safeThrow["default"])(e); } } } } else { if (this.dispatchEvent) { var event = new Event(eventName); data && Object.assign(event, data); this.dispatchEvent(event); } else throw new Error("Not support event " + eventName); } return this; }; EventEmitter.prototype.eventEmittorOnWithTime = function (isOnce, arg0, arg1, arg2) { if (_typeof(arg0) == 'object') { for (var key in arg0) { this.eventEmittorOnWithTime(isOnce, key, arg0[key]); } return this; } else { if (_typeof(arg1) == 'object') { return this.eventEmittorOnWithTime(isOnce, arg0, arg1.callback, arg1.cap); } else { var eventArr = this._azar_extendEvents[arg2 ? 'prioritize' : 'nonprioritize'][arg0] || []; var eventIndex = -1; for (var i = 0; i < eventArr.length; ++i) { if (eventArr[i].wrappedCallback == arg1) { eventIndex = i; break; } } if (eventIndex < 0) { var event = { isOnce: isOnce, eventName: arg0, callback: arg1, cap: !!arg2 }; //wrappedCallback will be call if (isOnce) { event.wrappedCallback = function () { this.off(event.eventName, event.wrappedCallback, event.cap); event.callback.apply(this, arguments); }; } else { event.wrappedCallback = event.callback; } if (!this.isSupportedEvent(arg0)) { if (this.addEventListener) { this.addEventListener(arg0, event.wrappedCallback, !!arg2); } else { this.attachEvent('on' + arg0, arg1, !!arg2); } } eventArr.push(event); this._azar_extendEvents[arg2 ? 'prioritize' : 'nonprioritize'][arg0] = eventArr; } else { console.warn("dupplicate event"); } } return this; } }; EventEmitter.prototype.on = function (arg0, arg1, arg2) { this.eventEmittorOnWithTime(false, arg0, arg1, arg2); return this; }; EventEmitter.prototype.once = function (arg0, arg1, arg2) { this.eventEmittorOnWithTime(true, arg0, arg1, arg2); return this; }; EventEmitter.prototype.off = function (arg0, arg1, arg2) { if (_typeof(arg0) == 'object') { for (var key in arg0) { this.off(key, arg0[key]); } return this; } else { if (_typeof(arg1) == 'object') { return this.off(arg0, arg1.callback, arg1.cap); } else { var eventArr = this._azar_extendEvents[arg2 ? 'prioritize' : 'nonprioritize'][arg0] || []; var newEventArray = []; for (var i = 0; i < eventArr.length; ++i) { var event = eventArr[i]; if (event.wrappedCallback == arg1) { //Dont add to newEventArray if (this.isSupportedEvent(arg0)) {} else { if (this.removeEventListener) { this.removeEventListener(event.eventName, event.wrappedCallback, !!event.cap); } else { this.detachEvent('on' + event.eventName, event.wrappedCallback, !!event.cap); } } } else { newEventArray.push(event); } } this._azar_extendEvents[arg2 ? 'prioritize' : 'nonprioritize'][arg0] = newEventArray; return this; } } }; var eventProperties = exports.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed", "ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase", "explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource", "mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region", "relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type", "deltaMode", "deltaX", "deltaY", "deltaZ", 'preventDefault']; var touchProperties = exports.touchProperties = ['clientX', 'clientY', 'force', 'identifier', 'pageX', 'pageY', 'rotationAngle', 'screenX', 'screenY', 'target']; function isMouseRight(event) { var isRightMB = false; if ("which" in event) // Gecko (Firefox), WebKit (Safari/Chrome) & Opera isRightMB = event.which === 3;else if ("button" in event) // IE, Opera isRightMB = event.button == 2; return isRightMB; } function isMouseLeft(event) { var isLeftMB = false; if ("which" in event) // Gecko (Firefox), WebKit (Safari/Chrome) & Opera isLeftMB = event.which === 1;else if ("button" in event) // IE, Opera isLeftMB = event.button === 0; return isLeftMB; } function isMouseMiddle(event) { var isMiddleMB = false; if ("which" in event) // Gecko (Firefox), WebKit (Safari/Chrome) & Opera isMiddleMB = event.which === 2;else if ("button" in event) // IE, Opera isMiddleMB = event.button === 1; return isMiddleMB; } /** * * @type AElement * @name sponsorElement * @memberof AElement# */ /** * * @param {AElement} element * @param {Event |{target: AElement}} event * @returns {boolean} */ function hitElement(element, event) { var current = event.target; while (current) { if (current === element) return true; if (current.sponsorElement && current.sponsorElement !== current.parentElement) { // sponsorElement like trigger of quick-menu if (hitElement(element, { target: current.sponsorElement })) return true; } current = current.parentElement; } return false; } function copyEvent(event, props) { var result = {}; var key, value; //copy native property for (var i = 0; i < eventProperties.length; ++i) { key = eventProperties[i]; value = event[key]; if (value !== undefined) { if (typeof value == "function") { result[key] = event[key].bind(event); } else { result[key] = event[key]; } } } Object.assign(result, event); if (props) Object.assign(result, props); if (event.changedTouches) { result.changedTouches = Array.prototype.map.call(event.changedTouches, function (touch) { return copyTouch(touch); }); } if (event.touches) { result.touches = Array.prototype.map.call(event.touches, function (touch) { return copyTouch(touch); }); } return result; } function copyTouch(touch, props) { var result = {}; var key, value; //copy native property for (var i = 0; i < touchProperties.length; ++i) { key = touchProperties[i]; value = touch[key]; if (value !== undefined) { if (typeof value == "function") { result[key] = touch[key].bind(touch); } else { result[key] = touch[key]; } } } Object.assign(result, touch); if (props) Object.assign(result, props); return result; } /*** * * @param {TouchEvent} event * @return {Touch | null} */ function findChangedTouchByIdent(event, identifier) { if (event.changedTouches) { for (var i = 0; i < event.changedTouches.length; ++i) { if (event.changedTouches[i].identifier === identifier) { return event.changedTouches[i]; } } } return null; } /*** * * @param event * @param identifier * @return {Touch|null} */ function findTouchByIdent(event, identifier) { if (event.touches) { for (var i = 0; i < event.touches.length; ++i) { if (event.touches[i].identifier === identifier) { return event.touches[i]; } } } return null; } EventEmitter.isMouseRight = isMouseRight; EventEmitter.isMouseLeft = isMouseLeft; EventEmitter.hitElement = hitElement; EventEmitter.copyEvent = copyEvent; EventEmitter.eventProperties = eventProperties; var _default = exports["default"] = EventEmitter; /***/ }), /***/ 35564: /***/ ((__unused_webpack_module, exports) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } Object.defineProperty(exports, "__esModule", ({ value: true })); var WORKER_CODE = "(function () {\n 'use strict';\n\n async function loadImageBitmap(url, alphaMode) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n const imageBlob = await response.blob();\n return alphaMode === \"premultiplied-alpha\" ? createImageBitmap(imageBlob, { premultiplyAlpha: \"none\" }) : createImageBitmap(imageBlob);\n }\n self.onmessage = async (event) => {\n try {\n const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]);\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n }, [imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n\n})();\n"; var WORKER_URL = null; var WorkerInstance = /*#__PURE__*/_createClass(function WorkerInstance() { _classCallCheck(this, WorkerInstance); if (!WORKER_URL) { WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' })); } this.worker = new Worker(WORKER_URL); }); WorkerInstance.revokeObjectURL = function revokeObjectURL() { if (WORKER_URL) { URL.revokeObjectURL(WORKER_URL); WORKER_URL = null; } }; exports["default"] = WorkerInstance; /***/ }), /***/ 35775: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function cleanHash(hash) { var clean = false; for (var i in hash) { if (hash[i] == void 0) { clean = true; break; } } if (!clean) return hash; var cleanHash2 = /* @__PURE__ */Object.create(null); for (var _i in hash) { var value = hash[_i]; if (value) { cleanHash2[_i] = value; } } return cleanHash2; } function cleanArray(arr) { var offset = 0; for (var i = 0; i < arr.length; i++) { if (arr[i] == void 0) { offset++; } else { arr[i - offset] = arr[i]; } } arr.length -= offset; return arr; } exports.cleanArray = cleanArray; exports.cleanHash = cleanHash; /***/ }), /***/ 35879: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var TextureSource = __webpack_require__(55406); "use strict"; var CanvasSource = /*#__PURE__*/function (_TextureSource$Textur) { function CanvasSource(options) { var _this; _classCallCheck(this, CanvasSource); if (!options.resource) { options.resource = adapter.DOMAdapter.get().createCanvas(); } if (!options.width) { options.width = options.resource.width; if (!options.autoDensity) { options.width /= options.resolution; } } if (!options.height) { options.height = options.resource.height; if (!options.autoDensity) { options.height /= options.resolution; } } _this = _callSuper(this, CanvasSource, [options]); _this.uploadMethodId = "image"; _this.autoDensity = options.autoDensity; _this.resizeCanvas(); _this.transparent = !!options.transparent; return _this; } _inherits(CanvasSource, _TextureSource$Textur); return _createClass(CanvasSource, [{ key: "resizeCanvas", value: function resizeCanvas() { if (this.autoDensity) { this.resource.style.width = "".concat(this.width, "px"); this.resource.style.height = "".concat(this.height, "px"); } if (this.resource.width !== this.pixelWidth || this.resource.height !== this.pixelHeight) { this.resource.width = this.pixelWidth; this.resource.height = this.pixelHeight; } } }, { key: "resize", value: function resize() { var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.width; var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.height; var resolution = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this._resolution; var didResize = _superPropGet(CanvasSource, "resize", this, 3)([width, height, resolution]); if (didResize) { this.resizeCanvas(); } return didResize; } }, { key: "context2D", get: /** * Returns the 2D rendering context for the canvas. * Caches the context after creating it. * @returns The 2D rendering context of the canvas. */ function get() { return this._context2D || (this._context2D = this.resource.getContext("2d")); } }], [{ key: "test", value: function test(resource) { return globalThis.HTMLCanvasElement && resource instanceof HTMLCanvasElement || globalThis.OffscreenCanvas && resource instanceof OffscreenCanvas; } }]); }(TextureSource.TextureSource); CanvasSource.extension = Extensions.ExtensionType.TextureSource; exports.CanvasSource = CanvasSource; /***/ }), /***/ 36007: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function mixHexColors(color1, color2, ratio) { var r1 = color1 >> 16 & 255; var g1 = color1 >> 8 & 255; var b1 = color1 & 255; var r2 = color2 >> 16 & 255; var g2 = color2 >> 8 & 255; var b2 = color2 & 255; var r = r1 + (r2 - r1) * ratio; var g = g1 + (g2 - g1) * ratio; var b = b1 + (b2 - b1) * ratio; return (r << 16) + (g << 8) + b; } exports.mixHexColors = mixHexColors; /***/ }), /***/ 36243: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function fastCopy(sourceBuffer, destinationBuffer) { var lengthDouble = sourceBuffer.byteLength / 8 | 0; var sourceFloat64View = new Float64Array(sourceBuffer, 0, lengthDouble); var destinationFloat64View = new Float64Array(destinationBuffer, 0, lengthDouble); destinationFloat64View.set(sourceFloat64View); var remainingBytes = sourceBuffer.byteLength - lengthDouble * 8; if (remainingBytes > 0) { var sourceUint8View = new Uint8Array(sourceBuffer, lengthDouble * 8, remainingBytes); var destinationUint8View = new Uint8Array(destinationBuffer, lengthDouble * 8, remainingBytes); destinationUint8View.set(sourceUint8View); } } exports.fastCopy = fastCopy; /***/ }), /***/ 36258: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function checkDataUrl(url, mimes) { if (Array.isArray(mimes)) { var _iterator = _createForOfIteratorHelper(mimes), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var mime = _step.value; if (url.startsWith("data:".concat(mime))) return true; } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } return false; } return url.startsWith("data:".concat(mimes)); } exports.checkDataUrl = checkDataUrl; /***/ }), /***/ 36262: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function buildUvs(vertices, verticesStride, verticesOffset, uvs, uvsOffset, uvsStride, size) { var matrix = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null; var index = 0; verticesOffset *= verticesStride; uvsOffset *= uvsStride; var a = matrix.a; var b = matrix.b; var c = matrix.c; var d = matrix.d; var tx = matrix.tx; var ty = matrix.ty; while (index < size) { var x = vertices[verticesOffset]; var y = vertices[verticesOffset + 1]; uvs[uvsOffset] = a * x + c * y + tx; uvs[uvsOffset + 1] = b * x + d * y + ty; uvsOffset += uvsStride; verticesOffset += verticesStride; index++; } } function buildSimpleUvs(uvs, uvsOffset, uvsStride, size) { var index = 0; uvsOffset *= uvsStride; while (index < size) { uvs[uvsOffset] = 0; uvs[uvsOffset + 1] = 0; uvsOffset += uvsStride; index++; } } exports.buildSimpleUvs = buildSimpleUvs; exports.buildUvs = buildUvs; /***/ }), /***/ 36786: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(20105); var Ticker = __webpack_require__(6014); var TickerListener = __webpack_require__(83690); "use strict"; exports.UPDATE_PRIORITY = _const.UPDATE_PRIORITY; exports.Ticker = Ticker.Ticker; exports.TickerListener = TickerListener.TickerListener; /***/ }), /***/ 36805: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Grass1x2 = Grass1x2; exports.GrassT1 = GrassT1; exports.GrassT2 = GrassT2; exports.GrassT3 = GrassT3; exports.MonsterHome = MonsterHome; exports.Mushroom = Mushroom; exports.PlaceHolder = PlaceHolder; exports.Pond3x2 = Pond3x2; exports.ProtectedTarget = ProtectedTarget; exports.Rock2x1 = Rock2x1; exports.SmallRock = SmallRock; exports.StaticObject = StaticObject; var _OOP = __webpack_require__(64181); var _FCore = __webpack_require__(49997); var _Rectangle = _interopRequireDefault(__webpack_require__(34478)); var _random = __webpack_require__(96212); var _stringGenerate = __webpack_require__(356); var _pixi = __webpack_require__(3635); var _util = __webpack_require__(19330); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * * @param {Level1Scene} scene * @param x * @param y * @constructor */ function MonsterHome(scene, x, y) { this.scene = scene; this.x = x; this.y = y; var imgX = 144 + x * this.scene.map.cellSize; var imgY = 168 + y * this.scene.map.cellSize; this.$img = (0, _FCore._)({ tag: 'img', "class": 'as-monster-home', attr: { src: 'assets/monster_home.png' }, style: { left: imgX + 'px', top: imgY + 'px' } }); this.scene.$foreground.addChild(this.$img); } MonsterHome.prototype.remove = function () { this.$img.remove(); }; /** * * @param {Level1Scene} scene * @param x * @param y * @constructor */ function PlaceHolder(scene, x, y) { this.id = (0, _stringGenerate.randomIdent)(8); this.scene = scene; this.x = x; this.y = y; this.$placeHolder = (0, _FCore._)({ "class": 'as-place-holder', style: { left: x * 108 + 'px', top: y * 108 + 'px' } }); this.scene.$staticObjectCtn.addChild(this.$placeHolder); this.scene.placeHolders[this.id] = this; } PlaceHolder.prototype.isHit = function (point) { var rect = this.getRect(); return rect.containsPoint(point); }; PlaceHolder.prototype.getRect = function () { return new _Rectangle["default"](this.scene.map.x + this.x * 108, this.scene.map.y + this.y * 108, 108, 108); }; PlaceHolder.prototype.remove = function () { this.$placeHolder.remove(); delete this.scene.placeHolders[this.id]; }; /** * * @param {Level1Scene} scene * @param x * @param y * @constructor */ function StaticObject(scene, x, y) { this.id = (0, _stringGenerate.randomIdent)(8); this.x = x; this.y = y; this.scene = scene; var cellX = this.scene.map.x + x * this.scene.map.cellSize; var cellY = this.scene.map.x + x * this.scene.map.cellSize; this.$obj = (0, _FCore._)({ "class": 'as-static-object', style: { left: 108 * x + 'px', top: 108 * y + 'px', width: this.width * 108 + 'px', height: this.height * 108 + 'px', zIndex: 3 + x + y * 12 }, child: { tag: 'img', attr: { src: this.imageSrc }, style: { left: this.imageOffset.x + 'px', top: this.imageOffset.y + 'px' } } }); this.scene.$staticObjectCtn.addChild(this.$obj); this.scene.staticObjects[this.id] = this; } StaticObject.prototype.type = 'static'; StaticObject.prototype.width = 1; StaticObject.prototype.height = 1; StaticObject.prototype.hp = 40; StaticObject.prototype.coins = 10; StaticObject.prototype.imageSrc = 'assets/grass_t1.png'; StaticObject.prototype.imageOffset = { x: 0, y: 0 }; StaticObject.prototype.remove = function () { this.$obj.remove(); delete this.scene.staticObjects[this.id]; }; StaticObject.prototype.beDamaged = function (attack) { var _this = this; if (this.hp <= 0) return; this.hp = Math.min(this.hp - attack); if (this.hp <= 0) { this.scene.starCoins += this.coins; setTimeout(function () { var x = _this.x; var y = _this.y; _this.remove(); for (var i = 0; i < _this.height; ++i) for (var j = 0; j < _this.width; ++j) new PlaceHolder(_this.scene, x + j, y + i); }, 300); } }; StaticObject.prototype.beSlow = function () {}; StaticObject.prototype.isHit = function (point) { var rect = this.getRect(); return rect.containsPoint(point); }; StaticObject.prototype.getRect = function () { return new _Rectangle["default"](this.scene.map.x + this.x * 108, this.scene.map.y + this.y * 108, 108 * this.width, 108 * this.height); }; /** * * @extends {StaticObject} * @constructor */ function GrassT1(scene, x, y) { StaticObject.apply(this, arguments); } (0, _OOP.mixClass)(GrassT1, StaticObject); GrassT1.prototype.imageSrc = 'assets/grass_t1.png'; GrassT1.prototype.imageOffset = { x: -9, y: 9 }; GrassT1.prototype.hp = 70; /** * * @extends {StaticObject} * @constructor */ function GrassT2(scene, x, y) { StaticObject.apply(this, arguments); } (0, _OOP.mixClass)(GrassT2, StaticObject); GrassT2.prototype.imageSrc = 'assets/grass_t2.png'; GrassT2.prototype.imageOffset = { x: 0, y: 0 }; GrassT2.prototype.hp = 170; /** * * @extends {StaticObject} * @constructor */ function GrassT3(scene, x, y) { StaticObject.apply(this, arguments); } (0, _OOP.mixClass)(GrassT3, StaticObject); GrassT3.prototype.imageSrc = 'assets/grass_t3.png'; GrassT3.prototype.imageOffset = { x: -10, y: -5 }; GrassT3.prototype.hp = 80; /** * * @extends {StaticObject} * @constructor */ function Grass1x2(scene, x, y) { StaticObject.apply(this, arguments); } (0, _OOP.mixClass)(Grass1x2, StaticObject); Grass1x2.prototype.imageSrc = 'assets/grass_1x2.png'; Grass1x2.prototype.imageOffset = { x: 0, y: 0 }; Grass1x2.prototype.width = 1; Grass1x2.prototype.height = 2; Grass1x2.prototype.hp = 120; /** * * @extends {StaticObject} * @constructor */ function Mushroom(scene, x, y) { StaticObject.apply(this, arguments); } (0, _OOP.mixClass)(Mushroom, StaticObject); Mushroom.prototype.imageSrc = 'assets/mushroom.png'; Mushroom.prototype.imageOffset = { x: 0, y: -6 }; Mushroom.prototype.hp = 300; /** * * @extends {StaticObject} * @constructor */ function SmallRock(scene, x, y) { StaticObject.apply(this, arguments); } (0, _OOP.mixClass)(SmallRock, StaticObject); SmallRock.prototype.imageSrc = 'assets/rock_1x1.png'; SmallRock.prototype.imageOffset = { x: 0, y: 10 }; SmallRock.prototype.hp = 100; /** * * @extends {StaticObject} * @constructor */ function Rock2x1(scene, x, y) { StaticObject.apply(this, arguments); } (0, _OOP.mixClass)(Rock2x1, StaticObject); Rock2x1.prototype.imageSrc = 'assets/rock_2x1.png'; Rock2x1.prototype.imageOffset = { x: 2, y: -35 }; Rock2x1.prototype.width = 2; Rock2x1.prototype.height = 1; Rock2x1.prototype.hp = 1000; /** * * @extends {StaticObject} * @constructor */ function Pond3x2(scene, x, y) { StaticObject.apply(this, arguments); } (0, _OOP.mixClass)(Pond3x2, StaticObject); Pond3x2.prototype.imageSrc = 'assets/pond_3x2.png'; Pond3x2.prototype.imageOffset = { x: -2, y: -2 }; Pond3x2.prototype.width = 3; Pond3x2.prototype.height = 2; Pond3x2.prototype.hp = 2000; /** * * @param {AbstractScene|Level1Scene} scene * @param x * @param y * @constructor */ function ProtectedTarget(scene, x, y) { this.scene = scene; this.x = x; this.y = y; this.$hp = (0, _FCore._)({ "class": 'as-protected-target-hp', style: { left: this.x * 108 + 3 + 'px', top: this.y * 108 + 108 + 'px' }, child: [{ tag: 'img', attr: { src: 'assets/rice_hp.png' } }, { "class": 'as-protected-target-text', child: { text: '0' } }] }); this.$hpText = (0, _FCore.$)('.as-protected-target-text', this.$hp); this.$hp.addTo(this.scene.$staticObjectCtn); this.rice = new _pixi.Container(); this.rice.x = 108 * (x + 0.5); this.rice.y = 108 * (y + 0.5); this.texture = this.scene.assetMng.getTexture('rice'); this.sprite = new _pixi.Sprite(this.texture); this.sprite.x = -158 / 2 + 27; this.sprite.y = -160 / 2 - 20; this.stand = new _pixi.Container(); this.stand.addChild(this.sprite); this.rice.addChild(this.stand); this.scene.pGrid.addChild(this.rice); this.standKeyFrame = Math.random(); this.shakeKeyFrame = -1; this.pendingShake = false; this.hp = 99; //default init hp } ProtectedTarget.prototype.remove = function () { this.$hp.remove(); this.scene.pGrid.removeChild(this.rice); }; ProtectedTarget.prototype.standAniDuration = 5000; ProtectedTarget.prototype.standAniDY = -8; ProtectedTarget.prototype.shakeAniDuration = 300; ProtectedTarget.prototype.shakeAniDX = 3; ProtectedTarget.prototype.update = function (deltaTime) { this.updateStand(deltaTime); this.updateShake(deltaTime); }; ProtectedTarget.prototype.updateStand = function (deltaTime) { this.standKeyFrame += deltaTime / this.standAniDuration; this.standKeyFrame = this.standKeyFrame % 1; var t = this.standKeyFrame * 2; t = t > 1 ? (0, _util.bezierBlend)(2 - t) : (0, _util.bezierBlend)(t); this.stand.y = t * this.standAniDY; }; ProtectedTarget.prototype.updateShake = function (deltaTime) { if (this.shakeKeyFrame < 0) return; this.shakeKeyFrame = this.shakeKeyFrame + deltaTime / this.shakeAniDuration; var keyFrame = this.shakeKeyFrame; if (keyFrame > 1) { this.stand.x = 0; if (this.pendingShake) { this.pendingShake = false; this.shakeKeyFrame = 0; } else { this.shakeKeyFrame = -1; } return; } var t = keyFrame * 3; t = Math.sin(t * 2 * Math.PI); this.stand.x = this.shakeAniDX * t; }; ProtectedTarget.prototype.shake = function () { if (this.shakeKeyFrame >= 0) { this.pendingShake = true; } else { this.shakeKeyFrame = 0; this.pendingShake = false; } }; ProtectedTarget.prototype.beDamaged = function (damage) { if (this.hp <= 0) return; this.hp = Math.max(this.hp - damage, 0); console.log('remain', this.hp); this.shake(); if (this.hp <= 0) { console.log("Game end!"); } }; Object.defineProperty(ProtectedTarget.prototype, 'hp', { set: function set(value) { this._hp = value || 0; if (value === 0) console.trace(value); this.$hpText.firstChild.data = value + ''; }, get: function get() { return this._hp || 0; } }); /***/ }), /***/ 36869: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function getGlobalRenderableBounds(renderables, bounds) { bounds.clear(); var tempMatrix = bounds.matrix; for (var i = 0; i < renderables.length; i++) { var renderable = renderables[i]; if (renderable.globalDisplayStatus < 7) { continue; } bounds.matrix = renderable.worldTransform; bounds.addBounds(renderable.bounds); } bounds.matrix = tempMatrix; return bounds; } exports.getGlobalRenderableBounds = getGlobalRenderableBounds; /***/ }), /***/ 37078: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var ColorMask = /*#__PURE__*/function () { function ColorMask(options) { _classCallCheck(this, ColorMask); this.priority = 0; this.pipe = "colorMask"; if (options !== null && options !== void 0 && options.mask) { this.init(options.mask); } } return _createClass(ColorMask, [{ key: "init", value: function init(mask) { this.mask = mask; } }, { key: "destroy", value: function destroy() {} }], [{ key: "test", value: function test(mask) { return typeof mask === "number"; } }]); }(); ColorMask.extension = Extensions.ExtensionType.MaskEffect; exports.ColorMask = ColorMask; /***/ }), /***/ 37314: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var TextureSource = __webpack_require__(55406); var Texture = __webpack_require__(73782); "use strict"; var RenderTexture = /*#__PURE__*/function (_Texture$Texture) { function RenderTexture() { _classCallCheck(this, RenderTexture); return _callSuper(this, RenderTexture, arguments); } _inherits(RenderTexture, _Texture$Texture); return _createClass(RenderTexture, [{ key: "resize", value: /** * Resizes the render texture. * @param width - The new width of the render texture. * @param height - The new height of the render texture. * @param resolution - The new resolution of the render texture. * @returns This texture. */ function resize(width, height, resolution) { this.source.resize(width, height, resolution); return this; } }], [{ key: "create", value: function create(options) { return new RenderTexture({ source: new TextureSource.TextureSource(options) }); } }]); }(Texture.Texture); exports.RenderTexture = RenderTexture; /***/ }), /***/ 37368: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Cache = __webpack_require__(65278); var loadFontCSS = __webpack_require__(43382); "use strict"; var FontStylePromiseCache = /* @__PURE__ */new Map(); function getFontCss(_x, _x2, _x3) { return _getFontCss.apply(this, arguments); } function _getFontCss() { _getFontCss = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(fontFamilies, style, defaultOptions) { var fontPromises; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: fontPromises = fontFamilies.filter(function (fontFamily) { return Cache.Cache.has("".concat(fontFamily, "-and-url")); }).map(function (fontFamily, i) { if (!FontStylePromiseCache.has(fontFamily)) { var _Cache$Cache$get = Cache.Cache.get("".concat(fontFamily, "-and-url")), url = _Cache$Cache$get.url; if (i === 0) { FontStylePromiseCache.set(fontFamily, loadFontCSS.loadFontCSS({ fontWeight: style.fontWeight, fontStyle: style.fontStyle, fontFamily: fontFamily }, url)); } else { FontStylePromiseCache.set(fontFamily, loadFontCSS.loadFontCSS({ fontWeight: defaultOptions.fontWeight, fontStyle: defaultOptions.fontStyle, fontFamily: fontFamily }, url)); } } return FontStylePromiseCache.get(fontFamily); }); _context.n = 1; return Promise.all(fontPromises); case 1: return _context.a(2, _context.v.join("\n")); } }, _callee); })); return _getFontCss.apply(this, arguments); } exports.FontStylePromiseCache = FontStylePromiseCache; exports.getFontCss = getFontCss; /***/ }), /***/ 37493: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var gpuUploadImageResource = { type: "image", upload: function upload(source, gpuTexture, gpu) { var resource = source.resource; if (!resource) return; var width = Math.min(gpuTexture.width, source.resourceWidth || source.pixelWidth); var height = Math.min(gpuTexture.height, source.resourceHeight || source.pixelHeight); var premultipliedAlpha = source.alphaMode === "premultiply-alpha-on-upload"; gpu.device.queue.copyExternalImageToTexture({ source: resource }, { texture: gpuTexture, premultipliedAlpha: premultipliedAlpha }, { width: width, height: height }); } }; exports.gpuUploadImageResource = gpuUploadImageResource; /***/ }), /***/ 37530: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = noop; function noop() {} ; /***/ }), /***/ 37764: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Rectangle = __webpack_require__(74731); "use strict"; var Circle = /*#__PURE__*/function () { /** * @param x - The X coordinate of the center of this circle * @param y - The Y coordinate of the center of this circle * @param radius - The radius of the circle */ function Circle() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; _classCallCheck(this, Circle); /** * The type of the object, mainly used to avoid `instanceof` checks * @default 'circle' */ this.type = "circle"; this.x = x; this.y = y; this.radius = radius; } /** * Creates a clone of this Circle instance * @returns A copy of the Circle */ return _createClass(Circle, [{ key: "clone", value: function clone() { return new Circle(this.x, this.y, this.radius); } /** * Checks whether the x and y coordinates given are contained within this circle * @param x - The X coordinate of the point to test * @param y - The Y coordinate of the point to test * @returns Whether the x/y coordinates are within this Circle */ }, { key: "contains", value: function contains(x, y) { if (this.radius <= 0) return false; var r2 = this.radius * this.radius; var dx = this.x - x; var dy = this.y - y; dx *= dx; dy *= dy; return dx + dy <= r2; } /** * Checks whether the x and y coordinates given are contained within this circle including the stroke. * @param x - The X coordinate of the point to test * @param y - The Y coordinate of the point to test * @param width - The width of the line to check * @param alignment - The alignment of the stroke, 0.5 by default * @returns Whether the x/y coordinates are within this Circle */ }, { key: "strokeContains", value: function strokeContains(x, y, width) { var alignment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5; if (this.radius === 0) return false; var dx = this.x - x; var dy = this.y - y; var radius = this.radius; var outerWidth = (1 - alignment) * width; var distance = Math.sqrt(dx * dx + dy * dy); return distance <= radius + outerWidth && distance > radius - (width - outerWidth); } /** * Returns the framing rectangle of the circle as a Rectangle object * @param out * @returns The framing rectangle */ }, { key: "getBounds", value: function getBounds(out) { out || (out = new Rectangle.Rectangle()); out.x = this.x - this.radius; out.y = this.y - this.radius; out.width = this.radius * 2; out.height = this.radius * 2; return out; } /** * Copies another circle to this one. * @param circle - The circle to copy from. * @returns Returns itself. */ }, { key: "copyFrom", value: function copyFrom(circle) { this.x = circle.x; this.y = circle.y; this.radius = circle.radius; return this; } /** * Copies this circle to another one. * @param circle - The circle to copy to. * @returns Returns given parameter. */ }, { key: "copyTo", value: function copyTo(circle) { circle.copyFrom(this); return circle; } }, { key: "toString", value: function toString() { return "[pixi.js/math:Circle x=".concat(this.x, " y=").concat(this.y, " radius=").concat(this.radius, "]"); } }]); }(); exports.Circle = Circle; /***/ }), /***/ 37848: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var fastCopy = __webpack_require__(36243); "use strict"; var GpuBufferSystem = /*#__PURE__*/function () { function GpuBufferSystem(renderer) { _classCallCheck(this, GpuBufferSystem); this._gpuBuffers = /* @__PURE__ */Object.create(null); this._managedBuffers = []; renderer.renderableGC.addManagedHash(this, "_gpuBuffers"); } return _createClass(GpuBufferSystem, [{ key: "contextChange", value: function contextChange(gpu) { this._gpu = gpu; } }, { key: "getGPUBuffer", value: function getGPUBuffer(buffer) { return this._gpuBuffers[buffer.uid] || this.createGPUBuffer(buffer); } }, { key: "updateBuffer", value: function updateBuffer(buffer) { var gpuBuffer = this._gpuBuffers[buffer.uid] || this.createGPUBuffer(buffer); var data = buffer.data; if (buffer._updateID && data) { buffer._updateID = 0; this._gpu.device.queue.writeBuffer(gpuBuffer, 0, data.buffer, 0, // round to the nearest 4 bytes (buffer._updateSize || data.byteLength) + 3 & ~3); } return gpuBuffer; } /** dispose all WebGL resources of all managed buffers */ }, { key: "destroyAll", value: function destroyAll() { for (var id in this._gpuBuffers) { this._gpuBuffers[id].destroy(); } this._gpuBuffers = {}; } }, { key: "createGPUBuffer", value: function createGPUBuffer(buffer) { if (!this._gpuBuffers[buffer.uid]) { buffer.on("update", this.updateBuffer, this); buffer.on("change", this.onBufferChange, this); buffer.on("destroy", this.onBufferDestroy, this); this._managedBuffers.push(buffer); } var gpuBuffer = this._gpu.device.createBuffer(buffer.descriptor); buffer._updateID = 0; if (buffer.data) { fastCopy.fastCopy(buffer.data.buffer, gpuBuffer.getMappedRange()); gpuBuffer.unmap(); } this._gpuBuffers[buffer.uid] = gpuBuffer; return gpuBuffer; } }, { key: "onBufferChange", value: function onBufferChange(buffer) { var gpuBuffer = this._gpuBuffers[buffer.uid]; gpuBuffer.destroy(); buffer._updateID = 0; this._gpuBuffers[buffer.uid] = this.createGPUBuffer(buffer); } /** * Disposes buffer * @param buffer - buffer with data */ }, { key: "onBufferDestroy", value: function onBufferDestroy(buffer) { this._managedBuffers.splice(this._managedBuffers.indexOf(buffer), 1); this._destroyBuffer(buffer); } }, { key: "destroy", value: function destroy() { var _this = this; this._managedBuffers.forEach(function (buffer) { return _this._destroyBuffer(buffer); }); this._managedBuffers = null; this._gpuBuffers = null; } }, { key: "_destroyBuffer", value: function _destroyBuffer(buffer) { var gpuBuffer = this._gpuBuffers[buffer.uid]; gpuBuffer.destroy(); buffer.off("update", this.updateBuffer, this); buffer.off("change", this.onBufferChange, this); buffer.off("destroy", this.onBufferDestroy, this); this._gpuBuffers[buffer.uid] = null; } }]); }(); /** @ignore */ GpuBufferSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "buffer" }; exports.GpuBufferSystem = GpuBufferSystem; /***/ }), /***/ 37874: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var textureBit = { name: "texture-bit", vertex: { header: /* wgsl */"\n\n struct TextureUniforms {\n uTextureMatrix:mat3x3<f32>,\n }\n\n @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;\n ", main: /* wgsl */"\n uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;\n " }, fragment: { header: /* wgsl */"\n @group(2) @binding(0) var uTexture: texture_2d<f32>;\n @group(2) @binding(1) var uSampler: sampler;\n\n \n ", main: /* wgsl */"\n outColor = textureSample(uTexture, uSampler, vUV);\n " } }; var textureBitGl = { name: "texture-bit", vertex: { header: /* glsl */"\n uniform mat3 uTextureMatrix;\n ", main: /* glsl */"\n uv = (uTextureMatrix * vec3(uv, 1.0)).xy;\n " }, fragment: { header: /* glsl */"\n uniform sampler2D uTexture;\n\n \n ", main: /* glsl */"\n outColor = texture(uTexture, vUV);\n " } }; exports.textureBit = textureBit; exports.textureBitGl = textureBitGl; /***/ }), /***/ 38084: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var GlColorMaskSystem = /*#__PURE__*/function () { function GlColorMaskSystem(renderer) { _classCallCheck(this, GlColorMaskSystem); this._colorMaskCache = 15; this._renderer = renderer; } return _createClass(GlColorMaskSystem, [{ key: "setMask", value: function setMask(colorMask) { if (this._colorMaskCache === colorMask) return; this._colorMaskCache = colorMask; this._renderer.gl.colorMask(!!(colorMask & 8), !!(colorMask & 4), !!(colorMask & 2), !!(colorMask & 1)); } }]); }(); /** @ignore */ GlColorMaskSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "colorMask" }; exports.GlColorMaskSystem = GlColorMaskSystem; /***/ }), /***/ 38157: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var updateQuadBounds = __webpack_require__(28275); "use strict"; function updateTextBounds(batchableSprite, text) { var texture = batchableSprite.texture, bounds = batchableSprite.bounds; updateQuadBounds.updateQuadBounds(bounds, text._anchor, texture); var padding = text._style.padding; bounds.minX -= padding; bounds.minY -= padding; bounds.maxX -= padding; bounds.maxY -= padding; } exports.updateTextBounds = updateTextBounds; /***/ }), /***/ 38224: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function executeInstructions(renderGroup, renderer) { var instructionSet = renderGroup.instructionSet; var instructions = instructionSet.instructions; for (var i = 0; i < instructionSet.instructionSize; i++) { var instruction = instructions[i]; renderer[instruction.renderPipeId].execute(instruction); } } exports.executeInstructions = executeInstructions; /***/ }), /***/ 38468: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var getAdjustedBlendModeBlend = __webpack_require__(4794); var State = __webpack_require__(84938); var types = __webpack_require__(9634); var colorToUniform = __webpack_require__(6455); var BatchableMesh = __webpack_require__(8781); var MeshGeometry = __webpack_require__(56451); var TilingSpriteShader = __webpack_require__(47465); var QuadGeometry = __webpack_require__(99539); var setPositions = __webpack_require__(60516); var setUvs = __webpack_require__(43884); "use strict"; var sharedQuad = new QuadGeometry.QuadGeometry(); var TilingSpritePipe = /*#__PURE__*/function () { function TilingSpritePipe(renderer) { _classCallCheck(this, TilingSpritePipe); this._state = State.State.default2d; this._tilingSpriteDataHash = /* @__PURE__ */Object.create(null); this._destroyRenderableBound = this.destroyRenderable.bind(this); this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_tilingSpriteDataHash"); } return _createClass(TilingSpritePipe, [{ key: "validateRenderable", value: function validateRenderable(renderable) { var tilingSpriteData = this._getTilingSpriteData(renderable); var couldBatch = tilingSpriteData.canBatch; this._updateCanBatch(renderable); var canBatch = tilingSpriteData.canBatch; if (canBatch && canBatch === couldBatch) { var batchableMesh = tilingSpriteData.batchableMesh; return !batchableMesh._batcher.checkAndUpdateTexture(batchableMesh, renderable.texture); } return couldBatch !== canBatch; } }, { key: "addRenderable", value: function addRenderable(tilingSprite, instructionSet) { var batcher = this._renderer.renderPipes.batch; this._updateCanBatch(tilingSprite); var tilingSpriteData = this._getTilingSpriteData(tilingSprite); var geometry = tilingSpriteData.geometry, canBatch = tilingSpriteData.canBatch; if (canBatch) { tilingSpriteData.batchableMesh || (tilingSpriteData.batchableMesh = new BatchableMesh.BatchableMesh()); var batchableMesh = tilingSpriteData.batchableMesh; if (tilingSprite.didViewUpdate) { this._updateBatchableMesh(tilingSprite); batchableMesh.geometry = geometry; batchableMesh.renderable = tilingSprite; batchableMesh.transform = tilingSprite.groupTransform; batchableMesh.setTexture(tilingSprite._texture); } batchableMesh.roundPixels = this._renderer._roundPixels | tilingSprite._roundPixels; batcher.addToBatch(batchableMesh, instructionSet); } else { batcher["break"](instructionSet); tilingSpriteData.shader || (tilingSpriteData.shader = new TilingSpriteShader.TilingSpriteShader()); this.updateRenderable(tilingSprite); instructionSet.add(tilingSprite); } } }, { key: "execute", value: function execute(tilingSprite) { var shader = this._tilingSpriteDataHash[tilingSprite.uid].shader; shader.groups[0] = this._renderer.globalUniforms.bindGroup; var localUniforms = shader.resources.localUniforms.uniforms; localUniforms.uTransformMatrix = tilingSprite.groupTransform; localUniforms.uRound = this._renderer._roundPixels | tilingSprite._roundPixels; colorToUniform.color32BitToUniform(tilingSprite.groupColorAlpha, localUniforms.uColor, 0); this._state.blendMode = getAdjustedBlendModeBlend.getAdjustedBlendModeBlend(tilingSprite.groupBlendMode, tilingSprite.texture._source); this._renderer.encoder.draw({ geometry: sharedQuad, shader: shader, state: this._state }); } }, { key: "updateRenderable", value: function updateRenderable(tilingSprite) { var tilingSpriteData = this._getTilingSpriteData(tilingSprite); var canBatch = tilingSpriteData.canBatch; if (canBatch) { var batchableMesh = tilingSpriteData.batchableMesh; if (tilingSprite.didViewUpdate) this._updateBatchableMesh(tilingSprite); batchableMesh._batcher.updateElement(batchableMesh); } else if (tilingSprite.didViewUpdate) { var shader = tilingSpriteData.shader; shader.updateUniforms(tilingSprite.width, tilingSprite.height, tilingSprite._tileTransform.matrix, tilingSprite.anchor.x, tilingSprite.anchor.y, tilingSprite.texture); } } }, { key: "destroyRenderable", value: function destroyRenderable(tilingSprite) { var _tilingSpriteData$sha; var tilingSpriteData = this._getTilingSpriteData(tilingSprite); tilingSpriteData.batchableMesh = null; (_tilingSpriteData$sha = tilingSpriteData.shader) === null || _tilingSpriteData$sha === void 0 || _tilingSpriteData$sha.destroy(); this._tilingSpriteDataHash[tilingSprite.uid] = null; tilingSprite.off("destroyed", this._destroyRenderableBound); } }, { key: "_getTilingSpriteData", value: function _getTilingSpriteData(renderable) { return this._tilingSpriteDataHash[renderable.uid] || this._initTilingSpriteData(renderable); } }, { key: "_initTilingSpriteData", value: function _initTilingSpriteData(tilingSprite) { var geometry = new MeshGeometry.MeshGeometry({ indices: sharedQuad.indices, positions: sharedQuad.positions.slice(), uvs: sharedQuad.uvs.slice() }); this._tilingSpriteDataHash[tilingSprite.uid] = { canBatch: true, renderable: tilingSprite, geometry: geometry }; tilingSprite.on("destroyed", this._destroyRenderableBound); return this._tilingSpriteDataHash[tilingSprite.uid]; } }, { key: "_updateBatchableMesh", value: function _updateBatchableMesh(tilingSprite) { var renderableData = this._getTilingSpriteData(tilingSprite); var geometry = renderableData.geometry; var style = tilingSprite.texture.source.style; if (style.addressMode !== "repeat") { style.addressMode = "repeat"; style.update(); } setUvs.setUvs(tilingSprite, geometry.uvs); setPositions.setPositions(tilingSprite, geometry.positions); } }, { key: "destroy", value: function destroy() { for (var i in this._tilingSpriteDataHash) { this.destroyRenderable(this._tilingSpriteDataHash[i].renderable); } this._tilingSpriteDataHash = null; this._renderer = null; } }, { key: "_updateCanBatch", value: function _updateCanBatch(tilingSprite) { var renderableData = this._getTilingSpriteData(tilingSprite); var texture = tilingSprite.texture; var _nonPowOf2wrapping = true; if (this._renderer.type === types.RendererType.WEBGL) { _nonPowOf2wrapping = this._renderer.context.supports.nonPowOf2wrapping; } renderableData.canBatch = texture.textureMatrix.isSimple && (_nonPowOf2wrapping || texture.source.isPowerOfTwo); return renderableData.canBatch; } }]); }(); /** @ignore */ TilingSpritePipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "tilingSprite" }; exports.TilingSpritePipe = TilingSpritePipe; /***/ }), /***/ 38796: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var WebWorkerAdapter = __webpack_require__(80721); var webworkerExt = __webpack_require__(10829); "use strict"; exports.WebWorkerAdapter = WebWorkerAdapter.WebWorkerAdapter; exports.webworkerExt = webworkerExt.webworkerExt; /***/ }), /***/ 38991: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["strength", "strengthX", "strengthY", "quality"]; function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var TexturePool = __webpack_require__(53248); var types = __webpack_require__(9634); var deprecation = __webpack_require__(11225); var Filter = __webpack_require__(92393); var BlurFilterPass = __webpack_require__(9154); "use strict"; var BlurFilter = /*#__PURE__*/function (_Filter$Filter) { function BlurFilter() { var _ref; var _this; _classCallCheck(this, BlurFilter); var options = (_ref = arguments.length <= 0 ? undefined : arguments[0]) !== null && _ref !== void 0 ? _ref : {}; if (typeof options === "number") { deprecation.deprecation(deprecation.v8_0_0, "BlurFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }"); options = { strength: options }; if ((arguments.length <= 1 ? undefined : arguments[1]) !== void 0) options.quality = arguments.length <= 1 ? undefined : arguments[1]; if ((arguments.length <= 2 ? undefined : arguments[2]) !== void 0) options.resolution = (arguments.length <= 2 ? undefined : arguments[2]) || "inherit"; if ((arguments.length <= 3 ? undefined : arguments[3]) !== void 0) options.kernelSize = arguments.length <= 3 ? undefined : arguments[3]; } options = _objectSpread(_objectSpread({}, BlurFilterPass.BlurFilterPass.defaultOptions), options); var _options = options, strength = _options.strength, strengthX = _options.strengthX, strengthY = _options.strengthY, quality = _options.quality, rest = _objectWithoutProperties(_options, _excluded); _this = _callSuper(this, BlurFilter, [_objectSpread(_objectSpread({}, rest), {}, { compatibleRenderers: types.RendererType.BOTH, resources: {} })]); _this._repeatEdgePixels = false; _this.blurXFilter = new BlurFilterPass.BlurFilterPass(_objectSpread({ horizontal: true }, options)); _this.blurYFilter = new BlurFilterPass.BlurFilterPass(_objectSpread({ horizontal: false }, options)); _this.quality = quality; _this.strengthX = strengthX !== null && strengthX !== void 0 ? strengthX : strength; _this.strengthY = strengthY !== null && strengthY !== void 0 ? strengthY : strength; _this.repeatEdgePixels = false; return _this; } /** * Applies the filter. * @param filterManager - The manager. * @param input - The input target. * @param output - The output target. * @param clearMode - How to clear */ _inherits(BlurFilter, _Filter$Filter); return _createClass(BlurFilter, [{ key: "apply", value: function apply(filterManager, input, output, clearMode) { var xStrength = Math.abs(this.blurXFilter.strength); var yStrength = Math.abs(this.blurYFilter.strength); if (xStrength && yStrength) { var tempTexture = TexturePool.TexturePool.getSameSizeTexture(input); this.blurXFilter.blendMode = "normal"; this.blurXFilter.apply(filterManager, input, tempTexture, true); this.blurYFilter.blendMode = this.blendMode; this.blurYFilter.apply(filterManager, tempTexture, output, clearMode); TexturePool.TexturePool.returnTexture(tempTexture); } else if (yStrength) { this.blurYFilter.blendMode = this.blendMode; this.blurYFilter.apply(filterManager, input, output, clearMode); } else { this.blurXFilter.blendMode = this.blendMode; this.blurXFilter.apply(filterManager, input, output, clearMode); } } }, { key: "updatePadding", value: function updatePadding() { if (this._repeatEdgePixels) { this.padding = 0; } else { this.padding = Math.max(Math.abs(this.blurXFilter.blur), Math.abs(this.blurYFilter.blur)) * 2; } } /** * Sets the strength of both the blurX and blurY properties simultaneously * @default 8 */ }, { key: "strength", get: function get() { if (this.strengthX !== this.strengthY) { throw new Error("BlurFilter's strengthX and strengthY are different"); } return this.strengthX; }, set: function set(value) { this.blurXFilter.blur = this.blurYFilter.blur = value; this.updatePadding(); } /** * Sets the number of passes for blur. More passes means higher quality bluring. * @default 1 */ }, { key: "quality", get: function get() { return this.blurXFilter.quality; }, set: function set(value) { this.blurXFilter.quality = this.blurYFilter.quality = value; } /** * Sets the strength of horizontal blur * @default 8 */ }, { key: "strengthX", get: function get() { return this.blurXFilter.blur; }, set: function set(value) { this.blurXFilter.blur = value; this.updatePadding(); } /** * Sets the strength of the vertical blur * @default 8 */ }, { key: "strengthY", get: function get() { return this.blurYFilter.blur; }, set: function set(value) { this.blurYFilter.blur = value; this.updatePadding(); } /** * Sets the strength of both the blurX and blurY properties simultaneously * @default 2 * @deprecated since 8.3.0 * @see BlurFilter.strength */ }, { key: "blur", get: function get() { deprecation.deprecation("8.3.0", "BlurFilter.blur is deprecated, please use BlurFilter.strength instead."); return this.strength; }, set: function set(value) { deprecation.deprecation("8.3.0", "BlurFilter.blur is deprecated, please use BlurFilter.strength instead."); this.strength = value; } /** * Sets the strength of the blurX property * @default 2 * @deprecated since 8.3.0 * @see BlurFilter.strengthX */ }, { key: "blurX", get: function get() { deprecation.deprecation("8.3.0", "BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."); return this.strengthX; }, set: function set(value) { deprecation.deprecation("8.3.0", "BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."); this.strengthX = value; } /** * Sets the strength of the blurY property * @default 2 * @deprecated since 8.3.0 * @see BlurFilter.strengthY */ }, { key: "blurY", get: function get() { deprecation.deprecation("8.3.0", "BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."); return this.strengthY; }, set: function set(value) { deprecation.deprecation("8.3.0", "BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."); this.strengthY = value; } /** * If set to true the edge of the target will be clamped * @default false */ }, { key: "repeatEdgePixels", get: function get() { return this._repeatEdgePixels; }, set: function set(value) { this._repeatEdgePixels = value; this.updatePadding(); } }]); }(Filter.Filter); /** Default blur filter options */ BlurFilter.defaultOptions = { /** The strength of the blur filter. */ strength: 8, /** The quality of the blur filter. */ quality: 4, /** The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15. */ kernelSize: 5 }; exports.BlurFilter = BlurFilter; /***/ }), /***/ 39062: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var State = __webpack_require__(84938); "use strict"; var GlBatchAdaptor = /*#__PURE__*/function () { function GlBatchAdaptor() { _classCallCheck(this, GlBatchAdaptor); this._tempState = State.State.for2d(); /** * We only want to sync the a batched shaders uniforms once on first use * this is a hash of shader uids to a boolean value. When the shader is first bound * we set the value to true. When the shader is bound again we check the value and * if it is true we know that the uniforms have already been synced and we skip it. */ this._didUploadHash = {}; } return _createClass(GlBatchAdaptor, [{ key: "init", value: function init(batcherPipe) { batcherPipe.renderer.runners.contextChange.add(this); } }, { key: "contextChange", value: function contextChange() { this._didUploadHash = {}; } }, { key: "start", value: function start(batchPipe, geometry, shader) { var renderer = batchPipe.renderer; var didUpload = this._didUploadHash[shader.uid]; renderer.shader.bind(shader, didUpload); if (!didUpload) { this._didUploadHash[shader.uid] = true; } renderer.shader.updateUniformGroup(renderer.globalUniforms.uniformGroup); renderer.geometry.bind(geometry, shader.glProgram); } }, { key: "execute", value: function execute(batchPipe, batch) { var renderer = batchPipe.renderer; this._tempState.blendMode = batch.blendMode; renderer.state.set(this._tempState); var textures = batch.textures.textures; for (var i = 0; i < batch.textures.count; i++) { renderer.texture.bind(textures[i], i); } renderer.geometry.draw(batch.topology, batch.size, batch.start); } }]); }(); /** @ignore */ GlBatchAdaptor.extension = { type: [Extensions.ExtensionType.WebGLPipesAdaptor], name: "batch" }; exports.GlBatchAdaptor = GlBatchAdaptor; /***/ }), /***/ 39148: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Texture = __webpack_require__(73782); var PoolGroup = __webpack_require__(47505); var BatchableSprite = __webpack_require__(42517); var updateTextBounds = __webpack_require__(38157); "use strict"; var HTMLTextPipe = /*#__PURE__*/function () { function HTMLTextPipe(renderer) { _classCallCheck(this, HTMLTextPipe); this._gpuText = /* @__PURE__ */Object.create(null); this._destroyRenderableBound = this.destroyRenderable.bind(this); this._renderer = renderer; this._renderer.runners.resolutionChange.add(this); this._renderer.renderableGC.addManagedHash(this, "_gpuText"); } return _createClass(HTMLTextPipe, [{ key: "resolutionChange", value: function resolutionChange() { for (var i in this._gpuText) { var gpuText = this._gpuText[i]; if (!gpuText) continue; var text = gpuText.batchableSprite.renderable; if (text._autoResolution) { text._resolution = this._renderer.resolution; text.onViewUpdate(); } } } }, { key: "validateRenderable", value: function validateRenderable(htmlText) { var gpuText = this._getGpuText(htmlText); var newKey = htmlText._getKey(); if (gpuText.textureNeedsUploading) { gpuText.textureNeedsUploading = false; return true; } if (gpuText.currentKey !== newKey) { return true; } return false; } }, { key: "addRenderable", value: function addRenderable(htmlText, instructionSet) { var gpuText = this._getGpuText(htmlText); var batchableSprite = gpuText.batchableSprite; if (htmlText._didTextUpdate) { this._updateText(htmlText); } this._renderer.renderPipes.batch.addToBatch(batchableSprite, instructionSet); } }, { key: "updateRenderable", value: function updateRenderable(htmlText) { var gpuText = this._getGpuText(htmlText); var batchableSprite = gpuText.batchableSprite; if (htmlText._didTextUpdate) { this._updateText(htmlText); } batchableSprite._batcher.updateElement(batchableSprite); } }, { key: "destroyRenderable", value: function destroyRenderable(htmlText) { htmlText.off("destroyed", this._destroyRenderableBound); this._destroyRenderableById(htmlText.uid); } }, { key: "_destroyRenderableById", value: function _destroyRenderableById(htmlTextUid) { var gpuText = this._gpuText[htmlTextUid]; this._renderer.htmlText.decreaseReferenceCount(gpuText.currentKey); PoolGroup.BigPool["return"](gpuText.batchableSprite); this._gpuText[htmlTextUid] = null; } }, { key: "_updateText", value: function _updateText(htmlText) { var newKey = htmlText._getKey(); var gpuText = this._getGpuText(htmlText); var batchableSprite = gpuText.batchableSprite; if (gpuText.currentKey !== newKey) { this._updateGpuText(htmlText)["catch"](function (e) { console.error(e); }); } htmlText._didTextUpdate = false; updateTextBounds.updateTextBounds(batchableSprite, htmlText); } }, { key: "_updateGpuText", value: function () { var _updateGpuText2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(htmlText) { var _htmlText$resolution; var gpuText, newKey, resolution, texture, batchableSprite; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: htmlText._didTextUpdate = false; gpuText = this._getGpuText(htmlText); if (!gpuText.generatingTexture) { _context.n = 1; break; } return _context.a(2); case 1: newKey = htmlText._getKey(); this._renderer.htmlText.decreaseReferenceCount(gpuText.currentKey); gpuText.generatingTexture = true; gpuText.currentKey = newKey; resolution = (_htmlText$resolution = htmlText.resolution) !== null && _htmlText$resolution !== void 0 ? _htmlText$resolution : this._renderer.resolution; _context.n = 2; return this._renderer.htmlText.getManagedTexture(htmlText.text, resolution, htmlText._style, htmlText._getKey()); case 2: texture = _context.v; batchableSprite = gpuText.batchableSprite; batchableSprite.texture = gpuText.texture = texture; gpuText.generatingTexture = false; gpuText.textureNeedsUploading = true; htmlText.onViewUpdate(); updateTextBounds.updateTextBounds(batchableSprite, htmlText); case 3: return _context.a(2); } }, _callee, this); })); function _updateGpuText(_x) { return _updateGpuText2.apply(this, arguments); } return _updateGpuText; }() }, { key: "_getGpuText", value: function _getGpuText(htmlText) { return this._gpuText[htmlText.uid] || this.initGpuText(htmlText); } }, { key: "initGpuText", value: function initGpuText(htmlText) { var gpuTextData = { texture: Texture.Texture.EMPTY, currentKey: "--", batchableSprite: PoolGroup.BigPool.get(BatchableSprite.BatchableSprite), textureNeedsUploading: false, generatingTexture: false }; var batchableSprite = gpuTextData.batchableSprite; batchableSprite.renderable = htmlText; batchableSprite.transform = htmlText.groupTransform; batchableSprite.texture = Texture.Texture.EMPTY; batchableSprite.bounds = { minX: 0, maxX: 1, minY: 0, maxY: 0 }; batchableSprite.roundPixels = this._renderer._roundPixels | htmlText._roundPixels; htmlText._resolution = htmlText._autoResolution ? this._renderer.resolution : htmlText.resolution; this._gpuText[htmlText.uid] = gpuTextData; htmlText.on("destroyed", this._destroyRenderableBound); return gpuTextData; } }, { key: "destroy", value: function destroy() { for (var i in this._gpuText) { this._destroyRenderableById(i); } this._gpuText = null; this._renderer = null; } }]); }(); /** @ignore */ HTMLTextPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "htmlText" }; exports.HTMLTextPipe = HTMLTextPipe; /***/ }), /***/ 39244: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var sortMixin = { _zIndex: 0, /** * Should children be sorted by zIndex at the next render call. * * Will get automatically set to true if a new child is added, or if a child's zIndex changes. * @type {boolean} * @memberof scene.Container# */ sortDirty: false, /** * If set to true, the container will sort its children by `zIndex` value * when the next render is called, or manually if `sortChildren()` is called. * * This actually changes the order of elements in the array, so should be treated * as a basic solution that is not performant compared to other solutions, * such as {@link https://github.com/pixijs/layers PixiJS Layers} * * Also be aware of that this may not work nicely with the `addChildAt()` function, * as the `zIndex` sorting may cause the child to automatically sorted to another position. * @type {boolean} * @memberof scene.Container# */ sortableChildren: false, /** * The zIndex of the container. * * Setting this value, will automatically set the parent to be sortable. Children will be automatically * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, * and thus rendered on top of other display objects within the same container. * @see scene.Container#sortableChildren * @memberof scene.Container# */ get zIndex() { return this._zIndex; }, set zIndex(value) { if (this._zIndex === value) return; this._zIndex = value; this.depthOfChildModified(); }, depthOfChildModified: function depthOfChildModified() { if (this.parent) { this.parent.sortableChildren = true; this.parent.sortDirty = true; } if (this.parentRenderGroup) { this.parentRenderGroup.structureDidChange = true; } }, /** * Sorts children by zIndex. * @memberof scene.Container# */ sortChildren: function sortChildren() { if (!this.sortDirty) return; this.sortDirty = false; this.children.sort(_sortChildren); } }; function _sortChildren(a, b) { return a._zIndex - b._zIndex; } exports.sortMixin = sortMixin; /***/ }), /***/ 39292: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["animationSpeed", "autoPlay", "autoUpdate", "loop", "onComplete", "onFrameChange", "onLoop", "textures", "updateAnchor"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Texture = __webpack_require__(73782); var _const = __webpack_require__(20105); var Ticker = __webpack_require__(6014); var Sprite = __webpack_require__(27615); "use strict"; var AnimatedSprite = /*#__PURE__*/function (_Sprite$Sprite) { /** @ignore */ function AnimatedSprite() { var _this; _classCallCheck(this, AnimatedSprite); var options = arguments.length <= 0 ? undefined : arguments[0]; if (Array.isArray(arguments.length <= 0 ? undefined : arguments[0])) { options = { textures: arguments.length <= 0 ? undefined : arguments[0], autoUpdate: arguments.length <= 1 ? undefined : arguments[1] }; } var _options = options, _options$animationSpe = _options.animationSpeed, animationSpeed = _options$animationSpe === void 0 ? 1 : _options$animationSpe, _options$autoPlay = _options.autoPlay, autoPlay = _options$autoPlay === void 0 ? false : _options$autoPlay, _options$autoUpdate = _options.autoUpdate, autoUpdate = _options$autoUpdate === void 0 ? true : _options$autoUpdate, _options$loop = _options.loop, loop = _options$loop === void 0 ? true : _options$loop, _options$onComplete = _options.onComplete, onComplete = _options$onComplete === void 0 ? null : _options$onComplete, _options$onFrameChang = _options.onFrameChange, onFrameChange = _options$onFrameChang === void 0 ? null : _options$onFrameChang, _options$onLoop = _options.onLoop, onLoop = _options$onLoop === void 0 ? null : _options$onLoop, textures = _options.textures, _options$updateAnchor = _options.updateAnchor, updateAnchor = _options$updateAnchor === void 0 ? false : _options$updateAnchor, rest = _objectWithoutProperties(_options, _excluded); var _textures = _slicedToArray(textures, 1), firstFrame = _textures[0]; _this = _callSuper(this, AnimatedSprite, [_objectSpread(_objectSpread({}, rest), {}, { texture: firstFrame instanceof Texture.Texture ? firstFrame : firstFrame.texture })]); _this._textures = null; _this._durations = null; _this._autoUpdate = autoUpdate; _this._isConnectedToTicker = false; _this.animationSpeed = animationSpeed; _this.loop = loop; _this.updateAnchor = updateAnchor; _this.onComplete = onComplete; _this.onFrameChange = onFrameChange; _this.onLoop = onLoop; _this._currentTime = 0; _this._playing = false; _this._previousFrame = null; _this.textures = textures; if (autoPlay) { _this.play(); } return _this; } /** Stops the AnimatedSprite. */ _inherits(AnimatedSprite, _Sprite$Sprite); return _createClass(AnimatedSprite, [{ key: "stop", value: function stop() { if (!this._playing) { return; } this._playing = false; if (this._autoUpdate && this._isConnectedToTicker) { Ticker.Ticker.shared.remove(this.update, this); this._isConnectedToTicker = false; } } /** Plays the AnimatedSprite. */ }, { key: "play", value: function play() { if (this._playing) { return; } this._playing = true; if (this._autoUpdate && !this._isConnectedToTicker) { Ticker.Ticker.shared.add(this.update, this, _const.UPDATE_PRIORITY.HIGH); this._isConnectedToTicker = true; } } /** * Stops the AnimatedSprite and goes to a specific frame. * @param frameNumber - Frame index to stop at. */ }, { key: "gotoAndStop", value: function gotoAndStop(frameNumber) { this.stop(); this.currentFrame = frameNumber; } /** * Goes to a specific frame and begins playing the AnimatedSprite. * @param frameNumber - Frame index to start at. */ }, { key: "gotoAndPlay", value: function gotoAndPlay(frameNumber) { this.currentFrame = frameNumber; this.play(); } /** * Updates the object transform for rendering. * @param ticker - the ticker to use to update the object. */ }, { key: "update", value: function update(ticker) { if (!this._playing) { return; } var deltaTime = ticker.deltaTime; var elapsed = this.animationSpeed * deltaTime; var previousFrame = this.currentFrame; if (this._durations !== null) { var lag = this._currentTime % 1 * this._durations[this.currentFrame]; lag += elapsed / 60 * 1e3; while (lag < 0) { this._currentTime--; lag += this._durations[this.currentFrame]; } var sign = Math.sign(this.animationSpeed * deltaTime); this._currentTime = Math.floor(this._currentTime); while (lag >= this._durations[this.currentFrame]) { lag -= this._durations[this.currentFrame] * sign; this._currentTime += sign; } this._currentTime += lag / this._durations[this.currentFrame]; } else { this._currentTime += elapsed; } if (this._currentTime < 0 && !this.loop) { this.gotoAndStop(0); if (this.onComplete) { this.onComplete(); } } else if (this._currentTime >= this._textures.length && !this.loop) { this.gotoAndStop(this._textures.length - 1); if (this.onComplete) { this.onComplete(); } } else if (previousFrame !== this.currentFrame) { if (this.loop && this.onLoop) { if (this.animationSpeed > 0 && this.currentFrame < previousFrame || this.animationSpeed < 0 && this.currentFrame > previousFrame) { this.onLoop(); } } this._updateTexture(); } } /** Updates the displayed texture to match the current frame index. */ }, { key: "_updateTexture", value: function _updateTexture() { var currentFrame = this.currentFrame; if (this._previousFrame === currentFrame) { return; } this._previousFrame = currentFrame; this.texture = this._textures[currentFrame]; if (this.updateAnchor && this.texture.defaultAnchor) { this.anchor.copyFrom(this.texture.defaultAnchor); } if (this.onFrameChange) { this.onFrameChange(this.currentFrame); } } /** Stops the AnimatedSprite and destroys it. */ }, { key: "destroy", value: function destroy() { this.stop(); _superPropGet(AnimatedSprite, "destroy", this, 3)([]); this.onComplete = null; this.onFrameChange = null; this.onLoop = null; } /** * A short hand way of creating an AnimatedSprite from an array of frame ids. * @param frames - The array of frames ids the AnimatedSprite will use as its texture frames. * @returns - The new animated sprite with the specified frames. */ }, { key: "totalFrames", get: /** * The total number of frames in the AnimatedSprite. This is the same as number of textures * assigned to the AnimatedSprite. * @readonly * @default 0 */ function get() { return this._textures.length; } /** The array of textures used for this AnimatedSprite. */ }, { key: "textures", get: function get() { return this._textures; }, set: function set(value) { if (value[0] instanceof Texture.Texture) { this._textures = value; this._durations = null; } else { this._textures = []; this._durations = []; for (var i = 0; i < value.length; i++) { this._textures.push(value[i].texture); this._durations.push(value[i].time); } } this._previousFrame = null; this.gotoAndStop(0); this._updateTexture(); } /** The AnimatedSprite's current frame index. */ }, { key: "currentFrame", get: function get() { var currentFrame = Math.floor(this._currentTime) % this._textures.length; if (currentFrame < 0) { currentFrame += this._textures.length; } return currentFrame; }, set: function set(value) { if (value < 0 || value > this.totalFrames - 1) { throw new Error("[AnimatedSprite]: Invalid frame index value ".concat(value, ", expected to be between 0 and totalFrames ").concat(this.totalFrames, ".")); } var previousFrame = this.currentFrame; this._currentTime = value; if (previousFrame !== this.currentFrame) { this._updateTexture(); } } /** * Indicates if the AnimatedSprite is currently playing. * @readonly */ }, { key: "playing", get: function get() { return this._playing; } /** Whether to use Ticker.shared to auto update animation time. */ }, { key: "autoUpdate", get: function get() { return this._autoUpdate; }, set: function set(value) { if (value !== this._autoUpdate) { this._autoUpdate = value; if (!this._autoUpdate && this._isConnectedToTicker) { Ticker.Ticker.shared.remove(this.update, this); this._isConnectedToTicker = false; } else if (this._autoUpdate && !this._isConnectedToTicker && this._playing) { Ticker.Ticker.shared.add(this.update, this); this._isConnectedToTicker = true; } } } }], [{ key: "fromFrames", value: function fromFrames(frames) { var textures = []; for (var i = 0; i < frames.length; ++i) { textures.push(Texture.Texture.from(frames[i])); } return new AnimatedSprite(textures); } /** * A short hand way of creating an AnimatedSprite from an array of image ids. * @param images - The array of image urls the AnimatedSprite will use as its texture frames. * @returns The new animate sprite with the specified images as frames. */ }, { key: "fromImages", value: function fromImages(images) { var textures = []; for (var i = 0; i < images.length; ++i) { textures.push(Texture.Texture.from(images[i])); } return new AnimatedSprite(textures); } }]); }(Sprite.Sprite); exports.AnimatedSprite = AnimatedSprite; /***/ }), /***/ 39333: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var earcut = __webpack_require__(32231); "use strict"; function triangulateWithHoles(points, holes, vertices, verticesStride, verticesOffset, indices, indicesOffset) { var triangles = earcut(points, holes, 2); if (!triangles) { return; } for (var i = 0; i < triangles.length; i += 3) { indices[indicesOffset++] = triangles[i] + verticesOffset; indices[indicesOffset++] = triangles[i + 1] + verticesOffset; indices[indicesOffset++] = triangles[i + 2] + verticesOffset; } var index = verticesOffset * verticesStride; for (var _i = 0; _i < points.length; _i += 2) { vertices[index] = points[_i]; vertices[index + 1] = points[_i + 1]; index += verticesStride; } } exports.triangulateWithHoles = triangulateWithHoles; /***/ }), /***/ 39401: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } var GlRenderTarget = /*#__PURE__*/_createClass(function GlRenderTarget() { _classCallCheck(this, GlRenderTarget); this.width = -1; this.height = -1; this.msaa = false; this.msaaRenderBuffer = []; }); exports.GlRenderTarget = GlRenderTarget; /***/ }), /***/ 39779: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var LoaderParser = __webpack_require__(96804); var createTexture = __webpack_require__(49698); var checkExtension = __webpack_require__(59230); var Extensions = __webpack_require__(86890); var CompressedSource = __webpack_require__(49326); var getSupportedTextureFormats = __webpack_require__(10144); var parseDDS = __webpack_require__(14432); "use strict"; var loadDDS = { extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.High, name: "loadDDS" }, name: "loadDDS", test: function test(url) { return checkExtension.checkExtension(url, [".dds"]); }, load: function load(url, _asset, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var supportedTextures, ddsResponse, ddsArrayBuffer, textureOptions, compressedTextureSource; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return getSupportedTextureFormats.getSupportedTextureFormats(); case 1: supportedTextures = _context.v; _context.n = 2; return fetch(url); case 2: ddsResponse = _context.v; _context.n = 3; return ddsResponse.arrayBuffer(); case 3: ddsArrayBuffer = _context.v; textureOptions = parseDDS.parseDDS(ddsArrayBuffer, supportedTextures); compressedTextureSource = new CompressedSource.CompressedSource(textureOptions); return _context.a(2, createTexture.createTexture(compressedTextureSource, loader, url)); } }, _callee); }))(); }, unload: function unload(texture) { if (Array.isArray(texture)) { texture.forEach(function (t) { return t.destroy(true); }); } else { texture.destroy(true); } } }; exports.loadDDS = loadDDS; /***/ }), /***/ 39992: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var ColorBurnBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function ColorBurnBlend() { _classCallCheck(this, ColorBurnBlend); return _callSuper(this, ColorBurnBlend, [{ gl: { functions: "\n float colorBurn(float base, float blend)\n {\n return max((1.0 - ((1.0 - base) / blend)), 0.0);\n }\n\n vec3 blendColorBurn(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n colorBurn(base.r, blend.r),\n colorBurn(base.g, blend.g),\n colorBurn(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendColorBurn(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn colorBurn(base:f32, blend:f32) -> f32\n {\n return max((1.0-((1.0-base)/blend)),0.0);\n }\n\n fn blendColorBurn(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n colorBurn(base.r, blend.r),\n colorBurn(base.g, blend.g),\n colorBurn(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendColorBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(ColorBurnBlend, _BlendModeFilter$Blen); return _createClass(ColorBurnBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ ColorBurnBlend.extension = { name: "color-burn", type: Extensions.ExtensionType.BlendMode }; exports.ColorBurnBlend = ColorBurnBlend; /***/ }), /***/ 40180: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } var nssvg = "http://www.w3.org/2000/svg"; var nsxhtml = "http://www.w3.org/1999/xhtml"; var HTMLTextRenderData = /*#__PURE__*/_createClass(function HTMLTextRenderData() { _classCallCheck(this, HTMLTextRenderData); this.svgRoot = document.createElementNS(nssvg, "svg"); this.foreignObject = document.createElementNS(nssvg, "foreignObject"); this.domElement = document.createElementNS(nsxhtml, "div"); this.styleElement = document.createElementNS(nsxhtml, "style"); this.image = new Image(); var foreignObject = this.foreignObject, svgRoot = this.svgRoot, styleElement = this.styleElement, domElement = this.domElement; foreignObject.setAttribute("width", "10000"); foreignObject.setAttribute("height", "10000"); foreignObject.style.overflow = "hidden"; svgRoot.appendChild(foreignObject); foreignObject.appendChild(styleElement); foreignObject.appendChild(domElement); }); exports.HTMLTextRenderData = HTMLTextRenderData; exports.nssvg = nssvg; exports.nsxhtml = nsxhtml; /***/ }), /***/ 40230: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Resolver = __webpack_require__(54080); "use strict"; function getResolutionOfUrl(url) { var _Resolver$Resolver$RE; var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var resolution = (_Resolver$Resolver$RE = Resolver.Resolver.RETINA_PREFIX) === null || _Resolver$Resolver$RE === void 0 ? void 0 : _Resolver$Resolver$RE.exec(url); if (resolution) { return parseFloat(resolution[1]); } return defaultValue; } exports.getResolutionOfUrl = getResolutionOfUrl; /***/ }), /***/ 40260: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var supportedGLCompressedTextureFormats; function getSupportedGlCompressedTextureFormats() { if (supportedGLCompressedTextureFormats) return supportedGLCompressedTextureFormats; var canvas = document.createElement("canvas"); var gl = canvas.getContext("webgl"); if (!gl) { return []; } supportedGLCompressedTextureFormats = [].concat(_toConsumableArray(gl.getExtension("EXT_texture_compression_bptc") ? ["bc6h-rgb-ufloat", "bc6h-rgb-float", "bc7-rgba-unorm", "bc7-rgba-unorm-srgb"] : []), _toConsumableArray(gl.getExtension("WEBGL_compressed_texture_s3tc") ? ["bc1-rgba-unorm", "bc2-rgba-unorm", "bc3-rgba-unorm"] : []), _toConsumableArray(gl.getExtension("WEBGL_compressed_texture_s3tc_srgb") ? ["bc1-rgba-unorm-srgb", "bc2-rgba-unorm-srgb", "bc3-rgba-unorm-srgb"] : []), _toConsumableArray(gl.getExtension("EXT_texture_compression_rgtc") ? ["bc4-r-unorm", "bc4-r-snorm", "bc5-rg-unorm", "bc5-rg-snorm"] : []), _toConsumableArray(gl.getExtension("WEBGL_compressed_texture_etc") ? ["etc2-rgb8unorm", "etc2-rgb8unorm-srgb", "etc2-rgba8unorm", "etc2-rgba8unorm-srgb", "etc2-rgb8a1unorm", "etc2-rgb8a1unorm-srgb", "eac-r11unorm", "eac-rg11unorm"] : []), _toConsumableArray(gl.getExtension("WEBGL_compressed_texture_astc") ? ["astc-4x4-unorm", "astc-4x4-unorm-srgb", "astc-5x4-unorm", "astc-5x4-unorm-srgb", "astc-5x5-unorm", "astc-5x5-unorm-srgb", "astc-6x5-unorm", "astc-6x5-unorm-srgb", "astc-6x6-unorm", "astc-6x6-unorm-srgb", "astc-8x5-unorm", "astc-8x5-unorm-srgb", "astc-8x6-unorm", "astc-8x6-unorm-srgb", "astc-8x8-unorm", "astc-8x8-unorm-srgb", "astc-10x5-unorm", "astc-10x5-unorm-srgb", "astc-10x6-unorm", "astc-10x6-unorm-srgb", "astc-10x8-unorm", "astc-10x8-unorm-srgb", "astc-10x10-unorm", "astc-10x10-unorm-srgb", "astc-12x10-unorm", "astc-12x10-unorm-srgb", "astc-12x12-unorm", "astc-12x12-unorm-srgb"] : [])); return supportedGLCompressedTextureFormats; } exports.getSupportedGlCompressedTextureFormats = getSupportedGlCompressedTextureFormats; /***/ }), /***/ 40355: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } Object.defineProperty(exports, "__esModule", ({ value: true })); var _exportNames = {}; Object.defineProperty(exports, "default", ({ enumerable: true, get: function get() { return _isMobile["default"]; } })); var _isMobile = _interopRequireWildcard(__webpack_require__(51829)); Object.keys(_isMobile).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _isMobile[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _isMobile[key]; } }); }); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } /***/ }), /***/ 40474: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function logPrettyShaderError(gl, shader) { var _console; var shaderSrc = gl.getShaderSource(shader).split("\n").map(function (line, index) { return "".concat(index, ": ").concat(line); }); var shaderLog = gl.getShaderInfoLog(shader); var splitShader = shaderLog.split("\n"); var dedupe = {}; var lineNumbers = splitShader.map(function (line) { return parseFloat(line.replace(/^ERROR\: 0\:([\d]+)\:.*$/, "$1")); }).filter(function (n) { if (n && !dedupe[n]) { dedupe[n] = true; return true; } return false; }); var logArgs = [""]; lineNumbers.forEach(function (number) { shaderSrc[number - 1] = "%c".concat(shaderSrc[number - 1], "%c"); logArgs.push("background: #FF0000; color:#FFFFFF; font-size: 10px", "font-size: 10px"); }); var fragmentSourceToLog = shaderSrc.join("\n"); logArgs[0] = fragmentSourceToLog; console.error(shaderLog); console.groupCollapsed("click to view full shader code"); (_console = console).warn.apply(_console, logArgs); console.groupEnd(); } function logProgramError(gl, program, vertexShader, fragmentShader) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) { logPrettyShaderError(gl, vertexShader); } if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) { logPrettyShaderError(gl, fragmentShader); } console.error("PixiJS Error: Could not initialize shader."); if (gl.getProgramInfoLog(program) !== "") { console.warn("PixiJS Warning: gl.getProgramInfoLog()", gl.getProgramInfoLog(program)); } } } exports.logProgramError = logProgramError; /***/ }), /***/ 40486: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function booleanArray(size) { var array = new Array(size); for (var i = 0; i < array.length; i++) { array[i] = false; } return array; } function defaultValue(type, size) { switch (type) { case "float": return 0; case "vec2": return new Float32Array(2 * size); case "vec3": return new Float32Array(3 * size); case "vec4": return new Float32Array(4 * size); case "int": case "uint": case "sampler2D": case "sampler2DArray": return 0; case "ivec2": return new Int32Array(2 * size); case "ivec3": return new Int32Array(3 * size); case "ivec4": return new Int32Array(4 * size); case "uvec2": return new Uint32Array(2 * size); case "uvec3": return new Uint32Array(3 * size); case "uvec4": return new Uint32Array(4 * size); case "bool": return false; case "bvec2": return booleanArray(2 * size); case "bvec3": return booleanArray(3 * size); case "bvec4": return booleanArray(4 * size); case "mat2": return new Float32Array([1, 0, 0, 1]); case "mat3": return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); case "mat4": return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]); } return null; } exports.defaultValue = defaultValue; /***/ }), /***/ 40545: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } var Extensions = __webpack_require__(86890); var getTextureBatchBindGroup = __webpack_require__(62340); var DefaultBatcher = __webpack_require__(91938); var InstructionSet = __webpack_require__(15571); var deprecation = __webpack_require__(11225); var PoolGroup = __webpack_require__(47505); var buildContextBatches = __webpack_require__(82847); "use strict"; var GpuGraphicsContext = /*#__PURE__*/_createClass(function GpuGraphicsContext() { _classCallCheck(this, GpuGraphicsContext); this.batches = []; this.geometryData = { vertices: [], uvs: [], indices: [] }; }); var GraphicsContextRenderData = /*#__PURE__*/function () { function GraphicsContextRenderData() { _classCallCheck(this, GraphicsContextRenderData); this.batcher = new DefaultBatcher.DefaultBatcher(); this.instructions = new InstructionSet.InstructionSet(); } return _createClass(GraphicsContextRenderData, [{ key: "init", value: function init() { this.instructions.reset(); } /** * @deprecated since version 8.0.0 * Use `batcher.geometry` instead. * @see {Batcher#geometry} */ }, { key: "geometry", get: function get() { deprecation.deprecation(deprecation.v8_3_4, "GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."); return this.batcher.geometry; } }]); }(); var _GraphicsContextSystem = /*#__PURE__*/function () { function _GraphicsContextSystem(renderer) { _classCallCheck(this, _GraphicsContextSystem); // the root context batches, used to either make a batch or geometry // all graphics use this as a base this._gpuContextHash = {}; // used for non-batchable graphics this._graphicsDataContextHash = /* @__PURE__ */Object.create(null); renderer.renderableGC.addManagedHash(this, "_gpuContextHash"); renderer.renderableGC.addManagedHash(this, "_graphicsDataContextHash"); } /** * Runner init called, update the default options * @ignore */ return _createClass(_GraphicsContextSystem, [{ key: "init", value: function init(options) { var _options$bezierSmooth; _GraphicsContextSystem.defaultOptions.bezierSmoothness = (_options$bezierSmooth = options === null || options === void 0 ? void 0 : options.bezierSmoothness) !== null && _options$bezierSmooth !== void 0 ? _options$bezierSmooth : _GraphicsContextSystem.defaultOptions.bezierSmoothness; } }, { key: "getContextRenderData", value: function getContextRenderData(context) { return this._graphicsDataContextHash[context.uid] || this._initContextRenderData(context); } // Context management functions }, { key: "updateGpuContext", value: function updateGpuContext(context) { var gpuContext = this._gpuContextHash[context.uid] || this._initContext(context); if (context.dirty) { if (gpuContext) { this._cleanGraphicsContextData(context); } else { gpuContext = this._initContext(context); } buildContextBatches.buildContextBatches(context, gpuContext); var batchMode = context.batchMode; if (context.customShader || batchMode === "no-batch") { gpuContext.isBatchable = false; } else if (batchMode === "auto") { gpuContext.isBatchable = gpuContext.geometryData.vertices.length < 400; } context.dirty = false; } return gpuContext; } }, { key: "getGpuContext", value: function getGpuContext(context) { return this._gpuContextHash[context.uid] || this._initContext(context); } }, { key: "_initContextRenderData", value: function _initContextRenderData(context) { var graphicsData = PoolGroup.BigPool.get(GraphicsContextRenderData); var _this$_gpuContextHash = this._gpuContextHash[context.uid], batches = _this$_gpuContextHash.batches, geometryData = _this$_gpuContextHash.geometryData; var vertexSize = geometryData.vertices.length; var indexSize = geometryData.indices.length; for (var i = 0; i < batches.length; i++) { batches[i].applyTransform = false; } var batcher = graphicsData.batcher; batcher.ensureAttributeBuffer(vertexSize); batcher.ensureIndexBuffer(indexSize); batcher.begin(); for (var _i = 0; _i < batches.length; _i++) { var batch = batches[_i]; batcher.add(batch); } batcher.finish(graphicsData.instructions); var geometry = batcher.geometry; geometry.indexBuffer.setDataWithSize(batcher.indexBuffer, batcher.indexSize, true); geometry.buffers[0].setDataWithSize(batcher.attributeBuffer.float32View, batcher.attributeSize, true); var drawBatches = batcher.batches; for (var _i2 = 0; _i2 < drawBatches.length; _i2++) { var _batch = drawBatches[_i2]; _batch.bindGroup = getTextureBatchBindGroup.getTextureBatchBindGroup(_batch.textures.textures, _batch.textures.count); } this._graphicsDataContextHash[context.uid] = graphicsData; return graphicsData; } }, { key: "_initContext", value: function _initContext(context) { var gpuContext = new GpuGraphicsContext(); gpuContext.context = context; this._gpuContextHash[context.uid] = gpuContext; context.on("destroy", this.onGraphicsContextDestroy, this); return this._gpuContextHash[context.uid]; } }, { key: "onGraphicsContextDestroy", value: function onGraphicsContextDestroy(context) { this._cleanGraphicsContextData(context); context.off("destroy", this.onGraphicsContextDestroy, this); this._gpuContextHash[context.uid] = null; } }, { key: "_cleanGraphicsContextData", value: function _cleanGraphicsContextData(context) { var gpuContext = this._gpuContextHash[context.uid]; if (!gpuContext.isBatchable) { if (this._graphicsDataContextHash[context.uid]) { PoolGroup.BigPool["return"](this.getContextRenderData(context)); this._graphicsDataContextHash[context.uid] = null; } } if (gpuContext.batches) { gpuContext.batches.forEach(function (batch) { PoolGroup.BigPool["return"](batch); }); } } }, { key: "destroy", value: function destroy() { for (var i in this._gpuContextHash) { if (this._gpuContextHash[i]) { this.onGraphicsContextDestroy(this._gpuContextHash[i].context); } } } }]); }(); /** @ignore */ _GraphicsContextSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "graphicsContext" }; /** The default options for the GraphicsContextSystem. */ _GraphicsContextSystem.defaultOptions = { /** * A value from 0 to 1 that controls the smoothness of bezier curves (the higher the smoother) * @default 0.5 */ bezierSmoothness: 0.5 }; var GraphicsContextSystem = _GraphicsContextSystem; exports.GpuGraphicsContext = GpuGraphicsContext; exports.GraphicsContextRenderData = GraphicsContextRenderData; exports.GraphicsContextSystem = GraphicsContextSystem; /***/ }), /***/ 40559: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var warn = __webpack_require__(57371); var GlProgramData = __webpack_require__(41568); var compileShader = __webpack_require__(80442); var defaultValue = __webpack_require__(40486); var extractAttributesFromGlProgram = __webpack_require__(3061); var getUboData = __webpack_require__(31216); var getUniformData = __webpack_require__(98192); var logProgramError = __webpack_require__(40474); "use strict"; function generateProgram(gl, program) { var glVertShader = compileShader.compileShader(gl, gl.VERTEX_SHADER, program.vertex); var glFragShader = compileShader.compileShader(gl, gl.FRAGMENT_SHADER, program.fragment); var webGLProgram = gl.createProgram(); gl.attachShader(webGLProgram, glVertShader); gl.attachShader(webGLProgram, glFragShader); var transformFeedbackVaryings = program.transformFeedbackVaryings; if (transformFeedbackVaryings) { if (typeof gl.transformFeedbackVaryings !== "function") { warn.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."); } else { gl.transformFeedbackVaryings(webGLProgram, transformFeedbackVaryings.names, transformFeedbackVaryings.bufferMode === "separate" ? gl.SEPARATE_ATTRIBS : gl.INTERLEAVED_ATTRIBS); } } gl.linkProgram(webGLProgram); if (!gl.getProgramParameter(webGLProgram, gl.LINK_STATUS)) { logProgramError.logProgramError(gl, webGLProgram, glVertShader, glFragShader); } program._attributeData = extractAttributesFromGlProgram.extractAttributesFromGlProgram(webGLProgram, gl, !/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(program.vertex)); program._uniformData = getUniformData.getUniformData(webGLProgram, gl); program._uniformBlockData = getUboData.getUboData(webGLProgram, gl); gl.deleteShader(glVertShader); gl.deleteShader(glFragShader); var uniformData = {}; for (var i in program._uniformData) { var data = program._uniformData[i]; uniformData[i] = { location: gl.getUniformLocation(webGLProgram, i), value: defaultValue.defaultValue(data.type, data.size) }; } var glProgram = new GlProgramData.GlProgramData(webGLProgram, uniformData); return glProgram; } exports.generateProgram = generateProgram; /***/ }), /***/ 40918: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _AbstractScene = _interopRequireDefault(__webpack_require__(33186)); var _OOP = __webpack_require__(64181); var _FCore = __webpack_require__(49997); var _Level1Scene = _interopRequireDefault(__webpack_require__(26387)); var _PreviewScene = _interopRequireDefault(__webpack_require__(32230)); var _pixi = __webpack_require__(3635); var _util = __webpack_require__(19330); var _Map1Scene = _interopRequireDefault(__webpack_require__(16711)); var _SummaryScene = _interopRequireDefault(__webpack_require__(93938)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @extends AbstractScene * @constructor */ function MainMenuScene() { _AbstractScene["default"].apply(this, arguments); this.ev_keydown = this.ev_keydown.bind(this); this.selectedButtonIdx = -1; } (0, _OOP.mixClass)(MainMenuScene, _AbstractScene["default"]); MainMenuScene.prototype.create = function () { var _this = this; this.logo = new _pixi.Sprite(this.assetMng.getTexture('main_logo')); this.logo.x = 158; this.logo.y = 65; this.logoKeyFrame = Math.random(); this.$bg = (0, _FCore._)('.as-main-menu-bg'); this.$buttons = ["BẮT ĐẦU", "Cài đặt", 'Help'].map(function (text, i) { return (0, _FCore._)({ "class": 'as-main-menu-button-wrapper', child: { tag: 'button', "class": ['as-img-btn', 'as-main-menu-button'], child: [{ tag: 'img', attr: { src: 'assets/menu_button_wood.png' } }, { "class": 'as-img-btn-text', attr: { 'data-text': text } }] }, on: { mouseover: function mouseover() { _this.selectButton(i); } } }); }); // this.$buttons[0].addClass('as-active'); this.$butonList = (0, _FCore._)({ "class": 'as-main-menu-button-list', child: this.$buttons }); this.$buttons[0].addClass('as-start-btn'); this.$buttons[0].on('click', function () { _this.app.startScene(_Map1Scene["default"]); }); this.$buttons[1].on('click', function () { _this.app.startScene(_SummaryScene["default"]); }); this.$buttons[2].on('click', function () { window.open('https://www.youtube.com/watch?v=tgv_hb1Wk6s', '_blank'); }); this.$menuCursor = (0, _FCore._)({ tag: 'img', "class": 'as-menu-cursor', attr: { src: 'assets/menu_cursor.png' } }).addTo(this.$butonList); }; MainMenuScene.prototype.update = function (deltaTime) { this.logoKeyFrame += deltaTime / 5000; this.logoKeyFrame = this.logoKeyFrame % 1; var t = this.logoKeyFrame * 2; t = t > 1 ? 2 - t : t; t = (0, _util.bezierBlend)(t); this.logo.y = 65 + 15 * t; }; MainMenuScene.prototype.onStart = function () { this.$background.addChild(this.$bg); this.$foreground.addChild(this.$butonList); document.addEventListener('keydown', this.ev_keydown); this.pixi.stage.addChild(this.logo); }; MainMenuScene.prototype.onStop = function () { this.$bg.remove(); this.$butonList.remove(); document.removeEventListener('keydown', this.ev_keydown); this.pixi.stage.removeChild(this.logo); }; MainMenuScene.prototype.selectButton = function (i) { if (this.selectedButtonIdx === i) return; this.selectedButtonIdx = i; this.$buttons.forEach(function (btn, j) { if (i === j) btn.addClass('as-hover');else btn.removeClass('as-hover'); }); if (i < 0) { this.$menuCursor.addStyle('opacity', '0'); } else { this.$menuCursor.addStyle('--value', i); this.$menuCursor.addStyle('opacity', '1'); } }; /** * @param {KeyboardEvent} event */ MainMenuScene.prototype.ev_keydown = function (event) { console.log(event); }; var _default = exports["default"] = MainMenuScene; /***/ }), /***/ 40925: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 41136: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var groupD8 = __webpack_require__(56018); "use strict"; var TextureUvs = /*#__PURE__*/function () { function TextureUvs() { _classCallCheck(this, TextureUvs); this.x0 = 0; this.y0 = 0; this.x1 = 1; this.y1 = 0; this.x2 = 1; this.y2 = 1; this.x3 = 0; this.y3 = 1; this.uvsFloat32 = new Float32Array(8); } /** * Sets the texture Uvs based on the given frame information. * @protected * @param frame - The frame of the texture * @param baseFrame - The base frame of the texture * @param rotate - Rotation of frame, see {@link groupD8} */ return _createClass(TextureUvs, [{ key: "set", value: function set(frame, baseFrame, rotate) { var tw = baseFrame.width; var th = baseFrame.height; if (rotate) { var w2 = frame.width / 2 / tw; var h2 = frame.height / 2 / th; var cX = frame.x / tw + w2; var cY = frame.y / th + h2; rotate = groupD8.groupD8.add(rotate, groupD8.groupD8.NW); this.x0 = cX + w2 * groupD8.groupD8.uX(rotate); this.y0 = cY + h2 * groupD8.groupD8.uY(rotate); rotate = groupD8.groupD8.add(rotate, 2); this.x1 = cX + w2 * groupD8.groupD8.uX(rotate); this.y1 = cY + h2 * groupD8.groupD8.uY(rotate); rotate = groupD8.groupD8.add(rotate, 2); this.x2 = cX + w2 * groupD8.groupD8.uX(rotate); this.y2 = cY + h2 * groupD8.groupD8.uY(rotate); rotate = groupD8.groupD8.add(rotate, 2); this.x3 = cX + w2 * groupD8.groupD8.uX(rotate); this.y3 = cY + h2 * groupD8.groupD8.uY(rotate); } else { this.x0 = frame.x / tw; this.y0 = frame.y / th; this.x1 = (frame.x + frame.width) / tw; this.y1 = frame.y / th; this.x2 = (frame.x + frame.width) / tw; this.y2 = (frame.y + frame.height) / th; this.x3 = frame.x / tw; this.y3 = (frame.y + frame.height) / th; } this.uvsFloat32[0] = this.x0; this.uvsFloat32[1] = this.y0; this.uvsFloat32[2] = this.x1; this.uvsFloat32[3] = this.y1; this.uvsFloat32[4] = this.x2; this.uvsFloat32[5] = this.y2; this.uvsFloat32[6] = this.x3; this.uvsFloat32[7] = this.y3; } }, { key: "toString", value: function toString() { return "[pixi.js/core:TextureUvs x0=".concat(this.x0, " y0=").concat(this.y0, " x1=").concat(this.x1, " y1=").concat(this.y1, " x2=").concat(this.x2, " y2=").concat(this.y2, " x3=").concat(this.x3, " y3=").concat(this.y3, "]"); } }]); }(); exports.TextureUvs = TextureUvs; /***/ }), /***/ 41267: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Container = __webpack_require__(47719); var Texture = __webpack_require__(73782); "use strict"; var imageTypes = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" }; var _ExtractSystem = /*#__PURE__*/function () { /** @param renderer - The renderer this System works for. */ function _ExtractSystem(renderer) { _classCallCheck(this, _ExtractSystem); this._renderer = renderer; } return _createClass(_ExtractSystem, [{ key: "_normalizeOptions", value: function _normalizeOptions(options) { var defaults = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (options instanceof Container.Container || options instanceof Texture.Texture) { return _objectSpread({ target: options }, defaults); } return _objectSpread(_objectSpread({}, defaults), options); } /** * Will return a HTML Image of the target * @param options - The options for creating the image, or the target to extract * @returns - HTML Image of the target */ }, { key: "image", value: (function () { var _image = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) { var image; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: image = new Image(); _context.n = 1; return this.base64(options); case 1: image.src = _context.v; return _context.a(2, image); } }, _callee, this); })); function image(_x) { return _image.apply(this, arguments); } return image; }() /** * Will return a base64 encoded string of this target. It works by calling * `Extract.canvas` and then running toDataURL on that. * @param options - The options for creating the image, or the target to extract */ ) }, { key: "base64", value: (function () { var _base = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) { var _options, format, quality, canvas, blob; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: options = this._normalizeOptions(options, _ExtractSystem.defaultImageOptions); _options = options, format = _options.format, quality = _options.quality; canvas = this.canvas(options); if (!(canvas.toBlob !== void 0)) { _context2.n = 1; break; } return _context2.a(2, new Promise(function (resolve, reject) { canvas.toBlob(function (blob) { if (!blob) { reject(new Error("ICanvas.toBlob failed!")); return; } var reader = new FileReader(); reader.onload = function () { return resolve(reader.result); }; reader.onerror = reject; reader.readAsDataURL(blob); }, imageTypes[format], quality); })); case 1: if (!(canvas.toDataURL !== void 0)) { _context2.n = 2; break; } return _context2.a(2, canvas.toDataURL(imageTypes[format], quality)); case 2: if (!(canvas.convertToBlob !== void 0)) { _context2.n = 4; break; } _context2.n = 3; return canvas.convertToBlob({ type: imageTypes[format], quality: quality }); case 3: blob = _context2.v; return _context2.a(2, new Promise(function (resolve, reject) { var reader = new FileReader(); reader.onload = function () { return resolve(reader.result); }; reader.onerror = reject; reader.readAsDataURL(blob); })); case 4: throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented"); case 5: return _context2.a(2); } }, _callee2, this); })); function base64(_x2) { return _base.apply(this, arguments); } return base64; }() /** * Creates a Canvas element, renders this target to it and then returns it. * @param options - The options for creating the canvas, or the target to extract * @returns - A Canvas element with the texture rendered on. */ ) }, { key: "canvas", value: function canvas(options) { options = this._normalizeOptions(options); var target = options.target; var renderer = this._renderer; if (target instanceof Texture.Texture) { return renderer.texture.generateCanvas(target); } var texture = renderer.textureGenerator.generateTexture(options); var canvas = renderer.texture.generateCanvas(texture); texture.destroy(true); return canvas; } /** * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA * order, with integer values between 0 and 255 (included). * @param options - The options for extracting the image, or the target to extract * @returns - One-dimensional array containing the pixel data of the entire texture */ }, { key: "pixels", value: function pixels(options) { options = this._normalizeOptions(options); var target = options.target; var renderer = this._renderer; var texture = target instanceof Texture.Texture ? target : renderer.textureGenerator.generateTexture(options); var pixelInfo = renderer.texture.getPixels(texture); if (target instanceof Container.Container) { texture.destroy(true); } return pixelInfo; } /** * Will return a texture of the target * @param options - The options for creating the texture, or the target to extract * @returns - A texture of the target */ }, { key: "texture", value: function texture(options) { options = this._normalizeOptions(options); if (options.target instanceof Texture.Texture) return options.target; return this._renderer.textureGenerator.generateTexture(options); } /** * Will extract a HTMLImage of the target and download it * @param options - The options for downloading and extracting the image, or the target to extract */ }, { key: "download", value: function download(options) { var _options$filename; options = this._normalizeOptions(options); var canvas = this.canvas(options); var link = document.createElement("a"); link.download = (_options$filename = options.filename) !== null && _options$filename !== void 0 ? _options$filename : "image.png"; link.href = canvas.toDataURL("image/png"); document.body.appendChild(link); link.click(); document.body.removeChild(link); } /** * Logs the target to the console as an image. This is a useful way to debug what's happening in the renderer. * @param options - The options for logging the image, or the target to log */ }, { key: "log", value: function log(options) { var _options$width; var width = (_options$width = options.width) !== null && _options$width !== void 0 ? _options$width : 200; options = this._normalizeOptions(options); var canvas = this.canvas(options); var base64 = canvas.toDataURL(); console.log("[Pixi Texture] ".concat(canvas.width, "px ").concat(canvas.height, "px")); var style = ["font-size: 1px;", "padding: ".concat(width, "px ", 300, "px;"), "background: url(".concat(base64, ") no-repeat;"), "background-size: contain;"].join(" "); console.log("%c ", style); } }, { key: "destroy", value: function destroy() { this._renderer = null; } }]); }(); /** @ignore */ _ExtractSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem], name: "extract" }; /** Default options for creating an image. */ _ExtractSystem.defaultImageOptions = { /** The format of the image. */ format: "png", /** The quality of the image. */ quality: 1 }; var ExtractSystem = _ExtractSystem; exports.ExtractSystem = ExtractSystem; /***/ }), /***/ 41368: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var deprecation = __webpack_require__(11225); "use strict"; function collectAllRenderables(container, instructionSet, rendererOrPipes) { deprecation.deprecation("8.7.0", "Please use container.collectRenderables instead."); var renderer = rendererOrPipes.renderPipes ? rendererOrPipes : rendererOrPipes.batch.renderer; return container.collectRenderables(instructionSet, renderer, null); } exports.collectAllRenderables = collectAllRenderables; /***/ }), /***/ 41412: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var GpuParticleContainerAdaptor = __webpack_require__(98996); var ParticleContainerPipe = __webpack_require__(52874); "use strict"; var GpuParticleContainerPipe = /*#__PURE__*/function (_ParticleContainerPip) { function GpuParticleContainerPipe(renderer) { _classCallCheck(this, GpuParticleContainerPipe); return _callSuper(this, GpuParticleContainerPipe, [renderer, new GpuParticleContainerAdaptor.GpuParticleContainerAdaptor()]); } _inherits(GpuParticleContainerPipe, _ParticleContainerPip); return _createClass(GpuParticleContainerPipe); }(ParticleContainerPipe.ParticleContainerPipe); /** @ignore */ GpuParticleContainerPipe.extension = { type: [Extensions.ExtensionType.WebGPUPipes], name: "particle" }; exports.GpuParticleContainerPipe = GpuParticleContainerPipe; /***/ }), /***/ 41568: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } var IGLUniformData = /*#__PURE__*/_createClass(function IGLUniformData() { _classCallCheck(this, IGLUniformData); }); var GlProgramData = /*#__PURE__*/function () { /** * Makes a new Pixi program. * @param program - webgl program * @param uniformData - uniforms */ function GlProgramData(program, uniformData) { _classCallCheck(this, GlProgramData); this.program = program; this.uniformData = uniformData; this.uniformGroups = {}; this.uniformDirtyGroups = {}; this.uniformBlockBindings = {}; } /** Destroys this program. */ return _createClass(GlProgramData, [{ key: "destroy", value: function destroy() { this.uniformData = null; this.uniformGroups = null; this.uniformDirtyGroups = null; this.uniformBlockBindings = null; this.program = null; } }]); }(); exports.GlProgramData = GlProgramData; exports.IGLUniformData = IGLUniformData; /***/ }), /***/ 41581: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var UboBatch = /*#__PURE__*/function () { function UboBatch(_ref) { var minUniformOffsetAlignment = _ref.minUniformOffsetAlignment; _classCallCheck(this, UboBatch); this._minUniformOffsetAlignment = 256; this.byteIndex = 0; this._minUniformOffsetAlignment = minUniformOffsetAlignment; this.data = new Float32Array(65535); } return _createClass(UboBatch, [{ key: "clear", value: function clear() { this.byteIndex = 0; } }, { key: "addEmptyGroup", value: function addEmptyGroup(size) { if (size > this._minUniformOffsetAlignment / 4) { throw new Error("UniformBufferBatch: array is too large: ".concat(size * 4)); } var start = this.byteIndex; var newSize = start + size * 4; newSize = Math.ceil(newSize / this._minUniformOffsetAlignment) * this._minUniformOffsetAlignment; if (newSize > this.data.length * 4) { throw new Error("UniformBufferBatch: ubo batch got too big"); } this.byteIndex = newSize; return start; } }, { key: "addGroup", value: function addGroup(array) { var offset = this.addEmptyGroup(array.length); for (var i = 0; i < array.length; i++) { this.data[offset / 4 + i] = array[i]; } return offset; } }, { key: "destroy", value: function destroy() { this.data = null; } }]); }(); exports.UboBatch = UboBatch; /***/ }), /***/ 41701: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var TexturePool = __webpack_require__(53248); var Bounds = __webpack_require__(76631); "use strict"; var tempBounds = new Bounds.Bounds(); function getPo2TextureFromSource(image, width, height, resolution) { var bounds = tempBounds; bounds.minX = 0; bounds.minY = 0; bounds.maxX = image.width / resolution | 0; bounds.maxY = image.height / resolution | 0; var texture = TexturePool.TexturePool.getOptimalTexture(bounds.width, bounds.height, resolution, false); texture.source.uploadMethodId = "image"; texture.source.resource = image; texture.source.alphaMode = "premultiply-alpha-on-upload"; texture.frame.width = width / resolution; texture.frame.height = height / resolution; texture.source.emit("update", texture.source); texture.updateUvs(); return texture; } exports.getPo2TextureFromSource = getPo2TextureFromSource; /***/ }), /***/ 41794: /***/ ((module) => { "use strict"; module.exports = parse; /** * expected argument lengths * @type {Object} */ var length = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }; /** * segment pattern * @type {RegExp} */ var segment = /([astvzqmhlc])([^astvzqmhlc]*)/ig; /** * parse an svg path data string. Generates an Array * of commands where each command is an Array of the * form `[command, arg1, arg2, ...]` * * @param {String} path * @return {Array} */ function parse(path) { var data = []; path.replace(segment, function (_, command, args) { var type = command.toLowerCase(); args = parseValues(args); // overloaded moveTo if (type == 'm' && args.length > 2) { data.push([command].concat(args.splice(0, 2))); type = 'l'; command = command == 'm' ? 'l' : 'L'; } while (true) { if (args.length == length[type]) { args.unshift(command); return data.push(args); } if (args.length < length[type]) throw new Error('malformed path data'); data.push([command].concat(args.splice(0, length[type]))); } }); return data; } var number = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig; function parseValues(args) { var numbers = args.match(number); return numbers ? numbers.map(Number) : []; } /***/ }), /***/ 41914: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function getBitmapTextLayout(chars, style, font, trimEnd) { var layoutData = { width: 0, height: 0, offsetY: 0, scale: style.fontSize / font.baseMeasurementFontSize, lines: [{ width: 0, charPositions: [], spaceWidth: 0, spacesIndex: [], chars: [] }] }; layoutData.offsetY = font.baseLineOffset; var currentLine = layoutData.lines[0]; var previousChar = null; var firstWord = true; var currentWord = { spaceWord: false, width: 0, start: 0, index: 0, // use index to not modify the array as we use it a lot! positions: [], chars: [] }; var nextWord = function nextWord(word) { var start = currentLine.width; for (var j = 0; j < currentWord.index; j++) { var position = word.positions[j]; currentLine.chars.push(word.chars[j]); currentLine.charPositions.push(position + start); } currentLine.width += word.width; firstWord = false; currentWord.width = 0; currentWord.index = 0; currentWord.chars.length = 0; }; var nextLine = function nextLine() { var index = currentLine.chars.length - 1; if (trimEnd) { var lastChar = currentLine.chars[index]; while (lastChar === " ") { currentLine.width -= font.chars[lastChar].xAdvance; lastChar = currentLine.chars[--index]; } } layoutData.width = Math.max(layoutData.width, currentLine.width); currentLine = { width: 0, charPositions: [], chars: [], spaceWidth: 0, spacesIndex: [] }; firstWord = true; layoutData.lines.push(currentLine); layoutData.height += font.lineHeight; }; var scale = font.baseMeasurementFontSize / style.fontSize; var adjustedLetterSpacing = style.letterSpacing * scale; var adjustedWordWrapWidth = style.wordWrapWidth * scale; for (var i = 0; i < chars.length + 1; i++) { var _char = void 0; var isEnd = i === chars.length; if (!isEnd) { _char = chars[i]; } var charData = font.chars[_char] || font.chars[" "]; var isSpace = /(?:\s)/.test(_char); var isWordBreak = isSpace || _char === "\r" || _char === "\n" || isEnd; if (isWordBreak) { var addWordToNextLine = !firstWord && style.wordWrap && currentLine.width + currentWord.width - adjustedLetterSpacing > adjustedWordWrapWidth; if (addWordToNextLine) { nextLine(); nextWord(currentWord); if (!isEnd) { currentLine.charPositions.push(0); } } else { currentWord.start = currentLine.width; nextWord(currentWord); if (!isEnd) { currentLine.charPositions.push(0); } } if (_char === "\r" || _char === "\n") { if (currentLine.width !== 0) { nextLine(); } } else if (!isEnd) { var spaceWidth = charData.xAdvance + (charData.kerning[previousChar] || 0) + adjustedLetterSpacing; currentLine.width += spaceWidth; currentLine.spaceWidth = spaceWidth; currentLine.spacesIndex.push(currentLine.charPositions.length); currentLine.chars.push(_char); } } else { var kerning = charData.kerning[previousChar] || 0; var nextCharWidth = charData.xAdvance + kerning + adjustedLetterSpacing; currentWord.positions[currentWord.index++] = currentWord.width + kerning; currentWord.chars.push(_char); currentWord.width += nextCharWidth; } previousChar = _char; } nextLine(); if (style.align === "center") { alignCenter(layoutData); } else if (style.align === "right") { alignRight(layoutData); } else if (style.align === "justify") { alignJustify(layoutData); } return layoutData; } function alignCenter(measurementData) { for (var i = 0; i < measurementData.lines.length; i++) { var line = measurementData.lines[i]; var offset = measurementData.width / 2 - line.width / 2; for (var j = 0; j < line.charPositions.length; j++) { line.charPositions[j] += offset; } } } function alignRight(measurementData) { for (var i = 0; i < measurementData.lines.length; i++) { var line = measurementData.lines[i]; var offset = measurementData.width - line.width; for (var j = 0; j < line.charPositions.length; j++) { line.charPositions[j] += offset; } } } function alignJustify(measurementData) { var width = measurementData.width; for (var i = 0; i < measurementData.lines.length; i++) { var line = measurementData.lines[i]; var indy = 0; var spaceIndex = line.spacesIndex[indy++]; var offset = 0; var totalSpaces = line.spacesIndex.length; var newSpaceWidth = (width - line.width) / totalSpaces; var spaceWidth = newSpaceWidth; for (var j = 0; j < line.charPositions.length; j++) { if (j === spaceIndex) { spaceIndex = line.spacesIndex[indy++]; offset += spaceWidth; } line.charPositions[j] += offset; } } } exports.getBitmapTextLayout = getBitmapTextLayout; /***/ }), /***/ 41960: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function createLevelBuffersFromKTX(ktxTexture) { var levelBuffers = []; for (var i = 0; i < ktxTexture.numLevels; i++) { var imageData = ktxTexture.getImageData(i, 0, 0); var levelBuffer = new Uint8Array(imageData.byteLength); levelBuffer.set(imageData); levelBuffers.push(levelBuffer); } return levelBuffers; } exports.createLevelBuffersFromKTX = createLevelBuffersFromKTX; /***/ }), /***/ 42264: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); var testImageFormat = __webpack_require__(13714); "use strict"; var detectWebp = { extension: { type: Extensions.ExtensionType.DetectionParser, priority: 0 }, test: function () { var _test = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: return _context.a(2, testImageFormat.testImageFormat("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=")); } }, _callee); })); function test() { return _test.apply(this, arguments); } return test; }(), add: function () { var _add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(formats) { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: return _context2.a(2, [].concat(_toConsumableArray(formats), ["webp"])); } }, _callee2); })); function add(_x) { return _add.apply(this, arguments); } return add; }(), remove: function () { var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(formats) { return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: return _context3.a(2, formats.filter(function (f) { return f !== "webp"; })); } }, _callee3); })); function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() }; exports.detectWebp = detectWebp; /***/ }), /***/ 42268: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Cache = __webpack_require__(65278); var Extensions = __webpack_require__(86890); var TextureSource = __webpack_require__(55406); var Texture = __webpack_require__(73782); "use strict"; var sources = []; Extensions.extensions.handleByList(Extensions.ExtensionType.TextureSource, sources); function autoDetectSource() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return textureSourceFrom(options); } function textureSourceFrom() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var hasResource = options && options.resource; var res = hasResource ? options.resource : options; var opts = hasResource ? options : { resource: options }; for (var i = 0; i < sources.length; i++) { var Source = sources[i]; if (Source.test(res)) { return new Source(opts); } } throw new Error("Could not find a source type for resource: ".concat(opts.resource)); } function resourceToTexture() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var skipCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var hasResource = options && options.resource; var resource = hasResource ? options.resource : options; var opts = hasResource ? options : { resource: options }; if (!skipCache && Cache.Cache.has(resource)) { return Cache.Cache.get(resource); } var texture = new Texture.Texture({ source: textureSourceFrom(opts) }); texture.on("destroy", function () { if (Cache.Cache.has(resource)) { Cache.Cache.remove(resource); } }); if (!skipCache) { Cache.Cache.set(resource, texture); } return texture; } function textureFrom(id) { var skipCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (typeof id === "string") { return Cache.Cache.get(id); } else if (id instanceof TextureSource.TextureSource) { return new Texture.Texture({ source: id }); } return resourceToTexture(id, skipCache); } Texture.Texture.from = textureFrom; TextureSource.TextureSource.from = textureSourceFrom; exports.autoDetectSource = autoDetectSource; exports.resourceToTexture = resourceToTexture; exports.textureFrom = textureFrom; /***/ }), /***/ 42517: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BatchableSprite = /*#__PURE__*/function () { function BatchableSprite() { _classCallCheck(this, BatchableSprite); this.batcherName = "default"; this.topology = "triangle-list"; // batch specific.. this.attributeSize = 4; this.indexSize = 6; this.packAsQuad = true; this.roundPixels = 0; this._attributeStart = 0; // location in the buffer this._batcher = null; this._batch = null; } return _createClass(BatchableSprite, [{ key: "blendMode", get: function get() { return this.renderable.groupBlendMode; } }, { key: "color", get: function get() { return this.renderable.groupColorAlpha; } }, { key: "reset", value: function reset() { this.renderable = null; this.texture = null; this._batcher = null; this._batch = null; this.bounds = null; } }]); }(); exports.BatchableSprite = BatchableSprite; /***/ }), /***/ 42682: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var ColorMaskPipe = /*#__PURE__*/function () { function ColorMaskPipe(renderer) { _classCallCheck(this, ColorMaskPipe); this._colorStack = []; this._colorStackIndex = 0; this._currentColor = 0; this._renderer = renderer; } return _createClass(ColorMaskPipe, [{ key: "buildStart", value: function buildStart() { this._colorStack[0] = 15; this._colorStackIndex = 1; this._currentColor = 15; } }, { key: "push", value: function push(mask, _container, instructionSet) { var renderer = this._renderer; renderer.renderPipes.batch["break"](instructionSet); var colorStack = this._colorStack; colorStack[this._colorStackIndex] = colorStack[this._colorStackIndex - 1] & mask.mask; var currentColor = this._colorStack[this._colorStackIndex]; if (currentColor !== this._currentColor) { this._currentColor = currentColor; instructionSet.add({ renderPipeId: "colorMask", colorMask: currentColor, canBundle: false }); } this._colorStackIndex++; } }, { key: "pop", value: function pop(_mask, _container, instructionSet) { var renderer = this._renderer; renderer.renderPipes.batch["break"](instructionSet); var colorStack = this._colorStack; this._colorStackIndex--; var currentColor = colorStack[this._colorStackIndex - 1]; if (currentColor !== this._currentColor) { this._currentColor = currentColor; instructionSet.add({ renderPipeId: "colorMask", colorMask: currentColor, canBundle: false }); } } }, { key: "execute", value: function execute(instruction) { var renderer = this._renderer; renderer.colorMask.setMask(instruction.colorMask); } }, { key: "destroy", value: function destroy() { this._colorStack = null; } }]); }(); /** @ignore */ ColorMaskPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "colorMask" }; exports.ColorMaskPipe = ColorMaskPipe; /***/ }), /***/ 42961: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Point = __webpack_require__(75544); "use strict"; var FederatedEvent = /*#__PURE__*/function () { /** * @param manager - The event boundary which manages this event. Propagation can only occur * within the boundary's jurisdiction. */ function FederatedEvent(manager) { _classCallCheck(this, FederatedEvent); /** Flags whether this event bubbles. This will take effect only if it is set before propagation. */ this.bubbles = true; /** @deprecated since 7.0.0 */ this.cancelBubble = true; /** * Flags whether this event can be canceled using {@link FederatedEvent.preventDefault}. This is always * false (for now). */ this.cancelable = false; /** * Flag added for compatibility with DOM {@code Event}. It is not used in the Federated Events * API. * @see https://dom.spec.whatwg.org/#dom-event-composed */ this.composed = false; /** Flags whether the default response of the user agent was prevent through this event. */ this.defaultPrevented = false; /** * The propagation phase. * @default {@link FederatedEvent.NONE} */ this.eventPhase = FederatedEvent.prototype.NONE; /** Flags whether propagation was stopped. */ this.propagationStopped = false; /** Flags whether propagation was immediately stopped. */ this.propagationImmediatelyStopped = false; /** The coordinates of the event relative to the nearest DOM layer. This is a non-standard property. */ this.layer = new Point.Point(); /** The coordinates of the event relative to the DOM document. This is a non-standard property. */ this.page = new Point.Point(); this.NONE = 0; this.CAPTURING_PHASE = 1; this.AT_TARGET = 2; this.BUBBLING_PHASE = 3; this.manager = manager; } /** @readonly */ return _createClass(FederatedEvent, [{ key: "layerX", get: function get() { return this.layer.x; } /** @readonly */ }, { key: "layerY", get: function get() { return this.layer.y; } /** @readonly */ }, { key: "pageX", get: function get() { return this.page.x; } /** @readonly */ }, { key: "pageY", get: function get() { return this.page.y; } /** * Fallback for the deprecated @code{InteractionEvent.data}. * @deprecated since 7.0.0 */ }, { key: "data", get: function get() { return this; } /** The propagation path for this event. Alias for {@link EventBoundary.propagationPath}. */ }, { key: "composedPath", value: function composedPath() { if (this.manager && (!this.path || this.path[this.path.length - 1] !== this.target)) { this.path = this.target ? this.manager.propagationPath(this.target) : []; } return this.path; } /** * Unimplemented method included for implementing the DOM interface {@code Event}. It will throw an {@code Error}. * @deprecated * @param _type * @param _bubbles * @param _cancelable */ }, { key: "initEvent", value: function initEvent(_type, _bubbles, _cancelable) { throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API."); } /** * Unimplemented method included for implementing the DOM interface {@code UIEvent}. It will throw an {@code Error}. * @deprecated * @param _typeArg * @param _bubblesArg * @param _cancelableArg * @param _viewArg * @param _detailArg */ }, { key: "initUIEvent", value: function initUIEvent(_typeArg, _bubblesArg, _cancelableArg, _viewArg, _detailArg) { throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API."); } /** Prevent default behavior of PixiJS and the user agent. */ }, { key: "preventDefault", value: function preventDefault() { if (this.nativeEvent instanceof Event && this.nativeEvent.cancelable) { this.nativeEvent.preventDefault(); } this.defaultPrevented = true; } /** * Stop this event from propagating to any addition listeners, including on the * {@link FederatedEventTarget.currentTarget currentTarget} and also the following * event targets on the propagation path. */ }, { key: "stopImmediatePropagation", value: function stopImmediatePropagation() { this.propagationImmediatelyStopped = true; } /** * Stop this event from propagating to the next {@link FederatedEventTarget}. The rest of the listeners * on the {@link FederatedEventTarget.currentTarget currentTarget} will still be notified. */ }, { key: "stopPropagation", value: function stopPropagation() { this.propagationStopped = true; } }]); }(); exports.FederatedEvent = FederatedEvent; /***/ }), /***/ 43021: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var _FOURCC_TO_TEXTURE_FO, _DXGI_TO_TEXTURE_FORM; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var DDS_HEADER_FIELDS = { MAGIC: 0, SIZE: 1, FLAGS: 2, HEIGHT: 3, WIDTH: 4, MIPMAP_COUNT: 7, PIXEL_FORMAT: 19, PF_FLAGS: 20, FOURCC: 21, RGB_BITCOUNT: 22, R_BIT_MASK: 23, G_BIT_MASK: 24, B_BIT_MASK: 25, A_BIT_MASK: 26 }; var DDS_DX10_FIELDS = { DXGI_FORMAT: 0, RESOURCE_DIMENSION: 1, MISC_FLAG: 2, ARRAY_SIZE: 3, MISC_FLAGS2: 4 }; var DXGI_FORMAT = /* @__PURE__ */function (DXGI_FORMAT2) { DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_UNKNOWN"] = 0] = "DXGI_FORMAT_UNKNOWN"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32B32A32_TYPELESS"] = 1] = "DXGI_FORMAT_R32G32B32A32_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32B32A32_FLOAT"] = 2] = "DXGI_FORMAT_R32G32B32A32_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32B32A32_UINT"] = 3] = "DXGI_FORMAT_R32G32B32A32_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32B32A32_SINT"] = 4] = "DXGI_FORMAT_R32G32B32A32_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32B32_TYPELESS"] = 5] = "DXGI_FORMAT_R32G32B32_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32B32_FLOAT"] = 6] = "DXGI_FORMAT_R32G32B32_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32B32_UINT"] = 7] = "DXGI_FORMAT_R32G32B32_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32B32_SINT"] = 8] = "DXGI_FORMAT_R32G32B32_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16B16A16_TYPELESS"] = 9] = "DXGI_FORMAT_R16G16B16A16_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16B16A16_FLOAT"] = 10] = "DXGI_FORMAT_R16G16B16A16_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16B16A16_UNORM"] = 11] = "DXGI_FORMAT_R16G16B16A16_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16B16A16_UINT"] = 12] = "DXGI_FORMAT_R16G16B16A16_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16B16A16_SNORM"] = 13] = "DXGI_FORMAT_R16G16B16A16_SNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16B16A16_SINT"] = 14] = "DXGI_FORMAT_R16G16B16A16_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32_TYPELESS"] = 15] = "DXGI_FORMAT_R32G32_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32_FLOAT"] = 16] = "DXGI_FORMAT_R32G32_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32_UINT"] = 17] = "DXGI_FORMAT_R32G32_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G32_SINT"] = 18] = "DXGI_FORMAT_R32G32_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32G8X24_TYPELESS"] = 19] = "DXGI_FORMAT_R32G8X24_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_D32_FLOAT_S8X24_UINT"] = 20] = "DXGI_FORMAT_D32_FLOAT_S8X24_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS"] = 21] = "DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_X32_TYPELESS_G8X24_UINT"] = 22] = "DXGI_FORMAT_X32_TYPELESS_G8X24_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R10G10B10A2_TYPELESS"] = 23] = "DXGI_FORMAT_R10G10B10A2_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R10G10B10A2_UNORM"] = 24] = "DXGI_FORMAT_R10G10B10A2_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R10G10B10A2_UINT"] = 25] = "DXGI_FORMAT_R10G10B10A2_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R11G11B10_FLOAT"] = 26] = "DXGI_FORMAT_R11G11B10_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8B8A8_TYPELESS"] = 27] = "DXGI_FORMAT_R8G8B8A8_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8B8A8_UNORM"] = 28] = "DXGI_FORMAT_R8G8B8A8_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8B8A8_UNORM_SRGB"] = 29] = "DXGI_FORMAT_R8G8B8A8_UNORM_SRGB"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8B8A8_UINT"] = 30] = "DXGI_FORMAT_R8G8B8A8_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8B8A8_SNORM"] = 31] = "DXGI_FORMAT_R8G8B8A8_SNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8B8A8_SINT"] = 32] = "DXGI_FORMAT_R8G8B8A8_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16_TYPELESS"] = 33] = "DXGI_FORMAT_R16G16_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16_FLOAT"] = 34] = "DXGI_FORMAT_R16G16_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16_UNORM"] = 35] = "DXGI_FORMAT_R16G16_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16_UINT"] = 36] = "DXGI_FORMAT_R16G16_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16_SNORM"] = 37] = "DXGI_FORMAT_R16G16_SNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16G16_SINT"] = 38] = "DXGI_FORMAT_R16G16_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32_TYPELESS"] = 39] = "DXGI_FORMAT_R32_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_D32_FLOAT"] = 40] = "DXGI_FORMAT_D32_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32_FLOAT"] = 41] = "DXGI_FORMAT_R32_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32_UINT"] = 42] = "DXGI_FORMAT_R32_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R32_SINT"] = 43] = "DXGI_FORMAT_R32_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R24G8_TYPELESS"] = 44] = "DXGI_FORMAT_R24G8_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_D24_UNORM_S8_UINT"] = 45] = "DXGI_FORMAT_D24_UNORM_S8_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R24_UNORM_X8_TYPELESS"] = 46] = "DXGI_FORMAT_R24_UNORM_X8_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_X24_TYPELESS_G8_UINT"] = 47] = "DXGI_FORMAT_X24_TYPELESS_G8_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8_TYPELESS"] = 48] = "DXGI_FORMAT_R8G8_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8_UNORM"] = 49] = "DXGI_FORMAT_R8G8_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8_UINT"] = 50] = "DXGI_FORMAT_R8G8_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8_SNORM"] = 51] = "DXGI_FORMAT_R8G8_SNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8_SINT"] = 52] = "DXGI_FORMAT_R8G8_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16_TYPELESS"] = 53] = "DXGI_FORMAT_R16_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16_FLOAT"] = 54] = "DXGI_FORMAT_R16_FLOAT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_D16_UNORM"] = 55] = "DXGI_FORMAT_D16_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16_UNORM"] = 56] = "DXGI_FORMAT_R16_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16_UINT"] = 57] = "DXGI_FORMAT_R16_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16_SNORM"] = 58] = "DXGI_FORMAT_R16_SNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R16_SINT"] = 59] = "DXGI_FORMAT_R16_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8_TYPELESS"] = 60] = "DXGI_FORMAT_R8_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8_UNORM"] = 61] = "DXGI_FORMAT_R8_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8_UINT"] = 62] = "DXGI_FORMAT_R8_UINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8_SNORM"] = 63] = "DXGI_FORMAT_R8_SNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8_SINT"] = 64] = "DXGI_FORMAT_R8_SINT"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_A8_UNORM"] = 65] = "DXGI_FORMAT_A8_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R1_UNORM"] = 66] = "DXGI_FORMAT_R1_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R9G9B9E5_SHAREDEXP"] = 67] = "DXGI_FORMAT_R9G9B9E5_SHAREDEXP"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R8G8_B8G8_UNORM"] = 68] = "DXGI_FORMAT_R8G8_B8G8_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_G8R8_G8B8_UNORM"] = 69] = "DXGI_FORMAT_G8R8_G8B8_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC1_TYPELESS"] = 70] = "DXGI_FORMAT_BC1_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC1_UNORM"] = 71] = "DXGI_FORMAT_BC1_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC1_UNORM_SRGB"] = 72] = "DXGI_FORMAT_BC1_UNORM_SRGB"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC2_TYPELESS"] = 73] = "DXGI_FORMAT_BC2_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC2_UNORM"] = 74] = "DXGI_FORMAT_BC2_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC2_UNORM_SRGB"] = 75] = "DXGI_FORMAT_BC2_UNORM_SRGB"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC3_TYPELESS"] = 76] = "DXGI_FORMAT_BC3_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC3_UNORM"] = 77] = "DXGI_FORMAT_BC3_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC3_UNORM_SRGB"] = 78] = "DXGI_FORMAT_BC3_UNORM_SRGB"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC4_TYPELESS"] = 79] = "DXGI_FORMAT_BC4_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC4_UNORM"] = 80] = "DXGI_FORMAT_BC4_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC4_SNORM"] = 81] = "DXGI_FORMAT_BC4_SNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC5_TYPELESS"] = 82] = "DXGI_FORMAT_BC5_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC5_UNORM"] = 83] = "DXGI_FORMAT_BC5_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC5_SNORM"] = 84] = "DXGI_FORMAT_BC5_SNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B5G6R5_UNORM"] = 85] = "DXGI_FORMAT_B5G6R5_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B5G5R5A1_UNORM"] = 86] = "DXGI_FORMAT_B5G5R5A1_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B8G8R8A8_UNORM"] = 87] = "DXGI_FORMAT_B8G8R8A8_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B8G8R8X8_UNORM"] = 88] = "DXGI_FORMAT_B8G8R8X8_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM"] = 89] = "DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B8G8R8A8_TYPELESS"] = 90] = "DXGI_FORMAT_B8G8R8A8_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B8G8R8A8_UNORM_SRGB"] = 91] = "DXGI_FORMAT_B8G8R8A8_UNORM_SRGB"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B8G8R8X8_TYPELESS"] = 92] = "DXGI_FORMAT_B8G8R8X8_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B8G8R8X8_UNORM_SRGB"] = 93] = "DXGI_FORMAT_B8G8R8X8_UNORM_SRGB"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC6H_TYPELESS"] = 94] = "DXGI_FORMAT_BC6H_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC6H_UF16"] = 95] = "DXGI_FORMAT_BC6H_UF16"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC6H_SF16"] = 96] = "DXGI_FORMAT_BC6H_SF16"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC7_TYPELESS"] = 97] = "DXGI_FORMAT_BC7_TYPELESS"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC7_UNORM"] = 98] = "DXGI_FORMAT_BC7_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_BC7_UNORM_SRGB"] = 99] = "DXGI_FORMAT_BC7_UNORM_SRGB"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_AYUV"] = 100] = "DXGI_FORMAT_AYUV"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_Y410"] = 101] = "DXGI_FORMAT_Y410"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_Y416"] = 102] = "DXGI_FORMAT_Y416"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_NV12"] = 103] = "DXGI_FORMAT_NV12"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_P010"] = 104] = "DXGI_FORMAT_P010"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_P016"] = 105] = "DXGI_FORMAT_P016"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_420_OPAQUE"] = 106] = "DXGI_FORMAT_420_OPAQUE"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_YUY2"] = 107] = "DXGI_FORMAT_YUY2"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_Y210"] = 108] = "DXGI_FORMAT_Y210"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_Y216"] = 109] = "DXGI_FORMAT_Y216"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_NV11"] = 110] = "DXGI_FORMAT_NV11"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_AI44"] = 111] = "DXGI_FORMAT_AI44"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_IA44"] = 112] = "DXGI_FORMAT_IA44"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_P8"] = 113] = "DXGI_FORMAT_P8"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_A8P8"] = 114] = "DXGI_FORMAT_A8P8"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_B4G4R4A4_UNORM"] = 115] = "DXGI_FORMAT_B4G4R4A4_UNORM"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_P208"] = 116] = "DXGI_FORMAT_P208"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_V208"] = 117] = "DXGI_FORMAT_V208"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_V408"] = 118] = "DXGI_FORMAT_V408"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE"] = 119] = "DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE"] = 120] = "DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE"; DXGI_FORMAT2[DXGI_FORMAT2["DXGI_FORMAT_FORCE_UINT"] = 121] = "DXGI_FORMAT_FORCE_UINT"; return DXGI_FORMAT2; }(DXGI_FORMAT || {}); var D3D10_RESOURCE_DIMENSION = /* @__PURE__ */function (D3D10_RESOURCE_DIMENSION2) { D3D10_RESOURCE_DIMENSION2[D3D10_RESOURCE_DIMENSION2["DDS_DIMENSION_TEXTURE1D"] = 2] = "DDS_DIMENSION_TEXTURE1D"; D3D10_RESOURCE_DIMENSION2[D3D10_RESOURCE_DIMENSION2["DDS_DIMENSION_TEXTURE2D"] = 3] = "DDS_DIMENSION_TEXTURE2D"; D3D10_RESOURCE_DIMENSION2[D3D10_RESOURCE_DIMENSION2["DDS_DIMENSION_TEXTURE3D"] = 6] = "DDS_DIMENSION_TEXTURE3D"; return D3D10_RESOURCE_DIMENSION2; }(D3D10_RESOURCE_DIMENSION || {}); function fourCCToInt32(value) { return value.charCodeAt(0) + (value.charCodeAt(1) << 8) + (value.charCodeAt(2) << 16) + (value.charCodeAt(3) << 24); } var D3DFMT = function (D3DFMT2) { D3DFMT2[D3DFMT2["UNKNOWN"] = 0] = "UNKNOWN"; D3DFMT2[D3DFMT2["R8G8B8"] = 20] = "R8G8B8"; D3DFMT2[D3DFMT2["A8R8G8B8"] = 21] = "A8R8G8B8"; D3DFMT2[D3DFMT2["X8R8G8B8"] = 22] = "X8R8G8B8"; D3DFMT2[D3DFMT2["R5G6B5"] = 23] = "R5G6B5"; D3DFMT2[D3DFMT2["X1R5G5B5"] = 24] = "X1R5G5B5"; D3DFMT2[D3DFMT2["A1R5G5B5"] = 25] = "A1R5G5B5"; D3DFMT2[D3DFMT2["A4R4G4B4"] = 26] = "A4R4G4B4"; D3DFMT2[D3DFMT2["R3G3B2"] = 27] = "R3G3B2"; D3DFMT2[D3DFMT2["A8"] = 28] = "A8"; D3DFMT2[D3DFMT2["A8R3G3B2"] = 29] = "A8R3G3B2"; D3DFMT2[D3DFMT2["X4R4G4B4"] = 30] = "X4R4G4B4"; D3DFMT2[D3DFMT2["A2B10G10R10"] = 31] = "A2B10G10R10"; D3DFMT2[D3DFMT2["A8B8G8R8"] = 32] = "A8B8G8R8"; D3DFMT2[D3DFMT2["X8B8G8R8"] = 33] = "X8B8G8R8"; D3DFMT2[D3DFMT2["G16R16"] = 34] = "G16R16"; D3DFMT2[D3DFMT2["A2R10G10B10"] = 35] = "A2R10G10B10"; D3DFMT2[D3DFMT2["A16B16G16R16"] = 36] = "A16B16G16R16"; D3DFMT2[D3DFMT2["A8P8"] = 40] = "A8P8"; D3DFMT2[D3DFMT2["P8"] = 41] = "P8"; D3DFMT2[D3DFMT2["L8"] = 50] = "L8"; D3DFMT2[D3DFMT2["A8L8"] = 51] = "A8L8"; D3DFMT2[D3DFMT2["A4L4"] = 52] = "A4L4"; D3DFMT2[D3DFMT2["V8U8"] = 60] = "V8U8"; D3DFMT2[D3DFMT2["L6V5U5"] = 61] = "L6V5U5"; D3DFMT2[D3DFMT2["X8L8V8U8"] = 62] = "X8L8V8U8"; D3DFMT2[D3DFMT2["Q8W8V8U8"] = 63] = "Q8W8V8U8"; D3DFMT2[D3DFMT2["V16U16"] = 64] = "V16U16"; D3DFMT2[D3DFMT2["A2W10V10U10"] = 67] = "A2W10V10U10"; D3DFMT2[D3DFMT2["Q16W16V16U16"] = 110] = "Q16W16V16U16"; D3DFMT2[D3DFMT2["R16F"] = 111] = "R16F"; D3DFMT2[D3DFMT2["G16R16F"] = 112] = "G16R16F"; D3DFMT2[D3DFMT2["A16B16G16R16F"] = 113] = "A16B16G16R16F"; D3DFMT2[D3DFMT2["R32F"] = 114] = "R32F"; D3DFMT2[D3DFMT2["G32R32F"] = 115] = "G32R32F"; D3DFMT2[D3DFMT2["A32B32G32R32F"] = 116] = "A32B32G32R32F"; D3DFMT2[D3DFMT2["UYVY"] = fourCCToInt32("UYVY")] = "UYVY"; D3DFMT2[D3DFMT2["R8G8_B8G8"] = fourCCToInt32("RGBG")] = "R8G8_B8G8"; D3DFMT2[D3DFMT2["YUY2"] = fourCCToInt32("YUY2")] = "YUY2"; D3DFMT2[D3DFMT2["D3DFMT_G8R8_G8B8"] = fourCCToInt32("GRGB")] = "D3DFMT_G8R8_G8B8"; D3DFMT2[D3DFMT2["DXT1"] = fourCCToInt32("DXT1")] = "DXT1"; D3DFMT2[D3DFMT2["DXT2"] = fourCCToInt32("DXT2")] = "DXT2"; D3DFMT2[D3DFMT2["DXT3"] = fourCCToInt32("DXT3")] = "DXT3"; D3DFMT2[D3DFMT2["DXT4"] = fourCCToInt32("DXT4")] = "DXT4"; D3DFMT2[D3DFMT2["DXT5"] = fourCCToInt32("DXT5")] = "DXT5"; D3DFMT2[D3DFMT2["ATI1"] = fourCCToInt32("ATI1")] = "ATI1"; D3DFMT2[D3DFMT2["AT1N"] = fourCCToInt32("AT1N")] = "AT1N"; D3DFMT2[D3DFMT2["ATI2"] = fourCCToInt32("ATI2")] = "ATI2"; D3DFMT2[D3DFMT2["AT2N"] = fourCCToInt32("AT2N")] = "AT2N"; D3DFMT2[D3DFMT2["BC4U"] = fourCCToInt32("BC4U")] = "BC4U"; D3DFMT2[D3DFMT2["BC4S"] = fourCCToInt32("BC4S")] = "BC4S"; D3DFMT2[D3DFMT2["BC5U"] = fourCCToInt32("BC5U")] = "BC5U"; D3DFMT2[D3DFMT2["BC5S"] = fourCCToInt32("BC5S")] = "BC5S"; D3DFMT2[D3DFMT2["DX10"] = fourCCToInt32("DX10")] = "DX10"; return D3DFMT2; }(D3DFMT || {}); var FOURCC_TO_TEXTURE_FORMAT = (_FOURCC_TO_TEXTURE_FO = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_FOURCC_TO_TEXTURE_FO, D3DFMT.DXT1, "bc1-rgba-unorm"), D3DFMT.DXT2, "bc2-rgba-unorm"), D3DFMT.DXT3, "bc2-rgba-unorm"), D3DFMT.DXT4, "bc3-rgba-unorm"), D3DFMT.DXT5, "bc3-rgba-unorm"), D3DFMT.ATI1, "bc4-r-unorm"), D3DFMT.BC4U, "bc4-r-unorm"), D3DFMT.BC4S, "bc4-r-snorm"), D3DFMT.ATI2, "bc5-rg-unorm"), D3DFMT.BC5U, "bc5-rg-unorm"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_FOURCC_TO_TEXTURE_FO, D3DFMT.BC5S, "bc5-rg-snorm"), 36 /* A16B16G16R16 */, "rgba16uint"), 110 /* Q16W16V16U16 */, "rgba16sint"), 111 /* R16F */, "r16float"), 112 /* G16R16F */, "rg16float"), 113 /* A16B16G16R16F */, "rgba16float"), 114 /* R32F */, "r32float"), 115 /* G32R32F */, "rg32float"), 116 /* A32B32G32R32F */, "rgba32float")); var DXGI_TO_TEXTURE_FORMAT = (_DXGI_TO_TEXTURE_FORM = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_DXGI_TO_TEXTURE_FORM, 70 /* DXGI_FORMAT_BC1_TYPELESS */, "bc1-rgba-unorm"), 71 /* DXGI_FORMAT_BC1_UNORM */, "bc1-rgba-unorm"), 72 /* DXGI_FORMAT_BC1_UNORM_SRGB */, "bc1-rgba-unorm-srgb"), 73 /* DXGI_FORMAT_BC2_TYPELESS */, "bc2-rgba-unorm"), 74 /* DXGI_FORMAT_BC2_UNORM */, "bc2-rgba-unorm"), 75 /* DXGI_FORMAT_BC2_UNORM_SRGB */, "bc2-rgba-unorm-srgb"), 76 /* DXGI_FORMAT_BC3_TYPELESS */, "bc3-rgba-unorm"), 77 /* DXGI_FORMAT_BC3_UNORM */, "bc3-rgba-unorm"), 78 /* DXGI_FORMAT_BC3_UNORM_SRGB */, "bc3-rgba-unorm-srgb"), 79 /* DXGI_FORMAT_BC4_TYPELESS */, "bc4-r-unorm"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_DXGI_TO_TEXTURE_FORM, 80 /* DXGI_FORMAT_BC4_UNORM */, "bc4-r-unorm"), 81 /* DXGI_FORMAT_BC4_SNORM */, "bc4-r-snorm"), 82 /* DXGI_FORMAT_BC5_TYPELESS */, "bc5-rg-unorm"), 83 /* DXGI_FORMAT_BC5_UNORM */, "bc5-rg-unorm"), 84 /* DXGI_FORMAT_BC5_SNORM */, "bc5-rg-snorm"), 94 /* DXGI_FORMAT_BC6H_TYPELESS */, "bc6h-rgb-ufloat"), 95 /* DXGI_FORMAT_BC6H_UF16 */, "bc6h-rgb-ufloat"), 96 /* DXGI_FORMAT_BC6H_SF16 */, "bc6h-rgb-float"), 97 /* DXGI_FORMAT_BC7_TYPELESS */, "bc7-rgba-unorm"), 98 /* DXGI_FORMAT_BC7_UNORM */, "bc7-rgba-unorm"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_DXGI_TO_TEXTURE_FORM, 99 /* DXGI_FORMAT_BC7_UNORM_SRGB */, "bc7-rgba-unorm-srgb"), 28 /* DXGI_FORMAT_R8G8B8A8_UNORM */, "rgba8unorm"), 29 /* DXGI_FORMAT_R8G8B8A8_UNORM_SRGB */, "rgba8unorm-srgb"), 87 /* DXGI_FORMAT_B8G8R8A8_UNORM */, "bgra8unorm"), 91 /* DXGI_FORMAT_B8G8R8A8_UNORM_SRGB */, "bgra8unorm-srgb"), 41 /* DXGI_FORMAT_R32_FLOAT */, "r32float"), 49 /* DXGI_FORMAT_R8G8_UNORM */, "rg8unorm"), 56 /* DXGI_FORMAT_R16_UNORM */, "r16uint"), 61 /* DXGI_FORMAT_R8_UNORM */, "r8unorm"), 24 /* DXGI_FORMAT_R10G10B10A2_UNORM */, "rgb10a2unorm"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_DXGI_TO_TEXTURE_FORM, 11 /* DXGI_FORMAT_R16G16B16A16_UNORM */, "rgba16uint"), 13 /* DXGI_FORMAT_R16G16B16A16_SNORM */, "rgba16sint"), 10 /* DXGI_FORMAT_R16G16B16A16_FLOAT */, "rgba16float"), 54 /* DXGI_FORMAT_R16_FLOAT */, "r16float"), 34 /* DXGI_FORMAT_R16G16_FLOAT */, "rg16float"), 16 /* DXGI_FORMAT_R32G32_FLOAT */, "rg32float"), 2 /* DXGI_FORMAT_R32G32B32A32_FLOAT */, "rgba32float")); var DDS = { MAGIC_VALUE: 542327876, MAGIC_SIZE: 4, HEADER_SIZE: 124, HEADER_DX10_SIZE: 20, PIXEL_FORMAT_FLAGS: { // PIXEL_FORMAT flags // https://github.com/Microsoft/DirectXTex/blob/main/DirectXTex/DDS.h // https://learn.microsoft.com/en-us/windows/win32/direct3ddds/dds-pixelformat ALPHAPIXELS: 1, ALPHA: 2, FOURCC: 4, RGB: 64, RGBA: 65, YUV: 512, LUMINANCE: 131072, LUMINANCEA: 131073 }, RESOURCE_MISC_TEXTURECUBE: 4, HEADER_FIELDS: DDS_HEADER_FIELDS, HEADER_DX10_FIELDS: DDS_DX10_FIELDS, DXGI_FORMAT: DXGI_FORMAT, D3D10_RESOURCE_DIMENSION: D3D10_RESOURCE_DIMENSION, D3DFMT: D3DFMT }; var TEXTURE_FORMAT_BLOCK_SIZE = { "bc1-rgba-unorm": 8, "bc1-rgba-unorm-srgb": 8, "bc2-rgba-unorm": 16, "bc2-rgba-unorm-srgb": 16, "bc3-rgba-unorm": 16, "bc3-rgba-unorm-srgb": 16, "bc4-r-unorm": 8, "bc4-r-snorm": 8, "bc5-rg-unorm": 16, "bc5-rg-snorm": 16, "bc6h-rgb-ufloat": 16, "bc6h-rgb-float": 16, "bc7-rgba-unorm": 16, "bc7-rgba-unorm-srgb": 16 }; exports.D3D10_RESOURCE_DIMENSION = D3D10_RESOURCE_DIMENSION; exports.D3DFMT = D3DFMT; exports.DDS = DDS; exports.DXGI_FORMAT = DXGI_FORMAT; exports.DXGI_TO_TEXTURE_FORMAT = DXGI_TO_TEXTURE_FORMAT; exports.FOURCC_TO_TEXTURE_FORMAT = FOURCC_TO_TEXTURE_FORMAT; exports.TEXTURE_FORMAT_BLOCK_SIZE = TEXTURE_FORMAT_BLOCK_SIZE; /***/ }), /***/ 43265: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var BUFFER_TYPE = /* @__PURE__ */function (BUFFER_TYPE2) { BUFFER_TYPE2[BUFFER_TYPE2["ELEMENT_ARRAY_BUFFER"] = 34963] = "ELEMENT_ARRAY_BUFFER"; BUFFER_TYPE2[BUFFER_TYPE2["ARRAY_BUFFER"] = 34962] = "ARRAY_BUFFER"; BUFFER_TYPE2[BUFFER_TYPE2["UNIFORM_BUFFER"] = 35345] = "UNIFORM_BUFFER"; return BUFFER_TYPE2; }(BUFFER_TYPE || {}); exports.BUFFER_TYPE = BUFFER_TYPE; /***/ }), /***/ 43382: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var loadFontAsBase64 = __webpack_require__(78974); "use strict"; function loadFontCSS(_x, _x2) { return _loadFontCSS.apply(this, arguments); } function _loadFontCSS() { _loadFontCSS = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(style, url) { var dataSrc; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return loadFontAsBase64.loadFontAsBase64(url); case 1: dataSrc = _context.v; return _context.a(2, "@font-face {\n font-family: \"".concat(style.fontFamily, "\";\n src: url('").concat(dataSrc, "');\n font-weight: ").concat(style.fontWeight, ";\n font-style: ").concat(style.fontStyle, ";\n }")); } }, _callee); })); return _loadFontCSS.apply(this, arguments); } exports.loadFontCSS = loadFontCSS; /***/ }), /***/ 43469: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var deprecation = __webpack_require__(11225); "use strict"; var DEPRECATED_DRAW_MODES = { POINTS: "point-list", LINES: "line-list", LINE_STRIP: "line-strip", TRIANGLES: "triangle-list", TRIANGLE_STRIP: "triangle-strip" }; var DRAW_MODES = new Proxy(DEPRECATED_DRAW_MODES, { get: function get(target, prop) { deprecation.deprecation(deprecation.v8_0_0, "DRAW_MODES.".concat(prop, " is deprecated, use '").concat(DEPRECATED_DRAW_MODES[prop], "' instead")); return target[prop]; } }); exports.DRAW_MODES = DRAW_MODES; /***/ }), /***/ 43528: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var State = __webpack_require__(84938); var mapWebGLBlendModesToPixi = __webpack_require__(95822); "use strict"; var BLEND = 0; var OFFSET = 1; var CULLING = 2; var DEPTH_TEST = 3; var WINDING = 4; var DEPTH_MASK = 5; var _GlStateSystem = /*#__PURE__*/function () { function _GlStateSystem() { _classCallCheck(this, _GlStateSystem); this.gl = null; this.stateId = 0; this.polygonOffset = 0; this.blendMode = "none"; this._blendEq = false; this.map = []; this.map[BLEND] = this.setBlend; this.map[OFFSET] = this.setOffset; this.map[CULLING] = this.setCullFace; this.map[DEPTH_TEST] = this.setDepthTest; this.map[WINDING] = this.setFrontFace; this.map[DEPTH_MASK] = this.setDepthMask; this.checks = []; this.defaultState = State.State.for2d(); } return _createClass(_GlStateSystem, [{ key: "contextChange", value: function contextChange(gl) { this.gl = gl; this.blendModesMap = mapWebGLBlendModesToPixi.mapWebGLBlendModesToPixi(gl); this.resetState(); } /** * Sets the current state * @param {*} state - The state to set. */ }, { key: "set", value: function set(state) { state || (state = this.defaultState); if (this.stateId !== state.data) { var diff = this.stateId ^ state.data; var i = 0; while (diff) { if (diff & 1) { this.map[i].call(this, !!(state.data & 1 << i)); } diff >>= 1; i++; } this.stateId = state.data; } for (var _i = 0; _i < this.checks.length; _i++) { this.checks[_i](this, state); } } /** * Sets the state, when previous state is unknown. * @param {*} state - The state to set */ }, { key: "forceState", value: function forceState(state) { state || (state = this.defaultState); for (var i = 0; i < this.map.length; i++) { this.map[i].call(this, !!(state.data & 1 << i)); } for (var _i2 = 0; _i2 < this.checks.length; _i2++) { this.checks[_i2](this, state); } this.stateId = state.data; } /** * Sets whether to enable or disable blending. * @param value - Turn on or off WebGl blending. */ }, { key: "setBlend", value: function setBlend(value) { this._updateCheck(_GlStateSystem._checkBlendMode, value); this.gl[value ? "enable" : "disable"](this.gl.BLEND); } /** * Sets whether to enable or disable polygon offset fill. * @param value - Turn on or off webgl polygon offset testing. */ }, { key: "setOffset", value: function setOffset(value) { this._updateCheck(_GlStateSystem._checkPolygonOffset, value); this.gl[value ? "enable" : "disable"](this.gl.POLYGON_OFFSET_FILL); } /** * Sets whether to enable or disable depth test. * @param value - Turn on or off webgl depth testing. */ }, { key: "setDepthTest", value: function setDepthTest(value) { this.gl[value ? "enable" : "disable"](this.gl.DEPTH_TEST); } /** * Sets whether to enable or disable depth mask. * @param value - Turn on or off webgl depth mask. */ }, { key: "setDepthMask", value: function setDepthMask(value) { this.gl.depthMask(value); } /** * Sets whether to enable or disable cull face. * @param {boolean} value - Turn on or off webgl cull face. */ }, { key: "setCullFace", value: function setCullFace(value) { this.gl[value ? "enable" : "disable"](this.gl.CULL_FACE); } /** * Sets the gl front face. * @param {boolean} value - true is clockwise and false is counter-clockwise */ }, { key: "setFrontFace", value: function setFrontFace(value) { this.gl.frontFace(this.gl[value ? "CW" : "CCW"]); } /** * Sets the blend mode. * @param {number} value - The blend mode to set to. */ }, { key: "setBlendMode", value: function setBlendMode(value) { if (!this.blendModesMap[value]) { value = "normal"; } if (value === this.blendMode) { return; } this.blendMode = value; var mode = this.blendModesMap[value]; var gl = this.gl; if (mode.length === 2) { gl.blendFunc(mode[0], mode[1]); } else { gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]); } if (mode.length === 6) { this._blendEq = true; gl.blendEquationSeparate(mode[4], mode[5]); } else if (this._blendEq) { this._blendEq = false; gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD); } } /** * Sets the polygon offset. * @param {number} value - the polygon offset * @param {number} scale - the polygon offset scale */ }, { key: "setPolygonOffset", value: function setPolygonOffset(value, scale) { this.gl.polygonOffset(value, scale); } // used /** Resets all the logic and disables the VAOs. */ }, { key: "resetState", value: function resetState() { this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false); this.forceState(this.defaultState); this._blendEq = true; this.blendMode = ""; this.setBlendMode("normal"); } /** * Checks to see which updates should be checked based on which settings have been activated. * * For example, if blend is enabled then we should check the blend modes each time the state is changed * or if polygon fill is activated then we need to check if the polygon offset changes. * The idea is that we only check what we have too. * @param func - the checking function to add or remove * @param value - should the check function be added or removed. */ }, { key: "_updateCheck", value: function _updateCheck(func, value) { var index = this.checks.indexOf(func); if (value && index === -1) { this.checks.push(func); } else if (!value && index !== -1) { this.checks.splice(index, 1); } } /** * A private little wrapper function that we call to check the blend mode. * @param system - the System to perform the state check on * @param state - the state that the blendMode will pulled from */ }, { key: "destroy", value: /** * @ignore */ function destroy() { this.gl = null; this.checks.length = 0; } }], [{ key: "_checkBlendMode", value: function _checkBlendMode(system, state) { system.setBlendMode(state.blendMode); } /** * A private little wrapper function that we call to check the polygon offset. * @param system - the System to perform the state check on * @param state - the state that the blendMode will pulled from */ }, { key: "_checkPolygonOffset", value: function _checkPolygonOffset(system, state) { system.setPolygonOffset(1, state.polygonOffset); } }]); }(); /** @ignore */ _GlStateSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "state" }; var GlStateSystem = _GlStateSystem; exports.GlStateSystem = GlStateSystem; /***/ }), /***/ 43717: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var FilterPipe = /*#__PURE__*/function () { function FilterPipe(renderer) { _classCallCheck(this, FilterPipe); this._renderer = renderer; } return _createClass(FilterPipe, [{ key: "push", value: function push(filterEffect, container, instructionSet) { var renderPipes = this._renderer.renderPipes; renderPipes.batch["break"](instructionSet); instructionSet.add({ renderPipeId: "filter", canBundle: false, action: "pushFilter", container: container, filterEffect: filterEffect }); } }, { key: "pop", value: function pop(_filterEffect, _container, instructionSet) { this._renderer.renderPipes.batch["break"](instructionSet); instructionSet.add({ renderPipeId: "filter", action: "popFilter", canBundle: false }); } }, { key: "execute", value: function execute(instruction) { if (instruction.action === "pushFilter") { this._renderer.filter.push(instruction); } else if (instruction.action === "popFilter") { this._renderer.filter.pop(); } } }, { key: "destroy", value: function destroy() { this._renderer = null; } }]); }(); FilterPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "filter" }; exports.FilterPipe = FilterPipe; /***/ }), /***/ 43884: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Matrix = __webpack_require__(20764); var applyMatrix = __webpack_require__(23963); "use strict"; function setUvs(tilingSprite, uvs) { var texture = tilingSprite.texture; var width = texture.frame.width; var height = texture.frame.height; var anchorX = 0; var anchorY = 0; if (tilingSprite.applyAnchorToTexture) { anchorX = tilingSprite.anchor.x; anchorY = tilingSprite.anchor.y; } uvs[0] = uvs[6] = -anchorX; uvs[2] = uvs[4] = 1 - anchorX; uvs[1] = uvs[3] = -anchorY; uvs[5] = uvs[7] = 1 - anchorY; var textureMatrix = Matrix.Matrix.shared; textureMatrix.copyFrom(tilingSprite._tileTransform.matrix); textureMatrix.tx /= tilingSprite.width; textureMatrix.ty /= tilingSprite.height; textureMatrix.invert(); textureMatrix.scale(tilingSprite.width / width, tilingSprite.height / height); applyMatrix.applyMatrix(uvs, 2, 0, textureMatrix); } exports.setUvs = setUvs; /***/ }), /***/ 43885: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var warn = __webpack_require__(57371); var path = __webpack_require__(30710); var Cache = __webpack_require__(65278); var checkDataUrl = __webpack_require__(36258); var checkExtension = __webpack_require__(59230); var LoaderParser = __webpack_require__(96804); "use strict"; var validWeights = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"]; var validFontExtensions = [".ttf", ".otf", ".woff", ".woff2"]; var validFontMIMEs = ["font/ttf", "font/otf", "font/woff", "font/woff2"]; var CSS_IDENT_TOKEN_REGEX = /^(--|-?[A-Z_])[0-9A-Z_-]*$/i; function getFontFamilyName(url) { var ext = path.path.extname(url); var name = path.path.basename(url, ext); var nameWithSpaces = name.replace(/(-|_)/g, " "); var nameTokens = nameWithSpaces.toLowerCase().split(" ").map(function (word) { return word.charAt(0).toUpperCase() + word.slice(1); }); var valid = nameTokens.length > 0; var _iterator = _createForOfIteratorHelper(nameTokens), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var token = _step.value; if (!token.match(CSS_IDENT_TOKEN_REGEX)) { valid = false; break; } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } var fontFamilyName = nameTokens.join(" "); if (!valid) { fontFamilyName = "\"".concat(fontFamilyName.replace(/[\\"]/g, "\\$&"), "\""); } return fontFamilyName; } var validURICharactersRegex = /^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/; function encodeURIWhenNeeded(uri) { if (validURICharactersRegex.test(uri)) { return uri; } return encodeURI(uri); } var loadWebFont = { extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.Low }, name: "loadWebFont", test: function test(url) { return checkDataUrl.checkDataUrl(url, validFontMIMEs) || checkExtension.checkExtension(url, validFontExtensions); }, load: function load(url, options) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var fonts, _options$data$family, _options$data, _options$data$weights, _options$data2, _options$data3, fontFaces, name, weights, data, i, weight, font; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: fonts = adapter.DOMAdapter.get().getFontFaceSet(); if (!fonts) { _context.n = 5; break; } fontFaces = []; name = (_options$data$family = (_options$data = options.data) === null || _options$data === void 0 ? void 0 : _options$data.family) !== null && _options$data$family !== void 0 ? _options$data$family : getFontFamilyName(url); weights = (_options$data$weights = (_options$data2 = options.data) === null || _options$data2 === void 0 || (_options$data2 = _options$data2.weights) === null || _options$data2 === void 0 ? void 0 : _options$data2.filter(function (weight) { return validWeights.includes(weight); })) !== null && _options$data$weights !== void 0 ? _options$data$weights : ["normal"]; data = (_options$data3 = options.data) !== null && _options$data3 !== void 0 ? _options$data3 : {}; i = 0; case 1: if (!(i < weights.length)) { _context.n = 4; break; } weight = weights[i]; font = new FontFace(name, "url(".concat(encodeURIWhenNeeded(url), ")"), _objectSpread(_objectSpread({}, data), {}, { weight: weight })); _context.n = 2; return font.load(); case 2: fonts.add(font); fontFaces.push(font); case 3: i++; _context.n = 1; break; case 4: Cache.Cache.set("".concat(name, "-and-url"), { url: url, fontFaces: fontFaces }); return _context.a(2, fontFaces.length === 1 ? fontFaces[0] : fontFaces); case 5: warn.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"); return _context.a(2, null); } }, _callee); }))(); }, unload: function unload(font) { (Array.isArray(font) ? font : [font]).forEach(function (t) { Cache.Cache.remove("".concat(t.family, "-and-url")); adapter.DOMAdapter.get().getFontFaceSet()["delete"](t); }); } }; exports.getFontFamilyName = getFontFamilyName; exports.loadWebFont = loadWebFont; /***/ }), /***/ 43905: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); var GLhls = __webpack_require__(44064); var GPUhls = __webpack_require__(505); "use strict"; var LuminosityBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function LuminosityBlend() { _classCallCheck(this, LuminosityBlend); return _callSuper(this, LuminosityBlend, [{ gl: { functions: "\n ".concat(GLhls.hslgl, "\n\n vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)\n {\n vec3 blendLuminosity = setLuminosity(base, getLuminosity(blend));\n return (blendLuminosity * opacity + base * (1.0 - opacity));\n }\n "), main: "\n finalColor = vec4(blendLuminosity(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n ".concat(GPUhls.hslgpu, "\n\n fn blendLuminosity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blendLuminosity: vec3<f32> = setLuminosity(base, getLuminosity(blend));\n return (blendLuminosity * opacity + base * (1.0 - opacity));\n }\n "), main: "\n out = vec4<f32>(blendLuminosity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(LuminosityBlend, _BlendModeFilter$Blen); return _createClass(LuminosityBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ LuminosityBlend.extension = { name: "luminosity", type: Extensions.ExtensionType.BlendMode }; exports.LuminosityBlend = LuminosityBlend; /***/ }), /***/ 44036: /***/ ((__unused_webpack_module, exports) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } Object.defineProperty(exports, "__esModule", ({ value: true })); var WORKER_CODE = "(function () {\n 'use strict';\n\n function createLevelBuffers(basisTexture, basisTranscoderFormat) {\n const images = basisTexture.getNumImages();\n const levels = basisTexture.getNumLevels(0);\n const success = basisTexture.startTranscoding();\n if (!success) {\n throw new Error(\"startTranscoding failed\");\n }\n const levelBuffers = [];\n for (let levelIndex = 0; levelIndex < levels; ++levelIndex) {\n for (let sliceIndex = 0; sliceIndex < images; ++sliceIndex) {\n const transcodeSize = basisTexture.getImageTranscodedSizeInBytes(sliceIndex, levelIndex, basisTranscoderFormat);\n const levelBuffer = new Uint8Array(transcodeSize);\n const success2 = basisTexture.transcodeImage(levelBuffer, sliceIndex, levelIndex, basisTranscoderFormat, 1, 0);\n if (!success2) {\n throw new Error(\"transcodeImage failed\");\n }\n levelBuffers.push(levelBuffer);\n }\n }\n return levelBuffers;\n }\n\n const gpuFormatToBasisTranscoderFormatMap = {\n \"bc3-rgba-unorm\": 3,\n // cTFBC3_RGBA\n \"bc7-rgba-unorm\": 6,\n // cTFBC7_RGBA,\n \"etc2-rgba8unorm\": 1,\n // cTFETC2_RGBA,\n \"astc-4x4-unorm\": 10,\n // cTFASTC_4x4_RGBA,\n // Uncompressed\n rgba8unorm: 13,\n // cTFRGBA32,\n rgba4unorm: 16\n // cTFRGBA4444,\n };\n function gpuFormatToBasisTranscoderFormat(transcoderFormat) {\n const format = gpuFormatToBasisTranscoderFormatMap[transcoderFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported transcoderFormat: ${transcoderFormat}`);\n }\n\n const settings = {\n jsUrl: \"basis/basis_transcoder.js\",\n wasmUrl: \"basis/basis_transcoder.wasm\"\n };\n let basisTranscoderFormat;\n let basisTranscodedTextureFormat;\n let basisPromise;\n async function getBasis() {\n if (!basisPromise) {\n const absoluteJsUrl = new URL(settings.jsUrl, location.origin).href;\n const absoluteWasmUrl = new URL(settings.wasmUrl, location.origin).href;\n importScripts(absoluteJsUrl);\n basisPromise = new Promise((resolve) => {\n BASIS({\n locateFile: (_file) => absoluteWasmUrl\n }).then((module) => {\n module.initializeBasis();\n resolve(module.BasisFile);\n });\n });\n }\n return basisPromise;\n }\n async function fetchBasisTexture(url, BasisTexture) {\n const basisResponse = await fetch(url);\n if (basisResponse.ok) {\n const basisArrayBuffer = await basisResponse.arrayBuffer();\n return new BasisTexture(new Uint8Array(basisArrayBuffer));\n }\n throw new Error(`Failed to load Basis texture: ${url}`);\n }\n const preferredTranscodedFormat = [\n \"bc7-rgba-unorm\",\n \"astc-4x4-unorm\",\n \"etc2-rgba8unorm\",\n \"bc3-rgba-unorm\",\n \"rgba8unorm\"\n ];\n async function load(url) {\n const BasisTexture = await getBasis();\n const basisTexture = await fetchBasisTexture(url, BasisTexture);\n const levelBuffers = createLevelBuffers(basisTexture, basisTranscoderFormat);\n return {\n width: basisTexture.getImageWidth(0, 0),\n height: basisTexture.getImageHeight(0, 0),\n format: basisTranscodedTextureFormat,\n resource: levelBuffers,\n alphaMode: \"no-premultiply-alpha\"\n };\n }\n async function init(jsUrl, wasmUrl, supportedTextures) {\n if (jsUrl)\n settings.jsUrl = jsUrl;\n if (wasmUrl)\n settings.wasmUrl = wasmUrl;\n basisTranscodedTextureFormat = preferredTranscodedFormat.filter((format) => supportedTextures.includes(format))[0];\n basisTranscoderFormat = gpuFormatToBasisTranscoderFormat(basisTranscodedTextureFormat);\n await getBasis();\n }\n const messageHandlers = {\n init: async (data) => {\n const { jsUrl, wasmUrl, supportedTextures } = data;\n await init(jsUrl, wasmUrl, supportedTextures);\n },\n load: async (data) => {\n try {\n const textureOptions = await load(data.url);\n return {\n type: \"load\",\n url: data.url,\n success: true,\n textureOptions,\n transferables: textureOptions.resource?.map((arr) => arr.buffer)\n };\n } catch (e) {\n throw e;\n }\n }\n };\n self.onmessage = async (messageEvent) => {\n const message = messageEvent.data;\n const response = await messageHandlers[message.type](message);\n if (response) {\n self.postMessage(response, response.transferables);\n }\n };\n\n})();\n"; var WORKER_URL = null; var WorkerInstance = /*#__PURE__*/_createClass(function WorkerInstance() { _classCallCheck(this, WorkerInstance); if (!WORKER_URL) { WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' })); } this.worker = new Worker(WORKER_URL); }); WorkerInstance.revokeObjectURL = function revokeObjectURL() { if (WORKER_URL) { URL.revokeObjectURL(WORKER_URL); WORKER_URL = null; } }; exports["default"] = WorkerInstance; /***/ }), /***/ 44064: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var hslgl = "\n\tfloat getLuminosity(vec3 c) {\n\t\treturn 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;\n\t}\n\n\tvec3 setLuminosity(vec3 c, float lum) {\n\t\tfloat modLum = lum - getLuminosity(c);\n\t\tvec3 color = c.rgb + vec3(modLum);\n\n\t\t// clip back into legal range\n\t\tmodLum = getLuminosity(color);\n\t\tvec3 modLumVec = vec3(modLum);\n\n\t\tfloat cMin = min(color.r, min(color.g, color.b));\n\t\tfloat cMax = max(color.r, max(color.g, color.b));\n\n\t\tif(cMin < 0.0) {\n\t\t\tcolor = mix(modLumVec, color, modLum / (modLum - cMin));\n\t\t}\n\n\t\tif(cMax > 1.0) {\n\t\t\tcolor = mix(modLumVec, color, (1.0 - modLum) / (cMax - modLum));\n\t\t}\n\n\t\treturn color;\n\t}\n\n\tfloat getSaturation(vec3 c) {\n\t\treturn max(c.r, max(c.g, c.b)) - min(c.r, min(c.g, c.b));\n\t}\n\n\tvec3 setSaturationMinMidMax(vec3 cSorted, float s) {\n\t\tvec3 colorSorted = cSorted;\n\n\t\tif(colorSorted.z > colorSorted.x) {\n\t\t\tcolorSorted.y = (((colorSorted.y - colorSorted.x) * s) / (colorSorted.z - colorSorted.x));\n\t\t\tcolorSorted.z = s;\n\t\t}\n\t\telse {\n\t\t\tcolorSorted.y = 0.0;\n\t\t\tcolorSorted.z = 0.0;\n\t\t}\n\n\t\tcolorSorted.x = 0.0;\n\n\t\treturn colorSorted;\n\t}\n\n\tvec3 setSaturation(vec3 c, float s) {\n\t\tvec3 color = c;\n\n\t\tif(color.r <= color.g && color.r <= color.b) {\n\t\t\tif(color.g <= color.b) {\n\t\t\t\tcolor = setSaturationMinMidMax(color.rgb, s).rgb;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcolor = setSaturationMinMidMax(color.rbg, s).rbg;\n\t\t\t}\n\t\t}\n\t\telse if(color.g <= color.r && color.g <= color.b) {\n\t\t\tif(color.r <= color.b) {\n\t\t\t\tcolor = setSaturationMinMidMax(color.grb, s).grb;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcolor = setSaturationMinMidMax(color.gbr, s).gbr;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// Using bgr for both fixes part of hue\n\t\t\tif(color.r <= color.g) {\n\t\t\t\tcolor = setSaturationMinMidMax(color.brg, s).brg;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcolor = setSaturationMinMidMax(color.bgr, s).bgr;\n\t\t\t}\n\t\t}\n\n\t\treturn color;\n\t}\n "; exports.hslgl = hslgl; /***/ }), /***/ 44241: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); "use strict"; var browserExt = { extension: { type: Extensions.ExtensionType.Environment, name: "browser", priority: -1 }, test: function test() { return true; }, load: function () { var _load = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return Promise.resolve().then(function () { return __webpack_require__(52569); }); case 1: return _context.a(2); } }, _callee); })); function load() { return _load.apply(this, arguments); } return load; }() }; exports.browserExt = browserExt; /***/ }), /***/ 44383: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var gpuFormatToBasisTranscoderFormatMap = { "bc3-rgba-unorm": "BC3_RGBA", "bc7-rgba-unorm": "BC7_M5_RGBA", "etc2-rgba8unorm": "ETC2_RGBA", "astc-4x4-unorm": "ASTC_4x4_RGBA", // Uncompressed rgba8unorm: "RGBA32", rg11b10ufloat: "R11F_G11F_B10F" }; function gpuFormatToKTXBasisTranscoderFormat(transcoderFormat) { var format = gpuFormatToBasisTranscoderFormatMap[transcoderFormat]; if (format) { return format; } throw new Error("Unsupported transcoderFormat: ".concat(transcoderFormat)); } exports.gpuFormatToKTXBasisTranscoderFormat = gpuFormatToKTXBasisTranscoderFormat; /***/ }), /***/ 44622: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var LoaderParser = __webpack_require__(96804); var Resolver = __webpack_require__(54080); var copySearchParams = __webpack_require__(16508); var Extensions = __webpack_require__(86890); var Texture = __webpack_require__(73782); var path = __webpack_require__(30710); var Spritesheet = __webpack_require__(68216); "use strict"; var validImages = ["jpg", "png", "jpeg", "avif", "webp", "basis", "etc2", "bc7", "bc6h", "bc5", "bc4", "bc3", "bc2", "bc1", "eac", "astc"]; function _getCacheableAssets(keys, asset, ignoreMultiPack) { var out = {}; keys.forEach(function (key) { out[key] = asset; }); Object.keys(asset.textures).forEach(function (key) { out[key] = asset.textures[key]; }); if (!ignoreMultiPack) { var basePath = path.path.dirname(keys[0]); asset.linkedSheets.forEach(function (item, i) { var out2 = _getCacheableAssets(["".concat(basePath, "/").concat(asset.data.meta.related_multi_packs[i])], item, true); Object.assign(out, out2); }); } return out; } var spritesheetAsset = { extension: Extensions.ExtensionType.Asset, /** Handle the caching of the related Spritesheet Textures */ cache: { test: function test(asset) { return asset instanceof Spritesheet.Spritesheet; }, getCacheableAssets: function getCacheableAssets(keys, asset) { return _getCacheableAssets(keys, asset, false); } }, /** Resolve the resolution of the asset. */ resolver: { extension: { type: Extensions.ExtensionType.ResolveParser, name: "resolveSpritesheet" }, test: function test(value) { var tempURL = value.split("?")[0]; var split = tempURL.split("."); var extension = split.pop(); var format = split.pop(); return extension === "json" && validImages.includes(format); }, parse: function parse(value) { var _Resolver$Resolver$RE, _Resolver$Resolver$RE2; var split = value.split("."); return { resolution: parseFloat((_Resolver$Resolver$RE = (_Resolver$Resolver$RE2 = Resolver.Resolver.RETINA_PREFIX.exec(value)) === null || _Resolver$Resolver$RE2 === void 0 ? void 0 : _Resolver$Resolver$RE2[1]) !== null && _Resolver$Resolver$RE !== void 0 ? _Resolver$Resolver$RE : "1"), format: split[split.length - 2], src: value }; } }, /** * Loader plugin that parses sprite sheets! * once the JSON has been loaded this checks to see if the JSON is spritesheet data. * If it is, we load the spritesheets image and parse the data into Spritesheet * All textures in the sprite sheet are then added to the cache */ loader: { name: "spritesheetLoader", extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.Normal, name: "spritesheetLoader" }, testParse: function testParse(asset, options) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: return _context.a(2, path.path.extname(options.src).toLowerCase() === ".json" && !!asset.frames); } }, _callee); }))(); }, parse: function parse(asset, options, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() { var _options$data, _asset$meta; var _ref, imageTexture, imageFilename, textureOptions, basePath, texture, imagePath, assets, spritesheet, multiPacks, promises, _iterator, _step, _options$data2, item, itemUrl, res, _t; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: _ref = (_options$data = options === null || options === void 0 ? void 0 : options.data) !== null && _options$data !== void 0 ? _options$data : {}, imageTexture = _ref.texture, imageFilename = _ref.imageFilename, textureOptions = _ref.textureOptions; basePath = path.path.dirname(options.src); if (basePath && basePath.lastIndexOf("/") !== basePath.length - 1) { basePath += "/"; } if (!(imageTexture instanceof Texture.Texture)) { _context2.n = 1; break; } texture = imageTexture; _context2.n = 3; break; case 1: imagePath = copySearchParams.copySearchParams(basePath + (imageFilename !== null && imageFilename !== void 0 ? imageFilename : asset.meta.image), options.src); _context2.n = 2; return loader.load([{ src: imagePath, data: textureOptions }]); case 2: assets = _context2.v; texture = assets[imagePath]; case 3: spritesheet = new Spritesheet.Spritesheet(texture.source, asset); _context2.n = 4; return spritesheet.parse(); case 4: multiPacks = asset === null || asset === void 0 || (_asset$meta = asset.meta) === null || _asset$meta === void 0 ? void 0 : _asset$meta.related_multi_packs; if (!Array.isArray(multiPacks)) { _context2.n = 15; break; } promises = []; _iterator = _createForOfIteratorHelper(multiPacks); _context2.p = 5; _iterator.s(); case 6: if ((_step = _iterator.n()).done) { _context2.n = 10; break; } item = _step.value; if (!(typeof item !== "string")) { _context2.n = 7; break; } return _context2.a(3, 9); case 7: itemUrl = basePath + item; if (!((_options$data2 = options.data) !== null && _options$data2 !== void 0 && _options$data2.ignoreMultiPack)) { _context2.n = 8; break; } return _context2.a(3, 9); case 8: itemUrl = copySearchParams.copySearchParams(itemUrl, options.src); promises.push(loader.load({ src: itemUrl, data: { textureOptions: textureOptions, ignoreMultiPack: true } })); case 9: _context2.n = 6; break; case 10: _context2.n = 12; break; case 11: _context2.p = 11; _t = _context2.v; _iterator.e(_t); case 12: _context2.p = 12; _iterator.f(); return _context2.f(12); case 13: _context2.n = 14; return Promise.all(promises); case 14: res = _context2.v; spritesheet.linkedSheets = res; res.forEach(function (item) { item.linkedSheets = [spritesheet].concat(spritesheet.linkedSheets.filter(function (sp) { return sp !== item; })); }); case 15: return _context2.a(2, spritesheet); } }, _callee2, null, [[5, 11, 12, 13]]); }))(); }, unload: function unload(spritesheet, _resolvedAsset, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() { return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: _context3.n = 1; return loader.unload(spritesheet.textureSource._sourceOrigin); case 1: spritesheet.destroy(false); case 2: return _context3.a(2); } }, _callee3); }))(); } } }; exports.spritesheetAsset = spritesheetAsset; /***/ }), /***/ 44840: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Matrix = __webpack_require__(20764); var Bounds = __webpack_require__(76631); var getGlobalBounds = __webpack_require__(27182); var _getLocalBounds = __webpack_require__(81268); var checkChildrenDidChange = __webpack_require__(5040); "use strict"; var tempMatrix = new Matrix.Matrix(); var measureMixin = { _localBoundsCacheId: -1, _localBoundsCacheData: null, _setWidth: function _setWidth(value, localWidth) { var sign = Math.sign(this.scale.x) || 1; if (localWidth !== 0) { this.scale.x = value / localWidth * sign; } else { this.scale.x = sign; } }, _setHeight: function _setHeight(value, localHeight) { var sign = Math.sign(this.scale.y) || 1; if (localHeight !== 0) { this.scale.y = value / localHeight * sign; } else { this.scale.y = sign; } }, /** * Retrieves the local bounds of the container as a Bounds object. * @returns - The bounding area. * @memberof scene.Container# */ getLocalBounds: function getLocalBounds() { if (!this._localBoundsCacheData) { this._localBoundsCacheData = { data: [], index: 1, didChange: false, localBounds: new Bounds.Bounds() }; } var localBoundsCacheData = this._localBoundsCacheData; localBoundsCacheData.index = 1; localBoundsCacheData.didChange = false; if (localBoundsCacheData.data[0] !== this._didViewChangeTick) { localBoundsCacheData.didChange = true; localBoundsCacheData.data[0] = this._didViewChangeTick; } checkChildrenDidChange.checkChildrenDidChange(this, localBoundsCacheData); if (localBoundsCacheData.didChange) { _getLocalBounds.getLocalBounds(this, localBoundsCacheData.localBounds, tempMatrix); } return localBoundsCacheData.localBounds; }, /** * Calculates and returns the (world) bounds of the display object as a [Rectangle]{@link Rectangle}. * @param skipUpdate - Setting to `true` will stop the transforms of the scene graph from * being updated. This means the calculation returned MAY be out of date BUT will give you a * nice performance boost. * @param bounds - Optional bounds to store the result of the bounds calculation. * @returns - The minimum axis-aligned rectangle in world space that fits around this object. * @memberof scene.Container# */ getBounds: function getBounds(skipUpdate, bounds) { return getGlobalBounds.getGlobalBounds(this, skipUpdate, bounds || new Bounds.Bounds()); } }; exports.measureMixin = measureMixin; /***/ }), /***/ 45001: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var source = "struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct ColorMatrixUniforms {\n uColorMatrix:array<vec4<f32>, 5>,\n uAlpha:f32,\n};\n\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n@group(1) @binding(0) var<uniform> colorMatrixUniforms : ColorMatrixUniforms;\n\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n };\n \nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition),\n );\n}\n\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n) -> @location(0) vec4<f32> {\n\n\n var c = textureSample(uTexture, uSampler, uv);\n \n if (colorMatrixUniforms.uAlpha == 0.0) {\n return c;\n }\n\n \n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.r /= c.a;\n c.g /= c.a;\n c.b /= c.a;\n }\n\n var cm = colorMatrixUniforms.uColorMatrix;\n\n\n var result = vec4<f32>(0.);\n\n result.r = (cm[0][0] * c.r);\n result.r += (cm[0][1] * c.g);\n result.r += (cm[0][2] * c.b);\n result.r += (cm[0][3] * c.a);\n result.r += cm[1][0];\n\n result.g = (cm[1][1] * c.r);\n result.g += (cm[1][2] * c.g);\n result.g += (cm[1][3] * c.b);\n result.g += (cm[2][0] * c.a);\n result.g += cm[2][1];\n\n result.b = (cm[2][2] * c.r);\n result.b += (cm[2][3] * c.g);\n result.b += (cm[3][0] * c.b);\n result.b += (cm[3][1] * c.a);\n result.b += cm[3][2];\n\n result.a = (cm[3][3] * c.r);\n result.a += (cm[4][0] * c.g);\n result.a += (cm[4][1] * c.b);\n result.a += (cm[4][2] * c.a);\n result.a += cm[4][3];\n\n var rgb = mix(c.rgb, result.rgb, colorMatrixUniforms.uAlpha);\n\n rgb.r *= result.a;\n rgb.g *= result.a;\n rgb.b *= result.a;\n\n return vec4(rgb, result.a);\n}"; exports["default"] = source; /***/ }), /***/ 45084: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function extractSvgUrlId(url) { var match = url.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i); return match ? match[1] : ""; } exports.extractSvgUrlId = extractSvgUrlId; /***/ }), /***/ 45299: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var GlProgram = __webpack_require__(23896); var generateBlurFragSource = __webpack_require__(76421); var generateBlurVertSource = __webpack_require__(34278); "use strict"; function generateBlurGlProgram(horizontal, kernelSize) { var vertex = generateBlurVertSource.generateBlurVertSource(kernelSize, horizontal); var fragment = generateBlurFragSource.generateBlurFragSource(kernelSize); return GlProgram.GlProgram.from({ vertex: vertex, fragment: fragment, name: "blur-".concat(horizontal ? "horizontal" : "vertical", "-pass-filter") }); } exports.generateBlurGlProgram = generateBlurGlProgram; /***/ }), /***/ 45301: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var deprecation = __webpack_require__(11225); var MeshGeometry = __webpack_require__(56451); "use strict"; var _PlaneGeometry = /*#__PURE__*/function (_MeshGeometry$MeshGeo) { function _PlaneGeometry() { var _ref; var _this; _classCallCheck(this, _PlaneGeometry); _this = _callSuper(this, _PlaneGeometry, [{}]); var options = (_ref = arguments.length <= 0 ? undefined : arguments[0]) !== null && _ref !== void 0 ? _ref : {}; if (typeof options === "number") { deprecation.deprecation(deprecation.v8_0_0, "PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"); options = { width: options, height: arguments.length <= 1 ? undefined : arguments[1], verticesX: arguments.length <= 2 ? undefined : arguments[2], verticesY: arguments.length <= 3 ? undefined : arguments[3] }; } _this.build(options); return _this; } /** * Refreshes plane coordinates * @param options - Options to be applied to plane geometry */ _inherits(_PlaneGeometry, _MeshGeometry$MeshGeo); return _createClass(_PlaneGeometry, [{ key: "build", value: function build(options) { var _this$verticesX, _this$verticesY, _this$width, _this$height; options = _objectSpread(_objectSpread({}, _PlaneGeometry.defaultOptions), options); this.verticesX = (_this$verticesX = this.verticesX) !== null && _this$verticesX !== void 0 ? _this$verticesX : options.verticesX; this.verticesY = (_this$verticesY = this.verticesY) !== null && _this$verticesY !== void 0 ? _this$verticesY : options.verticesY; this.width = (_this$width = this.width) !== null && _this$width !== void 0 ? _this$width : options.width; this.height = (_this$height = this.height) !== null && _this$height !== void 0 ? _this$height : options.height; var total = this.verticesX * this.verticesY; var verts = []; var uvs = []; var indices = []; var verticesX = this.verticesX - 1; var verticesY = this.verticesY - 1; var sizeX = this.width / verticesX; var sizeY = this.height / verticesY; for (var i = 0; i < total; i++) { var x = i % this.verticesX; var y = i / this.verticesX | 0; verts.push(x * sizeX, y * sizeY); uvs.push(x / verticesX, y / verticesY); } var totalSub = verticesX * verticesY; for (var _i = 0; _i < totalSub; _i++) { var xpos = _i % verticesX; var ypos = _i / verticesX | 0; var value = ypos * this.verticesX + xpos; var value2 = ypos * this.verticesX + xpos + 1; var value3 = (ypos + 1) * this.verticesX + xpos; var value4 = (ypos + 1) * this.verticesX + xpos + 1; indices.push(value, value2, value3, value2, value4, value3); } this.buffers[0].data = new Float32Array(verts); this.buffers[1].data = new Float32Array(uvs); this.indexBuffer.data = new Uint32Array(indices); this.buffers[0].update(); this.buffers[1].update(); this.indexBuffer.update(); } }]); }(MeshGeometry.MeshGeometry); _PlaneGeometry.defaultOptions = { width: 100, height: 100, verticesX: 10, verticesY: 10 }; var PlaneGeometry = _PlaneGeometry; exports.PlaneGeometry = PlaneGeometry; /***/ }), /***/ 45394: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var glUploadBufferImageResource = { id: "buffer", upload: function upload(source, glTexture, gl) { if (glTexture.width === source.width || glTexture.height === source.height) { gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, source.width, source.height, glTexture.format, glTexture.type, source.resource); } else { gl.texImage2D(glTexture.target, 0, glTexture.internalFormat, source.width, source.height, 0, glTexture.format, glTexture.type, source.resource); } glTexture.width = source.width; glTexture.height = source.height; } }; exports.glUploadBufferImageResource = glUploadBufferImageResource; /***/ }), /***/ 45413: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var GpuMipmapGenerator = /*#__PURE__*/function () { function GpuMipmapGenerator(device) { _classCallCheck(this, GpuMipmapGenerator); this.device = device; this.sampler = device.createSampler({ minFilter: "linear" }); this.pipelines = {}; } return _createClass(GpuMipmapGenerator, [{ key: "_getMipmapPipeline", value: function _getMipmapPipeline(format) { var pipeline = this.pipelines[format]; if (!pipeline) { if (!this.mipmapShaderModule) { this.mipmapShaderModule = this.device.createShaderModule({ code: /* wgsl */"\n var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));\n\n struct VertexOutput {\n @builtin(position) position : vec4<f32>,\n @location(0) texCoord : vec2<f32>,\n };\n\n @vertex\n fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {\n var output : VertexOutput;\n output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);\n output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);\n return output;\n }\n\n @group(0) @binding(0) var imgSampler : sampler;\n @group(0) @binding(1) var img : texture_2d<f32>;\n\n @fragment\n fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {\n return textureSample(img, imgSampler, texCoord);\n }\n " }); } pipeline = this.device.createRenderPipeline({ layout: "auto", vertex: { module: this.mipmapShaderModule, entryPoint: "vertexMain" }, fragment: { module: this.mipmapShaderModule, entryPoint: "fragmentMain", targets: [{ format: format }] } }); this.pipelines[format] = pipeline; } return pipeline; } /** * Generates mipmaps for the given GPUTexture from the data in level 0. * @param {module:External.GPUTexture} texture - Texture to generate mipmaps for. * @returns {module:External.GPUTexture} - The originally passed texture */ }, { key: "generateMipmap", value: function generateMipmap(texture) { var pipeline = this._getMipmapPipeline(texture.format); if (texture.dimension === "3d" || texture.dimension === "1d") { throw new Error("Generating mipmaps for non-2d textures is currently unsupported!"); } var mipTexture = texture; var arrayLayerCount = texture.depthOrArrayLayers || 1; var renderToSource = texture.usage & GPUTextureUsage.RENDER_ATTACHMENT; if (!renderToSource) { var mipTextureDescriptor = { size: { width: Math.ceil(texture.width / 2), height: Math.ceil(texture.height / 2), depthOrArrayLayers: arrayLayerCount }, format: texture.format, usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC | GPUTextureUsage.RENDER_ATTACHMENT, mipLevelCount: texture.mipLevelCount - 1 }; mipTexture = this.device.createTexture(mipTextureDescriptor); } var commandEncoder = this.device.createCommandEncoder({}); var bindGroupLayout = pipeline.getBindGroupLayout(0); for (var arrayLayer = 0; arrayLayer < arrayLayerCount; ++arrayLayer) { var srcView = texture.createView({ baseMipLevel: 0, mipLevelCount: 1, dimension: "2d", baseArrayLayer: arrayLayer, arrayLayerCount: 1 }); var dstMipLevel = renderToSource ? 1 : 0; for (var i = 1; i < texture.mipLevelCount; ++i) { var dstView = mipTexture.createView({ baseMipLevel: dstMipLevel++, mipLevelCount: 1, dimension: "2d", baseArrayLayer: arrayLayer, arrayLayerCount: 1 }); var passEncoder = commandEncoder.beginRenderPass({ colorAttachments: [{ view: dstView, storeOp: "store", loadOp: "clear", clearValue: { r: 0, g: 0, b: 0, a: 0 } }] }); var bindGroup = this.device.createBindGroup({ layout: bindGroupLayout, entries: [{ binding: 0, resource: this.sampler }, { binding: 1, resource: srcView }] }); passEncoder.setPipeline(pipeline); passEncoder.setBindGroup(0, bindGroup); passEncoder.draw(3, 1, 0, 0); passEncoder.end(); srcView = dstView; } } if (!renderToSource) { var mipLevelSize = { width: Math.ceil(texture.width / 2), height: Math.ceil(texture.height / 2), depthOrArrayLayers: arrayLayerCount }; for (var _i = 1; _i < texture.mipLevelCount; ++_i) { commandEncoder.copyTextureToTexture({ texture: mipTexture, mipLevel: _i - 1 }, { texture: texture, mipLevel: _i }, mipLevelSize); mipLevelSize.width = Math.ceil(mipLevelSize.width / 2); mipLevelSize.height = Math.ceil(mipLevelSize.height / 2); } } this.device.queue.submit([commandEncoder.finish()]); if (!renderToSource) { mipTexture.destroy(); } return texture; } }]); }(); exports.GpuMipmapGenerator = GpuMipmapGenerator; /***/ }), /***/ 45520: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function parseFunctionBody(fn) { var fnStr = fn.toString(); var bodyStart = fnStr.indexOf("{"); var bodyEnd = fnStr.lastIndexOf("}"); if (bodyStart === -1 || bodyEnd === -1) { throw new Error("getFunctionBody: No body found in function definition"); } return fnStr.slice(bodyStart + 1, bodyEnd).trim(); } exports.parseFunctionBody = parseFunctionBody; /***/ }), /***/ 46038: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); "use strict"; exports.ExtensionType = Extensions.ExtensionType; exports.extensions = Extensions.extensions; exports.normalizeExtensionPriority = Extensions.normalizeExtensionPriority; /***/ }), /***/ 46415: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function calculateProjection(pm, x, y, width, height, flipY) { var sign = flipY ? 1 : -1; pm.identity(); pm.a = 1 / width * 2; pm.d = sign * (1 / height * 2); pm.tx = -1 - x * pm.a; pm.ty = -sign - y * pm.d; return pm; } exports.calculateProjection = calculateProjection; /***/ }), /***/ 46484: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var vertexGPUTemplate = /* wgsl */"\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n \n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n \n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n"; var fragmentGPUTemplate = /* wgsl */"\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n \n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n \n {{start}}\n\n var outColor:vec4<f32>;\n \n {{main}}\n \n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n"; var vertexGlTemplate = /* glsl */"\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n \n {{start}}\n \n vColor = vec4(1.);\n \n {{main}}\n \n vUV = uv;\n \n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n"; var fragmentGlTemplate = /* glsl */"\n \n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n \n {{start}}\n\n vec4 outColor;\n \n {{main}}\n \n finalColor = outColor * vColor;\n \n {{end}}\n }\n"; exports.fragmentGPUTemplate = fragmentGPUTemplate; exports.fragmentGlTemplate = fragmentGlTemplate; exports.vertexGPUTemplate = vertexGPUTemplate; exports.vertexGlTemplate = vertexGlTemplate; /***/ }), /***/ 46492: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); var getSupportedCompressedTextureFormats = __webpack_require__(2081); var isWebGLSupported = __webpack_require__(67073); var isWebGPUSupported = __webpack_require__(50132); var resolveCompressedTextureUrl = __webpack_require__(73169); "use strict"; var compressedTextureExtensions; var detectCompressed = { extension: { type: Extensions.ExtensionType.DetectionParser, priority: 2 }, test: function () { var _test = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return isWebGPUSupported.isWebGPUSupported(); case 1: if (!_context.v) { _context.n = 2; break; } return _context.a(2, true); case 2: if (!isWebGLSupported.isWebGLSupported()) { _context.n = 3; break; } return _context.a(2, true); case 3: return _context.a(2, false); } }, _callee); })); function test() { return _test.apply(this, arguments); } return test; }(), add: function () { var _add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(formats) { var supportedCompressedTextureFormats; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: _context2.n = 1; return getSupportedCompressedTextureFormats.getSupportedCompressedTextureFormats(); case 1: supportedCompressedTextureFormats = _context2.v; compressedTextureExtensions = extractExtensionsForCompressedTextureFormats(supportedCompressedTextureFormats); return _context2.a(2, [].concat(_toConsumableArray(compressedTextureExtensions), _toConsumableArray(formats))); } }, _callee2); })); function add(_x) { return _add.apply(this, arguments); } return add; }(), remove: function () { var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(formats) { return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: if (!compressedTextureExtensions) { _context3.n = 1; break; } return _context3.a(2, formats.filter(function (f) { return !(f in compressedTextureExtensions); })); case 1: return _context3.a(2, formats); } }, _callee3); })); function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() }; function extractExtensionsForCompressedTextureFormats(formats) { var extensions = ["basis"]; var dupeMap = {}; formats.forEach(function (format) { var extension = format.split("-")[0]; if (extension && !dupeMap[extension]) { dupeMap[extension] = true; extensions.push(extension); } }); extensions.sort(function (a, b) { var aIndex = resolveCompressedTextureUrl.validFormats.indexOf(a); var bIndex = resolveCompressedTextureUrl.validFormats.indexOf(b); if (aIndex === -1) { return 1; } if (bIndex === -1) { return -1; } return aIndex - bIndex; }); return extensions; } exports.detectCompressed = detectCompressed; /***/ }), /***/ 46674: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var uniformParsers = __webpack_require__(23845); "use strict"; function createUboSyncFunction(uboElements, parserCode, arrayGenerationFunction, singleSettersMap) { var funcFragments = ["\n var v = null;\n var v2 = null;\n var t = 0;\n var index = 0;\n var name = null;\n var arrayOffset = null;\n "]; var prev = 0; for (var i = 0; i < uboElements.length; i++) { var uboElement = uboElements[i]; var name = uboElement.data.name; var parsed = false; var offset = 0; for (var j = 0; j < uniformParsers.uniformParsers.length; j++) { var uniformParser = uniformParsers.uniformParsers[j]; if (uniformParser.test(uboElement.data)) { offset = uboElement.offset / 4; funcFragments.push("name = \"".concat(name, "\";"), "offset += ".concat(offset - prev, ";"), uniformParsers.uniformParsers[j][parserCode] || uniformParsers.uniformParsers[j].ubo); parsed = true; break; } } if (!parsed) { if (uboElement.data.size > 1) { offset = uboElement.offset / 4; funcFragments.push(arrayGenerationFunction(uboElement, offset - prev)); } else { var template = singleSettersMap[uboElement.data.type]; offset = uboElement.offset / 4; funcFragments.push(/* wgsl */"\n v = uv.".concat(name, ";\n offset += ").concat(offset - prev, ";\n ").concat(template, ";\n ")); } } prev = offset; } var fragmentSrc = funcFragments.join("\n"); return new Function("uv", "data", "dataInt32", "offset", fragmentSrc); } exports.createUboSyncFunction = createUboSyncFunction; /***/ }), /***/ 46873: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } var GpuRenderTarget = /*#__PURE__*/_createClass(function GpuRenderTarget() { _classCallCheck(this, GpuRenderTarget); this.contexts = []; this.msaaTextures = []; this.msaaSamples = 1; }); exports.GpuRenderTarget = GpuRenderTarget; /***/ }), /***/ 46952: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var _const = __webpack_require__(33843); var _const$1 = __webpack_require__(43265); var GlBuffer = __webpack_require__(59061); "use strict"; var GlBufferSystem = /*#__PURE__*/function () { /** * @param {Renderer} renderer - The renderer this System works for. */ function GlBufferSystem(renderer) { _classCallCheck(this, GlBufferSystem); this._gpuBuffers = /* @__PURE__ */Object.create(null); /** Cache keeping track of the base bound buffer bases */ this._boundBufferBases = /* @__PURE__ */Object.create(null); this._minBaseLocation = 0; this._nextBindBaseIndex = this._minBaseLocation; this._bindCallId = 0; this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_gpuBuffers"); } /** * @ignore */ return _createClass(GlBufferSystem, [{ key: "destroy", value: function destroy() { this._renderer = null; this._gl = null; this._gpuBuffers = null; this._boundBufferBases = null; } /** Sets up the renderer context and necessary buffers. */ }, { key: "contextChange", value: function contextChange() { var gl = this._gl = this._renderer.gl; this._gpuBuffers = /* @__PURE__ */Object.create(null); this._maxBindings = gl.MAX_UNIFORM_BUFFER_BINDINGS ? gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS) : 0; } }, { key: "getGlBuffer", value: function getGlBuffer(buffer) { return this._gpuBuffers[buffer.uid] || this.createGLBuffer(buffer); } /** * This binds specified buffer. On first run, it will create the webGL buffers for the context too * @param buffer - the buffer to bind to the renderer */ }, { key: "bind", value: function bind(buffer) { var gl = this._gl; var glBuffer = this.getGlBuffer(buffer); gl.bindBuffer(glBuffer.type, glBuffer.buffer); } /** * Binds an uniform buffer to at the given index. * * A cache is used so a buffer will not be bound again if already bound. * @param glBuffer - the buffer to bind * @param index - the base index to bind it to. */ }, { key: "bindBufferBase", value: function bindBufferBase(glBuffer, index) { var gl = this._gl; if (this._boundBufferBases[index] !== glBuffer) { this._boundBufferBases[index] = glBuffer; glBuffer._lastBindBaseLocation = index; gl.bindBufferBase(gl.UNIFORM_BUFFER, index, glBuffer.buffer); } } }, { key: "nextBindBase", value: function nextBindBase(hasTransformFeedback) { this._bindCallId++; this._minBaseLocation = 0; if (hasTransformFeedback) { this._boundBufferBases[0] = null; this._minBaseLocation = 1; if (this._nextBindBaseIndex < 1) { this._nextBindBaseIndex = 1; } } } }, { key: "freeLocationForBufferBase", value: function freeLocationForBufferBase(glBuffer) { var freeIndex = this.getLastBindBaseLocation(glBuffer); if (freeIndex >= this._minBaseLocation) { glBuffer._lastBindCallId = this._bindCallId; return freeIndex; } var loop = 0; var nextIndex = this._nextBindBaseIndex; while (loop < 2) { if (nextIndex >= this._maxBindings) { nextIndex = this._minBaseLocation; loop++; } var curBuf = this._boundBufferBases[nextIndex]; if (curBuf && curBuf._lastBindCallId === this._bindCallId) { nextIndex++; continue; } break; } freeIndex = nextIndex; this._nextBindBaseIndex = nextIndex + 1; if (loop >= 2) { return -1; } glBuffer._lastBindCallId = this._bindCallId; this._boundBufferBases[freeIndex] = null; return freeIndex; } }, { key: "getLastBindBaseLocation", value: function getLastBindBaseLocation(glBuffer) { var index = glBuffer._lastBindBaseLocation; if (this._boundBufferBases[index] === glBuffer) { return index; } return -1; } /** * Binds a buffer whilst also binding its range. * This will make the buffer start from the offset supplied rather than 0 when it is read. * @param glBuffer - the buffer to bind * @param index - the base index to bind at, defaults to 0 * @param offset - the offset to bind at (this is blocks of 256). 0 = 0, 1 = 256, 2 = 512 etc * @param size - the size to bind at (this is blocks of 256). */ }, { key: "bindBufferRange", value: function bindBufferRange(glBuffer, index, offset, size) { var gl = this._gl; offset || (offset = 0); index || (index = 0); this._boundBufferBases[index] = null; gl.bindBufferRange(gl.UNIFORM_BUFFER, index || 0, glBuffer.buffer, offset * 256, size || 256); } /** * Will ensure the data in the buffer is uploaded to the GPU. * @param {Buffer} buffer - the buffer to update */ }, { key: "updateBuffer", value: function updateBuffer(buffer) { var gl = this._gl; var glBuffer = this.getGlBuffer(buffer); if (buffer._updateID === glBuffer.updateID) { return glBuffer; } glBuffer.updateID = buffer._updateID; gl.bindBuffer(glBuffer.type, glBuffer.buffer); var data = buffer.data; var drawType = buffer.descriptor.usage & _const.BufferUsage.STATIC ? gl.STATIC_DRAW : gl.DYNAMIC_DRAW; if (data) { if (glBuffer.byteLength >= data.byteLength) { gl.bufferSubData(glBuffer.type, 0, data, 0, buffer._updateSize / data.BYTES_PER_ELEMENT); } else { glBuffer.byteLength = data.byteLength; gl.bufferData(glBuffer.type, data, drawType); } } else { glBuffer.byteLength = buffer.descriptor.size; gl.bufferData(glBuffer.type, glBuffer.byteLength, drawType); } return glBuffer; } /** dispose all WebGL resources of all managed buffers */ }, { key: "destroyAll", value: function destroyAll() { var gl = this._gl; for (var id in this._gpuBuffers) { gl.deleteBuffer(this._gpuBuffers[id].buffer); } this._gpuBuffers = /* @__PURE__ */Object.create(null); } /** * Disposes buffer * @param {Buffer} buffer - buffer with data * @param {boolean} [contextLost=false] - If context was lost, we suppress deleteVertexArray */ }, { key: "onBufferDestroy", value: function onBufferDestroy(buffer, contextLost) { var glBuffer = this._gpuBuffers[buffer.uid]; var gl = this._gl; if (!contextLost) { gl.deleteBuffer(glBuffer.buffer); } this._gpuBuffers[buffer.uid] = null; } /** * creates and attaches a GLBuffer object tied to the current context. * @param buffer * @protected */ }, { key: "createGLBuffer", value: function createGLBuffer(buffer) { var gl = this._gl; var type = _const$1.BUFFER_TYPE.ARRAY_BUFFER; if (buffer.descriptor.usage & _const.BufferUsage.INDEX) { type = _const$1.BUFFER_TYPE.ELEMENT_ARRAY_BUFFER; } else if (buffer.descriptor.usage & _const.BufferUsage.UNIFORM) { type = _const$1.BUFFER_TYPE.UNIFORM_BUFFER; } var glBuffer = new GlBuffer.GlBuffer(gl.createBuffer(), type); this._gpuBuffers[buffer.uid] = glBuffer; buffer.on("destroy", this.onBufferDestroy, this); return glBuffer; } }, { key: "resetState", value: function resetState() { this._boundBufferBases = /* @__PURE__ */Object.create(null); } }]); }(); /** @ignore */ GlBufferSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "buffer" }; exports.GlBufferSystem = GlBufferSystem; /***/ }), /***/ 47054: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var _const = __webpack_require__(20105); var Ticker = __webpack_require__(6014); "use strict"; var TickerPlugin = /*#__PURE__*/function () { function TickerPlugin() { _classCallCheck(this, TickerPlugin); } return _createClass(TickerPlugin, null, [{ key: "init", value: /** * Initialize the plugin with scope of application instance * @static * @private * @param {object} [options] - See application options */ function init(options) { var _this = this; options = Object.assign({ autoStart: true, sharedTicker: false }, options); Object.defineProperty(this, "ticker", { set: function set(ticker) { if (this._ticker) { this._ticker.remove(this.render, this); } this._ticker = ticker; if (ticker) { ticker.add(this.render, this, _const.UPDATE_PRIORITY.LOW); } }, get: function get() { return this._ticker; } }); this.stop = function () { _this._ticker.stop(); }; this.start = function () { _this._ticker.start(); }; this._ticker = null; this.ticker = options.sharedTicker ? Ticker.Ticker.shared : new Ticker.Ticker(); if (options.autoStart) { this.start(); } } /** * Clean up the ticker, scoped to application. * @static * @private */ }, { key: "destroy", value: function destroy() { if (this._ticker) { var oldTicker = this._ticker; this.ticker = null; oldTicker.destroy(); } } }]); }(); /** @ignore */ TickerPlugin.extension = Extensions.ExtensionType.Application; exports.TickerPlugin = TickerPlugin; /***/ }), /***/ 47135: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var _const = __webpack_require__(15068); "use strict"; var GpuStencilSystem = /*#__PURE__*/function () { function GpuStencilSystem(renderer) { _classCallCheck(this, GpuStencilSystem); this._renderTargetStencilState = /* @__PURE__ */Object.create(null); this._renderer = renderer; renderer.renderTarget.onRenderTargetChange.add(this); } return _createClass(GpuStencilSystem, [{ key: "onRenderTargetChange", value: function onRenderTargetChange(renderTarget) { var stencilState = this._renderTargetStencilState[renderTarget.uid]; if (!stencilState) { stencilState = this._renderTargetStencilState[renderTarget.uid] = { stencilMode: _const.STENCIL_MODES.DISABLED, stencilReference: 0 }; } this._activeRenderTarget = renderTarget; this.setStencilMode(stencilState.stencilMode, stencilState.stencilReference); } }, { key: "setStencilMode", value: function setStencilMode(stencilMode, stencilReference) { var stencilState = this._renderTargetStencilState[this._activeRenderTarget.uid]; stencilState.stencilMode = stencilMode; stencilState.stencilReference = stencilReference; var renderer = this._renderer; renderer.pipeline.setStencilMode(stencilMode); renderer.encoder.renderPassEncoder.setStencilReference(stencilReference); } }, { key: "destroy", value: function destroy() { this._renderer.renderTarget.onRenderTargetChange.remove(this); this._renderer = null; this._activeRenderTarget = null; this._renderTargetStencilState = null; } }]); }(); /** @ignore */ GpuStencilSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "stencil" }; exports.GpuStencilSystem = GpuStencilSystem; /***/ }), /***/ 47266: /***/ ((__unused_webpack_module, exports) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } Object.defineProperty(exports, "__esModule", ({ value: !0 })); var r = { grad: .9, turn: 360, rad: 360 / (2 * Math.PI) }, t = function t(r) { return "string" == typeof r ? r.length > 0 : "number" == typeof r; }, n = function n(r, t, _n) { return void 0 === t && (t = 0), void 0 === _n && (_n = Math.pow(10, t)), Math.round(_n * r) / _n + 0; }, e = function e(r, t, n) { return void 0 === t && (t = 0), void 0 === n && (n = 1), r > n ? n : r > t ? r : t; }, u = function u(r) { return (r = isFinite(r) ? r % 360 : 0) > 0 ? r : r + 360; }, o = function o(r) { return { r: e(r.r, 0, 255), g: e(r.g, 0, 255), b: e(r.b, 0, 255), a: e(r.a) }; }, a = function a(r) { return { r: n(r.r), g: n(r.g), b: n(r.b), a: n(r.a, 3) }; }, s = /^#([0-9a-f]{3,8})$/i, i = function i(r) { var t = r.toString(16); return t.length < 2 ? "0" + t : t; }, h = function h(r) { var t = r.r, n = r.g, e = r.b, u = r.a, o = Math.max(t, n, e), a = o - Math.min(t, n, e), s = a ? o === t ? (n - e) / a : o === n ? 2 + (e - t) / a : 4 + (t - n) / a : 0; return { h: 60 * (s < 0 ? s + 6 : s), s: o ? a / o * 100 : 0, v: o / 255 * 100, a: u }; }, b = function b(r) { var t = r.h, n = r.s, e = r.v, u = r.a; t = t / 360 * 6, n /= 100, e /= 100; var o = Math.floor(t), a = e * (1 - n), s = e * (1 - (t - o) * n), i = e * (1 - (1 - t + o) * n), h = o % 6; return { r: 255 * [e, s, a, a, i, e][h], g: 255 * [i, e, e, s, a, a][h], b: 255 * [a, a, i, e, e, s][h], a: u }; }, d = function d(r) { return { h: u(r.h), s: e(r.s, 0, 100), l: e(r.l, 0, 100), a: e(r.a) }; }, g = function g(r) { return { h: n(r.h), s: n(r.s), l: n(r.l), a: n(r.a, 3) }; }, f = function f(r) { return b((n = (t = r).s, { h: t.h, s: (n *= ((e = t.l) < 50 ? e : 100 - e) / 100) > 0 ? 2 * n / (e + n) * 100 : 0, v: e + n, a: t.a })); // removed by dead control flow { var t, n, e; } }, p = function p(r) { return { h: (t = h(r)).h, s: (u = (200 - (n = t.s)) * (e = t.v) / 100) > 0 && u < 200 ? n * e / 100 / (u <= 100 ? u : 200 - u) * 100 : 0, l: u / 2, a: t.a }; // removed by dead control flow { var t, n, e, u; } }, l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, c = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, y = { string: [[function (r) { var t = s.exec(r); return t ? (r = t[1]).length <= 4 ? { r: parseInt(r[0] + r[0], 16), g: parseInt(r[1] + r[1], 16), b: parseInt(r[2] + r[2], 16), a: 4 === r.length ? n(parseInt(r[3] + r[3], 16) / 255, 2) : 1 } : 6 === r.length || 8 === r.length ? { r: parseInt(r.substr(0, 2), 16), g: parseInt(r.substr(2, 2), 16), b: parseInt(r.substr(4, 2), 16), a: 8 === r.length ? n(parseInt(r.substr(6, 2), 16) / 255, 2) : 1 } : null : null; }, "hex"], [function (r) { var t = v.exec(r) || m.exec(r); return t ? t[2] !== t[4] || t[4] !== t[6] ? null : o({ r: Number(t[1]) / (t[2] ? 100 / 255 : 1), g: Number(t[3]) / (t[4] ? 100 / 255 : 1), b: Number(t[5]) / (t[6] ? 100 / 255 : 1), a: void 0 === t[7] ? 1 : Number(t[7]) / (t[8] ? 100 : 1) }) : null; }, "rgb"], [function (t) { var n = l.exec(t) || c.exec(t); if (!n) return null; var e, u, o = d({ h: (e = n[1], u = n[2], void 0 === u && (u = "deg"), Number(e) * (r[u] || 1)), s: Number(n[3]), l: Number(n[4]), a: void 0 === n[5] ? 1 : Number(n[5]) / (n[6] ? 100 : 1) }); return f(o); }, "hsl"]], object: [[function (r) { var n = r.r, e = r.g, u = r.b, a = r.a, s = void 0 === a ? 1 : a; return t(n) && t(e) && t(u) ? o({ r: Number(n), g: Number(e), b: Number(u), a: Number(s) }) : null; }, "rgb"], [function (r) { var n = r.h, e = r.s, u = r.l, o = r.a, a = void 0 === o ? 1 : o; if (!t(n) || !t(e) || !t(u)) return null; var s = d({ h: Number(n), s: Number(e), l: Number(u), a: Number(a) }); return f(s); }, "hsl"], [function (r) { var n = r.h, o = r.s, a = r.v, s = r.a, i = void 0 === s ? 1 : s; if (!t(n) || !t(o) || !t(a)) return null; var h = function (r) { return { h: u(r.h), s: e(r.s, 0, 100), v: e(r.v, 0, 100), a: e(r.a) }; }({ h: Number(n), s: Number(o), v: Number(a), a: Number(i) }); return b(h); }, "hsv"]] }, N = function N(r, t) { for (var n = 0; n < t.length; n++) { var e = t[n][0](r); if (e) return [e, t[n][1]]; } return [null, void 0]; }, x = function x(r) { return "string" == typeof r ? N(r.trim(), y.string) : "object" == _typeof(r) && null !== r ? N(r, y.object) : [null, void 0]; }, M = function M(r, t) { var n = p(r); return { h: n.h, s: e(n.s + 100 * t, 0, 100), l: n.l, a: n.a }; }, I = function I(r) { return (299 * r.r + 587 * r.g + 114 * r.b) / 1e3 / 255; }, H = function H(r, t) { var n = p(r); return { h: n.h, s: n.s, l: e(n.l + 100 * t, 0, 100), a: n.a }; }, $ = function () { function r(r) { this.parsed = x(r)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; } return r.prototype.isValid = function () { return null !== this.parsed; }, r.prototype.brightness = function () { return n(I(this.rgba), 2); }, r.prototype.isDark = function () { return I(this.rgba) < .5; }, r.prototype.isLight = function () { return I(this.rgba) >= .5; }, r.prototype.toHex = function () { return r = a(this.rgba), t = r.r, e = r.g, u = r.b, s = (o = r.a) < 1 ? i(n(255 * o)) : "", "#" + i(t) + i(e) + i(u) + s; // removed by dead control flow { var r, t, e, u, o, s; } }, r.prototype.toRgb = function () { return a(this.rgba); }, r.prototype.toRgbString = function () { return r = a(this.rgba), t = r.r, n = r.g, e = r.b, (u = r.a) < 1 ? "rgba(" + t + ", " + n + ", " + e + ", " + u + ")" : "rgb(" + t + ", " + n + ", " + e + ")"; // removed by dead control flow { var r, t, n, e, u; } }, r.prototype.toHsl = function () { return g(p(this.rgba)); }, r.prototype.toHslString = function () { return r = g(p(this.rgba)), t = r.h, n = r.s, e = r.l, (u = r.a) < 1 ? "hsla(" + t + ", " + n + "%, " + e + "%, " + u + ")" : "hsl(" + t + ", " + n + "%, " + e + "%)"; // removed by dead control flow { var r, t, n, e, u; } }, r.prototype.toHsv = function () { return r = h(this.rgba), { h: n(r.h), s: n(r.s), v: n(r.v), a: n(r.a, 3) }; // removed by dead control flow { var r; } }, r.prototype.invert = function () { return j({ r: 255 - (r = this.rgba).r, g: 255 - r.g, b: 255 - r.b, a: r.a }); // removed by dead control flow { var r; } }, r.prototype.saturate = function (r) { return void 0 === r && (r = .1), j(M(this.rgba, r)); }, r.prototype.desaturate = function (r) { return void 0 === r && (r = .1), j(M(this.rgba, -r)); }, r.prototype.grayscale = function () { return j(M(this.rgba, -1)); }, r.prototype.lighten = function (r) { return void 0 === r && (r = .1), j(H(this.rgba, r)); }, r.prototype.darken = function (r) { return void 0 === r && (r = .1), j(H(this.rgba, -r)); }, r.prototype.rotate = function (r) { return void 0 === r && (r = 15), this.hue(this.hue() + r); }, r.prototype.alpha = function (r) { return "number" == typeof r ? j({ r: (t = this.rgba).r, g: t.g, b: t.b, a: r }) : n(this.rgba.a, 3); // removed by dead control flow { var t; } }, r.prototype.hue = function (r) { var t = p(this.rgba); return "number" == typeof r ? j({ h: r, s: t.s, l: t.l, a: t.a }) : n(t.h); }, r.prototype.isEqual = function (r) { return this.toHex() === j(r).toHex(); }, r; }(), j = function j(r) { return r instanceof $ ? r : new $(r); }, w = []; exports.Colord = $, exports.colord = j, exports.extend = function (r) { r.forEach(function (r) { w.indexOf(r) < 0 && (r($, y), w.push(r)); }); }, exports.getFormat = function (r) { return x(r)[1]; }, exports.random = function () { return new $({ r: 255 * Math.random(), g: 255 * Math.random(), b: 255 * Math.random() }); }; /***/ }), /***/ 47281: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var PoolGroup = __webpack_require__(47505); "use strict"; var MaskEffectManagerClass = /*#__PURE__*/function () { function MaskEffectManagerClass() { _classCallCheck(this, MaskEffectManagerClass); /** * @private */ this._effectClasses = []; this._tests = []; this._initialized = false; } return _createClass(MaskEffectManagerClass, [{ key: "init", value: function init() { var _this = this; if (this._initialized) return; this._initialized = true; this._effectClasses.forEach(function (test) { _this.add({ test: test.test, maskClass: test }); }); } }, { key: "add", value: function add(test) { this._tests.push(test); } }, { key: "getMaskEffect", value: function getMaskEffect(item) { if (!this._initialized) this.init(); for (var i = 0; i < this._tests.length; i++) { var test = this._tests[i]; if (test.test(item)) { return PoolGroup.BigPool.get(test.maskClass, item); } } return item; } }, { key: "returnMaskEffect", value: function returnMaskEffect(effect) { PoolGroup.BigPool["return"](effect); } }]); }(); var MaskEffectManager = new MaskEffectManagerClass(); Extensions.extensions.handleByList(Extensions.ExtensionType.MaskEffect, MaskEffectManager._effectClasses); exports.MaskEffectManager = MaskEffectManager; exports.MaskEffectManagerClass = MaskEffectManagerClass; /***/ }), /***/ 47447: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var DarkenBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function DarkenBlend() { _classCallCheck(this, DarkenBlend); return _callSuper(this, DarkenBlend, [{ gl: { functions: "\n vec3 blendDarken(vec3 base, vec3 blend, float opacity)\n {\n return (min(base, blend) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendDarken(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn blendDarken(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n return (min(blend,base) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendDarken(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(DarkenBlend, _BlendModeFilter$Blen); return _createClass(DarkenBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ DarkenBlend.extension = { name: "darken", type: Extensions.ExtensionType.BlendMode }; exports.DarkenBlend = DarkenBlend; /***/ }), /***/ 47465: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Matrix = __webpack_require__(20764); var compileHighShaderToProgram = __webpack_require__(97754); var localUniformBit = __webpack_require__(21654); var roundPixelsBit = __webpack_require__(35268); var Shader = __webpack_require__(27866); var UniformGroup = __webpack_require__(34400); var Texture = __webpack_require__(73782); var tilingBit = __webpack_require__(31054); "use strict"; var gpuProgram; var glProgram; var TilingSpriteShader = /*#__PURE__*/function (_Shader$Shader) { function TilingSpriteShader() { _classCallCheck(this, TilingSpriteShader); gpuProgram !== null && gpuProgram !== void 0 ? gpuProgram : gpuProgram = compileHighShaderToProgram.compileHighShaderGpuProgram({ name: "tiling-sprite-shader", bits: [localUniformBit.localUniformBit, tilingBit.tilingBit, roundPixelsBit.roundPixelsBit] }); glProgram !== null && glProgram !== void 0 ? glProgram : glProgram = compileHighShaderToProgram.compileHighShaderGlProgram({ name: "tiling-sprite-shader", bits: [localUniformBit.localUniformBitGl, tilingBit.tilingBitGl, roundPixelsBit.roundPixelsBitGl] }); var tilingUniforms = new UniformGroup.UniformGroup({ uMapCoord: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uClampFrame: { value: new Float32Array([0, 0, 1, 1]), type: "vec4<f32>" }, uClampOffset: { value: new Float32Array([0, 0]), type: "vec2<f32>" }, uTextureTransform: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uSizeAnchor: { value: new Float32Array([100, 100, 0.5, 0.5]), type: "vec4<f32>" } }); return _callSuper(this, TilingSpriteShader, [{ glProgram: glProgram, gpuProgram: gpuProgram, resources: { localUniforms: new UniformGroup.UniformGroup({ uTransformMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" }, uRound: { value: 0, type: "f32" } }), tilingUniforms: tilingUniforms, uTexture: Texture.Texture.EMPTY.source, uSampler: Texture.Texture.EMPTY.source.style } }]); } _inherits(TilingSpriteShader, _Shader$Shader); return _createClass(TilingSpriteShader, [{ key: "updateUniforms", value: function updateUniforms(width, height, matrix, anchorX, anchorY, texture) { var tilingUniforms = this.resources.tilingUniforms; var textureWidth = texture.width; var textureHeight = texture.height; var textureMatrix = texture.textureMatrix; var uTextureTransform = tilingUniforms.uniforms.uTextureTransform; uTextureTransform.set(matrix.a * textureWidth / width, matrix.b * textureWidth / height, matrix.c * textureHeight / width, matrix.d * textureHeight / height, matrix.tx / width, matrix.ty / height); uTextureTransform.invert(); tilingUniforms.uniforms.uMapCoord = textureMatrix.mapCoord; tilingUniforms.uniforms.uClampFrame = textureMatrix.uClampFrame; tilingUniforms.uniforms.uClampOffset = textureMatrix.uClampOffset; tilingUniforms.uniforms.uTextureTransform = uTextureTransform; tilingUniforms.uniforms.uSizeAnchor[0] = width; tilingUniforms.uniforms.uSizeAnchor[1] = height; tilingUniforms.uniforms.uSizeAnchor[2] = anchorX; tilingUniforms.uniforms.uSizeAnchor[3] = anchorY; if (texture) { this.resources.uTexture = texture.source; this.resources.uSampler = texture.source.style; } } }]); }(Shader.Shader); exports.TilingSpriteShader = TilingSpriteShader; /***/ }), /***/ 47493: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _Dom = __webpack_require__(15851); var _pixi = __webpack_require__(3635); function AssetManager() { this.images = {}; this.syncs = []; } AssetManager.prototype.loadImage = function (name, url) { var _this = this; if (this.images[name] && this.images[name].sync) { return this.images[name].sync; } this.images[name] = this.images[name] || {}; this.images[name].img = new Image(); this.images[name].img.src = url; this.images[name].sync = (0, _Dom.waitImageLoaded)(this.images[name].img).then(function () { return _this.images[name].img; }); this.syncs.push(this.images[name].sync); return this.images[name].sync; }; AssetManager.prototype.loadTexture = function (name, url) { var _this2 = this; if (this.images[name] && this.images[name].textureSync) { return this.images[name].sync; } this.images[name] = this.images[name] || {}; this.images[name].textureSync = this.loadImage(name, url).then(function () { return _pixi.Texture.from(_this2.images[name].img); }).then(function (texture) { _this2.images[name].texture = texture; return texture; }); this.syncs.push(this.images[name].textureSync); return this.images[name].textureSync; }; /** * * @param name * @returns {HTMLImageElement} */ AssetManager.prototype.getImage = function (name) { return this.images[name].img; }; /** * * @param name * @returns {Texture} */ AssetManager.prototype.getTexture = function (name) { return this.images[name].texture; }; AssetManager.prototype.ready = function () { return Promise.all(this.syncs); }; var _default = exports["default"] = AssetManager; /***/ }), /***/ 47505: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Pool = __webpack_require__(93068); "use strict"; var PoolGroupClass = /*#__PURE__*/function () { function PoolGroupClass() { _classCallCheck(this, PoolGroupClass); /** * A map to store the pools by their class type. * @private */ this._poolsByClass = /* @__PURE__ */new Map(); } /** * Prepopulates a specific pool with a given number of items. * @template T The type of items in the pool. Must extend PoolItem. * @param {PoolItemConstructor<T>} Class - The constructor of the items in the pool. * @param {number} total - The number of items to add to the pool. */ return _createClass(PoolGroupClass, [{ key: "prepopulate", value: function prepopulate(Class, total) { var classPool = this.getPool(Class); classPool.prepopulate(total); } /** * Gets an item from a specific pool. * @template T The type of items in the pool. Must extend PoolItem. * @param {PoolItemConstructor<T>} Class - The constructor of the items in the pool. * @param {unknown} [data] - Optional data to pass to the item's constructor. * @returns {T} The item from the pool. */ }, { key: "get", value: function get(Class, data) { var pool = this.getPool(Class); return pool.get(data); } /** * Returns an item to its respective pool. * @param {PoolItem} item - The item to return to the pool. */ }, { key: "return", value: function _return(item) { var pool = this.getPool(item.constructor); pool["return"](item); } /** * Gets a specific pool based on the class type. * @template T The type of items in the pool. Must extend PoolItem. * @param {PoolItemConstructor<T>} ClassType - The constructor of the items in the pool. * @returns {Pool<T>} The pool of the given class type. */ }, { key: "getPool", value: function getPool(ClassType) { if (!this._poolsByClass.has(ClassType)) { this._poolsByClass.set(ClassType, new Pool.Pool(ClassType)); } return this._poolsByClass.get(ClassType); } /** gets the usage stats of each pool in the system */ }, { key: "stats", value: function stats() { var stats = {}; this._poolsByClass.forEach(function (pool) { var name = stats[pool._classType.name] ? pool._classType.name + pool._classType.ID : pool._classType.name; stats[name] = { free: pool.totalFree, used: pool.totalUsed, size: pool.totalSize }; }); return stats; } }]); }(); var BigPool = new PoolGroupClass(); exports.BigPool = BigPool; exports.PoolGroupClass = PoolGroupClass; /***/ }), /***/ 47719: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var Color = __webpack_require__(98828); var cullingMixin = __webpack_require__(47827); var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var _const = __webpack_require__(83987); var ObservablePoint = __webpack_require__(14823); var uid = __webpack_require__(90844); var deprecation = __webpack_require__(11225); var PoolGroup = __webpack_require__(47505); var cacheAsTextureMixin = __webpack_require__(21963); var childrenHelperMixin = __webpack_require__(95033); var collectRenderablesMixin = __webpack_require__(3281); var effectsMixin = __webpack_require__(31594); var findMixin = __webpack_require__(24937); var getFastGlobalBoundsMixin = __webpack_require__(86512); var getGlobalMixin = __webpack_require__(62461); var measureMixin = __webpack_require__(44840); var onRenderMixin = __webpack_require__(75327); var sortMixin = __webpack_require__(39244); var toLocalGlobalMixin = __webpack_require__(64373); var RenderGroup = __webpack_require__(17019); var assignWithIgnore = __webpack_require__(69095); "use strict"; var defaultSkew = new ObservablePoint.ObservablePoint(null); var defaultPivot = new ObservablePoint.ObservablePoint(null); var defaultScale = new ObservablePoint.ObservablePoint(null, 1, 1); var UPDATE_COLOR = 1; var UPDATE_BLEND = 2; var UPDATE_VISIBLE = 4; var UPDATE_TRANSFORM = 8; var Container = /*#__PURE__*/function (_EventEmitter) { function Container() { var _options$children, _options$parent; var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, Container); _this = _callSuper(this, Container); /** unique id for this container */ _this.uid = uid.uid("renderable"); /** @private */ _this._updateFlags = 15; // the render group this container owns /** @private */ _this.renderGroup = null; // the render group this container belongs to /** @private */ _this.parentRenderGroup = null; // the index of the container in the render group /** @private */ _this.parentRenderGroupIndex = 0; // set to true if the container has changed. It is reset once the changes have been applied // by the transform system // its here to stop ensure that when things change, only one update gets registers with the transform system /** @private */ _this.didChange = false; // same as above, but for the renderable /** @private */ _this.didViewUpdate = false; // how deep is the container relative to its render group.. // unless the element is the root render group - it will be relative to its parent /** @private */ _this.relativeRenderGroupDepth = 0; /** * The array of children of this container. * @readonly */ _this.children = []; /** The display object container that contains this display object. */ _this.parent = null; // used internally for changing up the render order.. mainly for masks and filters // TODO setting this should cause a rebuild?? /** @private */ _this.includeInBuild = true; /** @private */ _this.measurable = true; /** @private */ _this.isSimple = true; // / /////////////Transform related props////////////// // used by the transform system to check if a container needs to be updated that frame // if the tick matches the current transform system tick, it is not updated again /** * @internal * @ignore */ _this.updateTick = -1; /** * Current transform of the object based on local factors: position, scale, other stuff. * @readonly */ _this.localTransform = new Matrix.Matrix(); /** * The relative group transform is a transform relative to the render group it belongs too. It will include all parent * transforms and up to the render group (think of it as kind of like a stage - but the stage can be nested). * If this container is is self a render group matrix will be relative to its parent render group * @readonly */ _this.relativeGroupTransform = new Matrix.Matrix(); /** * The group transform is a transform relative to the render group it belongs too. * If this container is render group then this will be an identity matrix. other wise it * will be the same as the relativeGroupTransform. * Use this value when actually rendering things to the screen * @readonly */ _this.groupTransform = _this.relativeGroupTransform; /** If the object has been destroyed via destroy(). If true, it should not be used. */ _this.destroyed = false; // transform data.. /** * The coordinate of the object relative to the local coordinates of the parent. * @internal * @ignore */ _this._position = new ObservablePoint.ObservablePoint(_this, 0, 0); /** * The scale factor of the object. * @internal * @ignore */ _this._scale = defaultScale; /** * The pivot point of the container that it rotates around. * @internal * @ignore */ _this._pivot = defaultPivot; /** * The skew amount, on the x and y axis. * @internal * @ignore */ _this._skew = defaultSkew; /** * The X-coordinate value of the normalized local X axis, * the first column of the local transformation matrix without a scale. * @internal * @ignore */ _this._cx = 1; /** * The Y-coordinate value of the normalized local X axis, * the first column of the local transformation matrix without a scale. * @internal * @ignore */ _this._sx = 0; /** * The X-coordinate value of the normalized local Y axis, * the second column of the local transformation matrix without a scale. * @internal * @ignore */ _this._cy = 0; /** * The Y-coordinate value of the normalized local Y axis, * the second column of the local transformation matrix without a scale. * @internal * @ignore */ _this._sy = 1; /** * The rotation amount. * @internal * @ignore */ _this._rotation = 0; // / COLOR related props ////////////// // color stored as ABGR _this.localColor = 16777215; _this.localAlpha = 1; _this.groupAlpha = 1; // A _this.groupColor = 16777215; // BGR _this.groupColorAlpha = 4294967295; // ABGR // / BLEND related props ////////////// /** * @internal * @ignore */ _this.localBlendMode = "inherit"; /** * @internal * @ignore */ _this.groupBlendMode = "normal"; // / VISIBILITY related props ////////////// // visibility // 0b11 // first bit is visible, second bit is renderable /** * This property holds three bits: culled, visible, renderable * the third bit represents culling (0 = culled, 1 = not culled) 0b100 * the second bit represents visibility (0 = not visible, 1 = visible) 0b010 * the first bit represents renderable (0 = not renderable, 1 = renderable) 0b001 * @internal * @ignore */ _this.localDisplayStatus = 7; // 0b11 | 0b10 | 0b01 | 0b00 /** * @internal * @ignore */ _this.globalDisplayStatus = 7; /** * A value that increments each time the containe is modified * eg children added, removed etc * @ignore */ _this._didContainerChangeTick = 0; /** * A value that increments each time the container view is modified * eg texture swap, geometry change etc * @ignore */ _this._didViewChangeTick = 0; /** * property that tracks if the container transform has changed * @ignore */ _this._didLocalTransformChangeId = -1; _this.effects = []; assignWithIgnore.assignWithIgnore(_this, options, { children: true, parent: true, effects: true }); (_options$children = options.children) === null || _options$children === void 0 || _options$children.forEach(function (child) { return _this.addChild(child); }); (_options$parent = options.parent) === null || _options$parent === void 0 || _options$parent.addChild(_this); return _this; } /** * Mixes all enumerable properties and methods from a source object to Container. * @param source - The source of properties and methods to mix in. * @deprecated since 8.8.0 */ _inherits(Container, _EventEmitter); return _createClass(Container, [{ key: "_didChangeId", get: function get() { return this._didContainerChangeTick & 4095 | (this._didViewChangeTick & 4095) << 12; } /** * Adds one or more children to the container. * * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` * @param {...Container} children - The Container(s) to add to the container * @returns {Container} - The first child that was added. */, set: // = 'default'; /** * We now use the _didContainerChangeTick and _didViewChangeTick to track changes * @deprecated since 8.2.6 * @ignore */ function set(value) { this._didViewChangeTick = value >> 12 & 4095; this._didContainerChangeTick = value & 4095; } }, { key: "addChild", value: function addChild() { if (!this.allowChildren) { deprecation.deprecation(deprecation.v8_0_0, "addChild: Only Containers will be allowed to add children in v8.0.0"); } if (arguments.length > 1) { for (var i = 0; i < arguments.length; i++) { this.addChild(i < 0 || arguments.length <= i ? undefined : arguments[i]); } return arguments.length <= 0 ? undefined : arguments[0]; } var child = arguments.length <= 0 ? undefined : arguments[0]; var renderGroup = this.renderGroup || this.parentRenderGroup; if (child.parent === this) { this.children.splice(this.children.indexOf(child), 1); this.children.push(child); if (renderGroup) { renderGroup.structureDidChange = true; } return child; } if (child.parent) { child.parent.removeChild(child); } this.children.push(child); if (this.sortableChildren) this.sortDirty = true; child.parent = this; child.didChange = true; child._updateFlags = 15; if (renderGroup) { renderGroup.addChild(child); } this.emit("childAdded", child, this, this.children.length - 1); child.emit("added", this); this._didViewChangeTick++; if (child._zIndex !== 0) { child.depthOfChildModified(); } return child; } /** * Removes one or more children from the container. * @param {...Container} children - The Container(s) to remove * @returns {Container} The first child that was removed. */ }, { key: "removeChild", value: function removeChild() { if (arguments.length > 1) { for (var i = 0; i < arguments.length; i++) { this.removeChild(i < 0 || arguments.length <= i ? undefined : arguments[i]); } return arguments.length <= 0 ? undefined : arguments[0]; } var child = arguments.length <= 0 ? undefined : arguments[0]; var index = this.children.indexOf(child); if (index > -1) { this._didViewChangeTick++; this.children.splice(index, 1); if (this.renderGroup) { this.renderGroup.removeChild(child); } else if (this.parentRenderGroup) { this.parentRenderGroup.removeChild(child); } if (child.parentRenderLayer) { child.parentRenderLayer.detach(child); } child.parent = null; this.emit("childRemoved", child, this, index); child.emit("removed", this); } return child; } /** @ignore */ }, { key: "_onUpdate", value: function _onUpdate(point) { if (point) { if (point === this._skew) { this._updateSkew(); } } this._didContainerChangeTick++; if (this.didChange) return; this.didChange = true; if (this.parentRenderGroup) { this.parentRenderGroup.onChildUpdate(this); } } }, { key: "isRenderGroup", get: /** * Returns true if this container is a render group. * This means that it will be rendered as a separate pass, with its own set of instructions */ function get() { return !!this.renderGroup; } /** * Calling this enables a render group for this container. * This means it will be rendered as a separate set of instructions. * The transform of the container will also be handled on the GPU rather than the CPU. */, set: function set(value) { if (!!this.renderGroup === value) return; if (value) { this.enableRenderGroup(); } else { this.disableRenderGroup(); } } }, { key: "enableRenderGroup", value: function enableRenderGroup() { if (this.renderGroup) return; var parentRenderGroup = this.parentRenderGroup; parentRenderGroup === null || parentRenderGroup === void 0 || parentRenderGroup.removeChild(this); this.renderGroup = PoolGroup.BigPool.get(RenderGroup.RenderGroup, this); this.groupTransform = Matrix.Matrix.IDENTITY; parentRenderGroup === null || parentRenderGroup === void 0 || parentRenderGroup.addChild(this); this._updateIsSimple(); } /** This will disable the render group for this container. */ }, { key: "disableRenderGroup", value: function disableRenderGroup() { if (!this.renderGroup) return; var parentRenderGroup = this.parentRenderGroup; parentRenderGroup === null || parentRenderGroup === void 0 || parentRenderGroup.removeChild(this); PoolGroup.BigPool["return"](this.renderGroup); this.renderGroup = null; this.groupTransform = this.relativeGroupTransform; parentRenderGroup === null || parentRenderGroup === void 0 || parentRenderGroup.addChild(this); this._updateIsSimple(); } /** @ignore */ }, { key: "_updateIsSimple", value: function _updateIsSimple() { this.isSimple = !this.renderGroup && this.effects.length === 0; } /** * Current transform of the object based on world (parent) factors. * @readonly */ }, { key: "worldTransform", get: function get() { this._worldTransform || (this._worldTransform = new Matrix.Matrix()); if (this.renderGroup) { this._worldTransform.copyFrom(this.renderGroup.worldTransform); } else if (this.parentRenderGroup) { this._worldTransform.appendFrom(this.relativeGroupTransform, this.parentRenderGroup.worldTransform); } return this._worldTransform; } /** * The position of the container on the x axis relative to the local coordinates of the parent. * An alias to position.x */ }, { key: "x", get: function get() { return this._position.x; }, set: function set(value) { this._position.x = value; } /** * The position of the container on the y axis relative to the local coordinates of the parent. * An alias to position.y */ }, { key: "y", get: function get() { return this._position.y; }, set: function set(value) { this._position.y = value; } /** * The coordinate of the object relative to the local coordinates of the parent. * @since 4.0.0 */ }, { key: "position", get: function get() { return this._position; }, set: function set(value) { this._position.copyFrom(value); } /** * The rotation of the object in radians. * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. */ }, { key: "rotation", get: function get() { return this._rotation; }, set: function set(value) { if (this._rotation !== value) { this._rotation = value; this._onUpdate(this._skew); } } /** * The angle of the object in degrees. * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. */ }, { key: "angle", get: function get() { return this.rotation * _const.RAD_TO_DEG; }, set: function set(value) { this.rotation = value * _const.DEG_TO_RAD; } /** * The center of rotation, scaling, and skewing for this display object in its local space. The `position` * is the projection of `pivot` in the parent's local space. * * By default, the pivot is the origin (0, 0). * @since 4.0.0 */ }, { key: "pivot", get: function get() { if (this._pivot === defaultPivot) { this._pivot = new ObservablePoint.ObservablePoint(this, 0, 0); } return this._pivot; }, set: function set(value) { if (this._pivot === defaultPivot) { this._pivot = new ObservablePoint.ObservablePoint(this, 0, 0); } typeof value === "number" ? this._pivot.set(value) : this._pivot.copyFrom(value); } /** * The skew factor for the object in radians. * @since 4.0.0 */ }, { key: "skew", get: function get() { if (this._skew === defaultSkew) { this._skew = new ObservablePoint.ObservablePoint(this, 0, 0); } return this._skew; }, set: function set(value) { if (this._skew === defaultSkew) { this._skew = new ObservablePoint.ObservablePoint(this, 0, 0); } this._skew.copyFrom(value); } /** * The scale factors of this object along the local coordinate axes. * * The default scale is (1, 1). * @since 4.0.0 */ }, { key: "scale", get: function get() { if (this._scale === defaultScale) { this._scale = new ObservablePoint.ObservablePoint(this, 1, 1); } return this._scale; }, set: function set(value) { if (this._scale === defaultScale) { this._scale = new ObservablePoint.ObservablePoint(this, 0, 0); } typeof value === "number" ? this._scale.set(value) : this._scale.copyFrom(value); } /** * The width of the Container, setting this will actually modify the scale to achieve the value set. * @memberof scene.Container# */ }, { key: "width", get: function get() { return Math.abs(this.scale.x * this.getLocalBounds().width); }, set: function set(value) { var localWidth = this.getLocalBounds().width; this._setWidth(value, localWidth); } /** * The height of the Container, setting this will actually modify the scale to achieve the value set. * @memberof scene.Container# */ }, { key: "height", get: function get() { return Math.abs(this.scale.y * this.getLocalBounds().height); }, set: function set(value) { var localHeight = this.getLocalBounds().height; this._setHeight(value, localHeight); } /** * Retrieves the size of the container as a [Size]{@link Size} object. * This is faster than get the width and height separately. * @param out - Optional object to store the size in. * @returns - The size of the container. * @memberof scene.Container# */ }, { key: "getSize", value: function getSize(out) { if (!out) { out = {}; } var bounds = this.getLocalBounds(); out.width = Math.abs(this.scale.x * bounds.width); out.height = Math.abs(this.scale.y * bounds.height); return out; } /** * Sets the size of the container to the specified width and height. * This is faster than setting the width and height separately. * @param value - This can be either a number or a [Size]{@link Size} object. * @param height - The height to set. Defaults to the value of `width` if not provided. * @memberof scene.Container# */ }, { key: "setSize", value: function setSize(value, height) { var size = this.getLocalBounds(); if (_typeof(value) === "object") { var _value$height; height = (_value$height = value.height) !== null && _value$height !== void 0 ? _value$height : value.width; value = value.width; } else { height !== null && height !== void 0 ? height : height = value; } value !== void 0 && this._setWidth(value, size.width); height !== void 0 && this._setHeight(height, size.height); } /** Called when the skew or the rotation changes. */ }, { key: "_updateSkew", value: function _updateSkew() { var rotation = this._rotation; var skew = this._skew; this._cx = Math.cos(rotation + skew._y); this._sx = Math.sin(rotation + skew._y); this._cy = -Math.sin(rotation - skew._x); this._sy = Math.cos(rotation - skew._x); } /** * Updates the transform properties of the container (accepts partial values). * @param {object} opts - The options for updating the transform. * @param {number} opts.x - The x position of the container. * @param {number} opts.y - The y position of the container. * @param {number} opts.scaleX - The scale factor on the x-axis. * @param {number} opts.scaleY - The scale factor on the y-axis. * @param {number} opts.rotation - The rotation of the container, in radians. * @param {number} opts.skewX - The skew factor on the x-axis. * @param {number} opts.skewY - The skew factor on the y-axis. * @param {number} opts.pivotX - The x coordinate of the pivot point. * @param {number} opts.pivotY - The y coordinate of the pivot point. */ }, { key: "updateTransform", value: function updateTransform(opts) { this.position.set(typeof opts.x === "number" ? opts.x : this.position.x, typeof opts.y === "number" ? opts.y : this.position.y); this.scale.set(typeof opts.scaleX === "number" ? opts.scaleX || 1 : this.scale.x, typeof opts.scaleY === "number" ? opts.scaleY || 1 : this.scale.y); this.rotation = typeof opts.rotation === "number" ? opts.rotation : this.rotation; this.skew.set(typeof opts.skewX === "number" ? opts.skewX : this.skew.x, typeof opts.skewY === "number" ? opts.skewY : this.skew.y); this.pivot.set(typeof opts.pivotX === "number" ? opts.pivotX : this.pivot.x, typeof opts.pivotY === "number" ? opts.pivotY : this.pivot.y); return this; } /** * Updates the local transform using the given matrix. * @param matrix - The matrix to use for updating the transform. */ }, { key: "setFromMatrix", value: function setFromMatrix(matrix) { matrix.decompose(this); } /** Updates the local transform. */ }, { key: "updateLocalTransform", value: function updateLocalTransform() { var localTransformChangeId = this._didContainerChangeTick; if (this._didLocalTransformChangeId === localTransformChangeId) return; this._didLocalTransformChangeId = localTransformChangeId; var lt = this.localTransform; var scale = this._scale; var pivot = this._pivot; var position = this._position; var sx = scale._x; var sy = scale._y; var px = pivot._x; var py = pivot._y; lt.a = this._cx * sx; lt.b = this._sx * sx; lt.c = this._cy * sy; lt.d = this._sy * sy; lt.tx = position._x - (px * lt.a + py * lt.c); lt.ty = position._y - (px * lt.b + py * lt.d); } // / ///// color related stuff }, { key: "alpha", get: /** The opacity of the object. */ function get() { return this.localAlpha; }, set: function set(value) { if (value === this.localAlpha) return; this.localAlpha = value; this._updateFlags |= UPDATE_COLOR; this._onUpdate(); } }, { key: "tint", get: /** * The tint applied to the sprite. This is a hex value. * * A value of 0xFFFFFF will remove any tint effect. * @default 0xFFFFFF */ function get() { return getGlobalMixin.bgr2rgb(this.localColor); } // / //////////////// blend related stuff , set: function set(value) { var tempColor = Color.Color.shared.setValue(value !== null && value !== void 0 ? value : 16777215); var bgr = tempColor.toBgrNumber(); if (bgr === this.localColor) return; this.localColor = bgr; this._updateFlags |= UPDATE_COLOR; this._onUpdate(); } }, { key: "blendMode", get: /** * The blend mode to be applied to the sprite. Apply a value of `'normal'` to reset the blend mode. * @default 'normal' */ function get() { return this.localBlendMode; } // / ///////// VISIBILITY / RENDERABLE ///////////////// /** The visibility of the object. If false the object will not be drawn, and the transform will not be updated. */, set: function set(value) { if (this.localBlendMode === value) return; if (this.parentRenderGroup) { this.parentRenderGroup.structureDidChange = true; } this._updateFlags |= UPDATE_BLEND; this.localBlendMode = value; this._onUpdate(); } }, { key: "visible", get: function get() { return !!(this.localDisplayStatus & 2); }, set: function set(value) { var valueNumber = value ? 2 : 0; if ((this.localDisplayStatus & 2) === valueNumber) return; if (this.parentRenderGroup) { this.parentRenderGroup.structureDidChange = true; } this._updateFlags |= UPDATE_VISIBLE; this.localDisplayStatus ^= 2; this._onUpdate(); } /** @ignore */ }, { key: "culled", get: function get() { return !(this.localDisplayStatus & 4); } /** @ignore */, set: function set(value) { var valueNumber = value ? 0 : 4; if ((this.localDisplayStatus & 4) === valueNumber) return; if (this.parentRenderGroup) { this.parentRenderGroup.structureDidChange = true; } this._updateFlags |= UPDATE_VISIBLE; this.localDisplayStatus ^= 4; this._onUpdate(); } /** Can this object be rendered, if false the object will not be drawn but the transform will still be updated. */ }, { key: "renderable", get: function get() { return !!(this.localDisplayStatus & 1); }, set: function set(value) { var valueNumber = value ? 1 : 0; if ((this.localDisplayStatus & 1) === valueNumber) return; this._updateFlags |= UPDATE_VISIBLE; this.localDisplayStatus ^= 1; if (this.parentRenderGroup) { this.parentRenderGroup.structureDidChange = true; } this._onUpdate(); } /** Whether or not the object should be rendered. */ }, { key: "isRenderable", get: function get() { return this.localDisplayStatus === 7 && this.groupAlpha > 0; } /** * Removes all internal references and listeners as well as removes children from the display list. * Do not use a Container after calling `destroy`. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy * method called as well. 'options' will be passed on to those calls. * @param {boolean} [options.texture=false] - Only used for children with textures e.g. Sprites. If options.children * is set to true it should destroy the texture of the child sprite * @param {boolean} [options.textureSource=false] - Only used for children with textures e.g. Sprites. * If options.children is set to true it should destroy the texture source of the child sprite * @param {boolean} [options.context=false] - Only used for children with graphicsContexts e.g. Graphics. * If options.children is set to true it should destroy the context of the child graphics */ }, { key: "destroy", value: function destroy() { var _this$renderGroup; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (this.destroyed) return; this.destroyed = true; var oldChildren; if (this.children.length) { oldChildren = this.removeChildren(0, this.children.length); } this.removeFromParent(); this.parent = null; this._maskEffect = null; this._filterEffect = null; this.effects = null; this._position = null; this._scale = null; this._pivot = null; this._skew = null; this.emit("destroyed", this); this.removeAllListeners(); var destroyChildren = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.children; if (destroyChildren && oldChildren) { for (var i = 0; i < oldChildren.length; ++i) { oldChildren[i].destroy(options); } } (_this$renderGroup = this.renderGroup) === null || _this$renderGroup === void 0 || _this$renderGroup.destroy(); this.renderGroup = null; } }], [{ key: "mixin", value: function mixin(source) { deprecation.deprecation("8.8.0", "Container.mixin is deprecated, please use extensions.mixin instead."); Extensions.extensions.mixin(Container, source); } }]); }(EventEmitter); Extensions.extensions.mixin(Container, childrenHelperMixin.childrenHelperMixin, getFastGlobalBoundsMixin.getFastGlobalBoundsMixin, toLocalGlobalMixin.toLocalGlobalMixin, onRenderMixin.onRenderMixin, measureMixin.measureMixin, effectsMixin.effectsMixin, findMixin.findMixin, sortMixin.sortMixin, cullingMixin.cullingMixin, cacheAsTextureMixin.cacheAsTextureMixin, getGlobalMixin.getGlobalMixin, collectRenderablesMixin.collectRenderablesMixin); exports.Container = Container; exports.UPDATE_BLEND = UPDATE_BLEND; exports.UPDATE_COLOR = UPDATE_COLOR; exports.UPDATE_TRANSFORM = UPDATE_TRANSFORM; exports.UPDATE_VISIBLE = UPDATE_VISIBLE; /***/ }), /***/ 47827: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var cullingMixin = { cullArea: null, cullable: false, cullableChildren: true }; exports.cullingMixin = cullingMixin; /***/ }), /***/ 48084: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var HTMLTextPipe = __webpack_require__(39148); var HTMLTextSystem = __webpack_require__(77693); "use strict"; Extensions.extensions.add(HTMLTextSystem.HTMLTextSystem); Extensions.extensions.add(HTMLTextPipe.HTMLTextPipe); /***/ }), /***/ 48444: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); "use strict"; var environments = []; Extensions.extensions.handleByNamedList(Extensions.ExtensionType.Environment, environments); function loadEnvironmentExtensions(_x) { return _loadEnvironmentExtensions.apply(this, arguments); } function _loadEnvironmentExtensions() { _loadEnvironmentExtensions = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(skip) { var i, env; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!skip) { _context.n = 1; break; } return _context.a(2); case 1: i = 0; case 2: if (!(i < environments.length)) { _context.n = 5; break; } env = environments[i]; if (!env.value.test()) { _context.n = 4; break; } _context.n = 3; return env.value.load(); case 3: return _context.a(2); case 4: i++; _context.n = 2; break; case 5: return _context.a(2); } }, _callee); })); return _loadEnvironmentExtensions.apply(this, arguments); } function autoDetectEnvironment(_x2) { return _autoDetectEnvironment.apply(this, arguments); } function _autoDetectEnvironment() { _autoDetectEnvironment = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(add) { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: return _context2.a(2, loadEnvironmentExtensions(!add)); } }, _callee2); })); return _autoDetectEnvironment.apply(this, arguments); } exports.autoDetectEnvironment = autoDetectEnvironment; exports.loadEnvironmentExtensions = loadEnvironmentExtensions; /***/ }), /***/ 48629: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function definedProps(obj) { var result = {}; for (var key in obj) { if (obj[key] !== void 0) { result[key] = obj[key]; } } return result; } exports.definedProps = definedProps; /***/ }), /***/ 48811: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var NegationBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function NegationBlend() { _classCallCheck(this, NegationBlend); return _callSuper(this, NegationBlend, [{ gl: { functions: "\n vec3 negation(vec3 base, vec3 blend)\n {\n return 1.0-abs(1.0-base-blend);\n }\n\n vec3 blendNegation(vec3 base, vec3 blend, float opacity)\n {\n return (negation(base, blend) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendNegation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn blendNegation(base: vec3<f32>, blend: vec3<f32>) -> vec3<f32>\n {\n return 1.0-abs(1.0-base-blend);\n }\n\n fn blendNegationOpacity(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>\n {\n return (blendNegation(base, blend) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendNegationOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(NegationBlend, _BlendModeFilter$Blen); return _createClass(NegationBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ NegationBlend.extension = { name: "negation", type: Extensions.ExtensionType.BlendMode }; exports.NegationBlend = NegationBlend; /***/ }), /***/ 48973: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _EnemyObjects = __webpack_require__(97779); /** * * @param scene * @constructor */ function WavesController(scene) { this.scene = scene; this.cmdIdx = 0; this.delay = 0; this.$waveIdx = this.scene.$waveIdx; this.$totalWave = this.scene.$totalWave; this.runningCmd; this.waveIdx = 1; this.totalWave = this.scene.waveCmd.filter(function (x) { return x === 'end'; }).length; } WavesController.prototype.update = function (deltaTime) { this.delay = this.delay - deltaTime / 1000; if (this.runningCmd === 'end') { if (Object.keys(this.scene.enemies).length === 0) { this.delay = 0; this.waveIdx = Math.min(this.totalWave, this.waveIdx + 1); } } if (this.delay > 0) return; if (this.cmdIdx >= this.scene.waveCmd.length) { if (Object.keys(this.scene.enemies).length === 0) { if (this.scene.protectedTarget.hp > 0) this.scene.success();else this.scene.fail(); } return; } this.delay = 0; var cmd = this.scene.waveCmd[this.cmdIdx]; this.runningCmd = cmd; this.cmdIdx++; if (typeof cmd === "number") { this.delay = cmd; } else if (typeof cmd === "function") { if (cmd.prototype.type === 'enemy') { new cmd(this.scene); } } else { this.delay = 1e9; } }; Object.defineProperty(WavesController.prototype, 'waveIdx', { set: function set(value) { this._waveIdx = value || 0; if (this._waveIdx < 10) { this.$waveIdx.firstChild.data = '0' + value; } else { this.$waveIdx.firstChild.data = '' + value; } }, get: function get() { return this._waveIdx || 0; } }); Object.defineProperty(WavesController.prototype, 'totalWave', { set: function set(value) { this._totalWave = value || 0; if (this._totalWave < 10) { this.$totalWave.firstChild.data = '/0' + value; } else { this.$totalWave.firstChild.data = '/' + value; } }, get: function get() { return this._totalWave || 0; } }); var _default = exports["default"] = WavesController; /***/ }), /***/ 49326: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var TextureSource = __webpack_require__(55406); "use strict"; var CompressedSource = /*#__PURE__*/function (_TextureSource$Textur) { function CompressedSource(options) { var _this; _classCallCheck(this, CompressedSource); _this = _callSuper(this, CompressedSource, [options]); _this.uploadMethodId = "compressed"; _this.resource = options.resource; _this.mipLevelCount = _this.resource.length; return _this; } _inherits(CompressedSource, _TextureSource$Textur); return _createClass(CompressedSource); }(TextureSource.TextureSource); exports.CompressedSource = CompressedSource; /***/ }), /***/ 49556: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var EventBoundary = __webpack_require__(61435); var EventTicker = __webpack_require__(21623); var FederatedPointerEvent = __webpack_require__(58122); var FederatedWheelEvent = __webpack_require__(69288); "use strict"; var MOUSE_POINTER_ID = 1; var TOUCH_TO_POINTER = { touchstart: "pointerdown", touchend: "pointerup", touchendoutside: "pointerupoutside", touchmove: "pointermove", touchcancel: "pointercancel" }; var _EventSystem = /*#__PURE__*/function () { /** * @param {Renderer} renderer */ function _EventSystem(renderer) { var _this = this; _classCallCheck(this, _EventSystem); /** Does the device support touch events https://www.w3.org/TR/touch-events/ */ this.supportsTouchEvents = "ontouchstart" in globalThis; /** Does the device support pointer events https://www.w3.org/Submission/pointer-events/ */ this.supportsPointerEvents = !!globalThis.PointerEvent; /** * The DOM element to which the root event listeners are bound. This is automatically set to * the renderer's {@link Renderer#view view}. */ this.domElement = null; /** The resolution used to convert between the DOM client space into world space. */ this.resolution = 1; this.renderer = renderer; this.rootBoundary = new EventBoundary.EventBoundary(null); EventTicker.EventsTicker.init(this); this.autoPreventDefault = true; this._eventsAdded = false; this._rootPointerEvent = new FederatedPointerEvent.FederatedPointerEvent(null); this._rootWheelEvent = new FederatedWheelEvent.FederatedWheelEvent(null); this.cursorStyles = { "default": "inherit", pointer: "pointer" }; this.features = new Proxy(_objectSpread({}, _EventSystem.defaultEventFeatures), { set: function set(target, key, value) { if (key === "globalMove") { _this.rootBoundary.enableGlobalMoveEvents = value; } target[key] = value; return true; } }); this._onPointerDown = this._onPointerDown.bind(this); this._onPointerMove = this._onPointerMove.bind(this); this._onPointerUp = this._onPointerUp.bind(this); this._onPointerOverOut = this._onPointerOverOut.bind(this); this.onWheel = this.onWheel.bind(this); } /** * The default interaction mode for all display objects. * @see Container.eventMode * @type {EventMode} * @readonly * @since 7.2.0 */ return _createClass(_EventSystem, [{ key: "init", value: /** * Runner init called, view is available at this point. * @ignore */ function init(options) { var _options$eventMode, _options$eventFeature; var _this$renderer = this.renderer, canvas = _this$renderer.canvas, resolution = _this$renderer.resolution; this.setTargetElement(canvas); this.resolution = resolution; _EventSystem._defaultEventMode = (_options$eventMode = options.eventMode) !== null && _options$eventMode !== void 0 ? _options$eventMode : "passive"; Object.assign(this.features, (_options$eventFeature = options.eventFeatures) !== null && _options$eventFeature !== void 0 ? _options$eventFeature : {}); this.rootBoundary.enableGlobalMoveEvents = this.features.globalMove; } /** * Handle changing resolution. * @ignore */ }, { key: "resolutionChange", value: function resolutionChange(resolution) { this.resolution = resolution; } /** Destroys all event listeners and detaches the renderer. */ }, { key: "destroy", value: function destroy() { this.setTargetElement(null); this.renderer = null; this._currentCursor = null; } /** * Sets the current cursor mode, handling any callbacks or CSS style changes. * @param mode - cursor mode, a key from the cursorStyles dictionary */ }, { key: "setCursor", value: function setCursor(mode) { mode || (mode = "default"); var applyStyles = true; if (globalThis.OffscreenCanvas && this.domElement instanceof OffscreenCanvas) { applyStyles = false; } if (this._currentCursor === mode) { return; } this._currentCursor = mode; var style = this.cursorStyles[mode]; if (style) { switch (_typeof(style)) { case "string": if (applyStyles) { this.domElement.style.cursor = style; } break; case "function": style(mode); break; case "object": if (applyStyles) { Object.assign(this.domElement.style, style); } break; } } else if (applyStyles && typeof mode === "string" && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) { this.domElement.style.cursor = mode; } } /** * The global pointer event. * Useful for getting the pointer position without listening to events. * @since 7.2.0 */ }, { key: "pointer", get: function get() { return this._rootPointerEvent; } /** * Event handler for pointer down events on {@link EventSystem#domElement this.domElement}. * @param nativeEvent - The native mouse/pointer/touch event. */ }, { key: "_onPointerDown", value: function _onPointerDown(nativeEvent) { if (!this.features.click) return; this.rootBoundary.rootTarget = this.renderer.lastObjectRendered; var events = this._normalizeToPointerData(nativeEvent); if (this.autoPreventDefault && events[0].isNormalized) { var cancelable = nativeEvent.cancelable || !("cancelable" in nativeEvent); if (cancelable) { nativeEvent.preventDefault(); } } for (var i = 0, j = events.length; i < j; i++) { var nativeEvent2 = events[i]; var federatedEvent = this._bootstrapEvent(this._rootPointerEvent, nativeEvent2); this.rootBoundary.mapEvent(federatedEvent); } this.setCursor(this.rootBoundary.cursor); } /** * Event handler for pointer move events on on {@link EventSystem#domElement this.domElement}. * @param nativeEvent - The native mouse/pointer/touch events. */ }, { key: "_onPointerMove", value: function _onPointerMove(nativeEvent) { if (!this.features.move) return; this.rootBoundary.rootTarget = this.renderer.lastObjectRendered; EventTicker.EventsTicker.pointerMoved(); var normalizedEvents = this._normalizeToPointerData(nativeEvent); for (var i = 0, j = normalizedEvents.length; i < j; i++) { var event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]); this.rootBoundary.mapEvent(event); } this.setCursor(this.rootBoundary.cursor); } /** * Event handler for pointer up events on {@link EventSystem#domElement this.domElement}. * @param nativeEvent - The native mouse/pointer/touch event. */ }, { key: "_onPointerUp", value: function _onPointerUp(nativeEvent) { if (!this.features.click) return; this.rootBoundary.rootTarget = this.renderer.lastObjectRendered; var target = nativeEvent.target; if (nativeEvent.composedPath && nativeEvent.composedPath().length > 0) { target = nativeEvent.composedPath()[0]; } var outside = target !== this.domElement ? "outside" : ""; var normalizedEvents = this._normalizeToPointerData(nativeEvent); for (var i = 0, j = normalizedEvents.length; i < j; i++) { var event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]); event.type += outside; this.rootBoundary.mapEvent(event); } this.setCursor(this.rootBoundary.cursor); } /** * Event handler for pointer over & out events on {@link EventSystem#domElement this.domElement}. * @param nativeEvent - The native mouse/pointer/touch event. */ }, { key: "_onPointerOverOut", value: function _onPointerOverOut(nativeEvent) { if (!this.features.click) return; this.rootBoundary.rootTarget = this.renderer.lastObjectRendered; var normalizedEvents = this._normalizeToPointerData(nativeEvent); for (var i = 0, j = normalizedEvents.length; i < j; i++) { var event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]); this.rootBoundary.mapEvent(event); } this.setCursor(this.rootBoundary.cursor); } /** * Passive handler for `wheel` events on {@link EventSystem.domElement this.domElement}. * @param nativeEvent - The native wheel event. */ }, { key: "onWheel", value: function onWheel(nativeEvent) { if (!this.features.wheel) return; var wheelEvent = this.normalizeWheelEvent(nativeEvent); this.rootBoundary.rootTarget = this.renderer.lastObjectRendered; this.rootBoundary.mapEvent(wheelEvent); } /** * Sets the {@link EventSystem#domElement domElement} and binds event listeners. * * To deregister the current DOM element without setting a new one, pass {@code null}. * @param element - The new DOM element. */ }, { key: "setTargetElement", value: function setTargetElement(element) { this._removeEvents(); this.domElement = element; EventTicker.EventsTicker.domElement = element; this._addEvents(); } /** Register event listeners on {@link Renderer#domElement this.domElement}. */ }, { key: "_addEvents", value: function _addEvents() { if (this._eventsAdded || !this.domElement) { return; } EventTicker.EventsTicker.addTickerListener(); var style = this.domElement.style; if (style) { if (globalThis.navigator.msPointerEnabled) { style.msContentZooming = "none"; style.msTouchAction = "none"; } else if (this.supportsPointerEvents) { style.touchAction = "none"; } } if (this.supportsPointerEvents) { globalThis.document.addEventListener("pointermove", this._onPointerMove, true); this.domElement.addEventListener("pointerdown", this._onPointerDown, true); this.domElement.addEventListener("pointerleave", this._onPointerOverOut, true); this.domElement.addEventListener("pointerover", this._onPointerOverOut, true); globalThis.addEventListener("pointerup", this._onPointerUp, true); } else { globalThis.document.addEventListener("mousemove", this._onPointerMove, true); this.domElement.addEventListener("mousedown", this._onPointerDown, true); this.domElement.addEventListener("mouseout", this._onPointerOverOut, true); this.domElement.addEventListener("mouseover", this._onPointerOverOut, true); globalThis.addEventListener("mouseup", this._onPointerUp, true); if (this.supportsTouchEvents) { this.domElement.addEventListener("touchstart", this._onPointerDown, true); this.domElement.addEventListener("touchend", this._onPointerUp, true); this.domElement.addEventListener("touchmove", this._onPointerMove, true); } } this.domElement.addEventListener("wheel", this.onWheel, { passive: true, capture: true }); this._eventsAdded = true; } /** Unregister event listeners on {@link EventSystem#domElement this.domElement}. */ }, { key: "_removeEvents", value: function _removeEvents() { if (!this._eventsAdded || !this.domElement) { return; } EventTicker.EventsTicker.removeTickerListener(); var style = this.domElement.style; if (style) { if (globalThis.navigator.msPointerEnabled) { style.msContentZooming = ""; style.msTouchAction = ""; } else if (this.supportsPointerEvents) { style.touchAction = ""; } } if (this.supportsPointerEvents) { globalThis.document.removeEventListener("pointermove", this._onPointerMove, true); this.domElement.removeEventListener("pointerdown", this._onPointerDown, true); this.domElement.removeEventListener("pointerleave", this._onPointerOverOut, true); this.domElement.removeEventListener("pointerover", this._onPointerOverOut, true); globalThis.removeEventListener("pointerup", this._onPointerUp, true); } else { globalThis.document.removeEventListener("mousemove", this._onPointerMove, true); this.domElement.removeEventListener("mousedown", this._onPointerDown, true); this.domElement.removeEventListener("mouseout", this._onPointerOverOut, true); this.domElement.removeEventListener("mouseover", this._onPointerOverOut, true); globalThis.removeEventListener("mouseup", this._onPointerUp, true); if (this.supportsTouchEvents) { this.domElement.removeEventListener("touchstart", this._onPointerDown, true); this.domElement.removeEventListener("touchend", this._onPointerUp, true); this.domElement.removeEventListener("touchmove", this._onPointerMove, true); } } this.domElement.removeEventListener("wheel", this.onWheel, true); this.domElement = null; this._eventsAdded = false; } /** * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The * resulting value is stored in the point. This takes into account the fact that the DOM * element could be scaled and positioned anywhere on the screen. * @param {PointData} point - the point that the result will be stored in * @param {number} x - the x coord of the position to map * @param {number} y - the y coord of the position to map */ }, { key: "mapPositionToPoint", value: function mapPositionToPoint(point, x, y) { var rect = this.domElement.isConnected ? this.domElement.getBoundingClientRect() : { x: 0, y: 0, width: this.domElement.width, height: this.domElement.height, left: 0, top: 0 }; var resolutionMultiplier = 1 / this.resolution; point.x = (x - rect.left) * (this.domElement.width / rect.width) * resolutionMultiplier; point.y = (y - rect.top) * (this.domElement.height / rect.height) * resolutionMultiplier; } /** * Ensures that the original event object contains all data that a regular pointer event would have * @param event - The original event data from a touch or mouse event * @returns An array containing a single normalized pointer event, in the case of a pointer * or mouse event, or a multiple normalized pointer events if there are multiple changed touches */ }, { key: "_normalizeToPointerData", value: function _normalizeToPointerData(event) { var normalizedEvents = []; if (this.supportsTouchEvents && event instanceof TouchEvent) { for (var i = 0, li = event.changedTouches.length; i < li; i++) { var touch = event.changedTouches[i]; if (typeof touch.button === "undefined") touch.button = 0; if (typeof touch.buttons === "undefined") touch.buttons = 1; if (typeof touch.isPrimary === "undefined") { touch.isPrimary = event.touches.length === 1 && event.type === "touchstart"; } if (typeof touch.width === "undefined") touch.width = touch.radiusX || 1; if (typeof touch.height === "undefined") touch.height = touch.radiusY || 1; if (typeof touch.tiltX === "undefined") touch.tiltX = 0; if (typeof touch.tiltY === "undefined") touch.tiltY = 0; if (typeof touch.pointerType === "undefined") touch.pointerType = "touch"; if (typeof touch.pointerId === "undefined") touch.pointerId = touch.identifier || 0; if (typeof touch.pressure === "undefined") touch.pressure = touch.force || 0.5; if (typeof touch.twist === "undefined") touch.twist = 0; if (typeof touch.tangentialPressure === "undefined") touch.tangentialPressure = 0; if (typeof touch.layerX === "undefined") touch.layerX = touch.offsetX = touch.clientX; if (typeof touch.layerY === "undefined") touch.layerY = touch.offsetY = touch.clientY; touch.isNormalized = true; touch.type = event.type; normalizedEvents.push(touch); } } else if (!globalThis.MouseEvent || event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof globalThis.PointerEvent))) { var tempEvent = event; if (typeof tempEvent.isPrimary === "undefined") tempEvent.isPrimary = true; if (typeof tempEvent.width === "undefined") tempEvent.width = 1; if (typeof tempEvent.height === "undefined") tempEvent.height = 1; if (typeof tempEvent.tiltX === "undefined") tempEvent.tiltX = 0; if (typeof tempEvent.tiltY === "undefined") tempEvent.tiltY = 0; if (typeof tempEvent.pointerType === "undefined") tempEvent.pointerType = "mouse"; if (typeof tempEvent.pointerId === "undefined") tempEvent.pointerId = MOUSE_POINTER_ID; if (typeof tempEvent.pressure === "undefined") tempEvent.pressure = 0.5; if (typeof tempEvent.twist === "undefined") tempEvent.twist = 0; if (typeof tempEvent.tangentialPressure === "undefined") tempEvent.tangentialPressure = 0; tempEvent.isNormalized = true; normalizedEvents.push(tempEvent); } else { normalizedEvents.push(event); } return normalizedEvents; } /** * Normalizes the native {@link https://w3c.github.io/uievents/#interface-wheelevent WheelEvent}. * * The returned {@link FederatedWheelEvent} is a shared instance. It will not persist across * multiple native wheel events. * @param nativeEvent - The native wheel event that occurred on the canvas. * @returns A federated wheel event. */ }, { key: "normalizeWheelEvent", value: function normalizeWheelEvent(nativeEvent) { var event = this._rootWheelEvent; this._transferMouseData(event, nativeEvent); event.deltaX = nativeEvent.deltaX; event.deltaY = nativeEvent.deltaY; event.deltaZ = nativeEvent.deltaZ; event.deltaMode = nativeEvent.deltaMode; this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY); event.global.copyFrom(event.screen); event.offset.copyFrom(event.screen); event.nativeEvent = nativeEvent; event.type = nativeEvent.type; return event; } /** * Normalizes the `nativeEvent` into a federateed {@link FederatedPointerEvent}. * @param event * @param nativeEvent */ }, { key: "_bootstrapEvent", value: function _bootstrapEvent(event, nativeEvent) { event.originalEvent = null; event.nativeEvent = nativeEvent; event.pointerId = nativeEvent.pointerId; event.width = nativeEvent.width; event.height = nativeEvent.height; event.isPrimary = nativeEvent.isPrimary; event.pointerType = nativeEvent.pointerType; event.pressure = nativeEvent.pressure; event.tangentialPressure = nativeEvent.tangentialPressure; event.tiltX = nativeEvent.tiltX; event.tiltY = nativeEvent.tiltY; event.twist = nativeEvent.twist; this._transferMouseData(event, nativeEvent); this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY); event.global.copyFrom(event.screen); event.offset.copyFrom(event.screen); event.isTrusted = nativeEvent.isTrusted; if (event.type === "pointerleave") { event.type = "pointerout"; } if (event.type.startsWith("mouse")) { event.type = event.type.replace("mouse", "pointer"); } if (event.type.startsWith("touch")) { event.type = TOUCH_TO_POINTER[event.type] || event.type; } return event; } /** * Transfers base & mouse event data from the {@code nativeEvent} to the federated event. * @param event * @param nativeEvent */ }, { key: "_transferMouseData", value: function _transferMouseData(event, nativeEvent) { event.isTrusted = nativeEvent.isTrusted; event.srcElement = nativeEvent.srcElement; event.timeStamp = performance.now(); event.type = nativeEvent.type; event.altKey = nativeEvent.altKey; event.button = nativeEvent.button; event.buttons = nativeEvent.buttons; event.client.x = nativeEvent.clientX; event.client.y = nativeEvent.clientY; event.ctrlKey = nativeEvent.ctrlKey; event.metaKey = nativeEvent.metaKey; event.movement.x = nativeEvent.movementX; event.movement.y = nativeEvent.movementY; event.page.x = nativeEvent.pageX; event.page.y = nativeEvent.pageY; event.relatedTarget = null; event.shiftKey = nativeEvent.shiftKey; } }], [{ key: "defaultEventMode", get: function get() { return this._defaultEventMode; } }]); }(); /** @ignore */ _EventSystem.extension = { name: "events", type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.CanvasSystem, Extensions.ExtensionType.WebGPUSystem], priority: -1 }; /** * The event features that are enabled by the EventSystem * (included in the **pixi.js** and **pixi.js-legacy** bundle), otherwise it will be ignored. * @since 7.2.0 */ _EventSystem.defaultEventFeatures = { /** Enables pointer events associated with pointer movement. */ move: true, /** Enables global pointer move events. */ globalMove: true, /** Enables pointer events associated with clicking. */ click: true, /** Enables wheel events. */ wheel: true }; var EventSystem = _EventSystem; exports.EventSystem = EventSystem; /***/ }), /***/ 49635: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _FCore = __webpack_require__(49997); var _EventEmitter = __webpack_require__(35513); var _MainMenuScene = _interopRequireDefault(__webpack_require__(40918)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * * @param {Level1Scene} scene * @constructor */ function InLevelModal(scene) { var _this = this; this.scene = scene; this.$modal = (0, _FCore._)({ "class": 'as-modal', child: [{ tag: 'img', attr: { src: 'assets/small_paper.png' } }, { "class": 'as-modal-content', child: [{ tag: 'button', "class": 'as-modal-button', child: { text: 'Tiếp tục' }, on: { click: function click() { _this.scene.paused = false; _this.$modal.remove(); document.removeEventListener('click', _onClickOut); } } }, { tag: 'button', "class": 'as-modal-button', child: { text: 'Chơi lại' }, on: { click: function click() { document.removeEventListener('click', _onClickOut); _this.$modal.remove(); _this.scene.app.startScene(_this.scene.constructor); //todo: reset game } } }, { tag: 'button', "class": 'as-modal-button', child: { text: 'Trang chủ' }, on: { click: function click() { document.removeEventListener('click', _onClickOut); _this.$modal.remove(); _this.scene.app.startScene(_MainMenuScene["default"]); } } }] }] }); this.$modal.addTo(this.scene.$foreground); this.scene.paused = true; var _onClickOut = function onClickOut(e) { if ((0, _EventEmitter.hitElement)(_this.$modal, e)) return; document.removeEventListener('click', _onClickOut); _this.$modal.remove(); }; setTimeout(function () { document.addEventListener('click', _onClickOut); }, 200); } var _default = exports["default"] = InLevelModal; /***/ }), /***/ 49673: /***/ ((module, exports, __webpack_require__) => { exports = module.exports = __webpack_require__(93527)(false); // Module exports.push([module.id, "@font-face {\r\n font-family: \"Kodchasan\";\r\n src: url('assets/fonts/Kodchasan-Regular.ttf') format('truetype');\r\n font-weight: normal;\r\n font-style: normal;\r\n}\r\n\r\n@font-face {\r\n font-family: \"Kodchasan\";\r\n src: url('assets/fonts/Kodchasan-Bold.ttf') format('truetype');\r\n font-weight: bold;\r\n font-style: normal;\r\n}\r\n\r\nhtml, body {\r\n user-select: none;\r\n}\r\n\r\n.as-application {\r\n font-family: \"Kodchasan\";\r\n font-size: 16px;\r\n color: #333;\r\n background-color: black;\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n overflow: hidden;\r\n}\r\n\r\n.as-application-main {\r\n left: 0;\r\n right: 0;\r\n display: inline-block;\r\n vertical-align: middle;\r\n position: relative;\r\n width: 1620px;\r\n height: 1080px;\r\n overflow: hidden;\r\n /*background-color: white;*/\r\n /*transform-origin: 0% 0%;*/\r\n}\r\n\r\n\r\n.as-application-background {\r\n z-index: 0;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.as-application-canvas {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n z-index: 10;\r\n}\r\n\r\n.as-application-foreground {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n z-index: 20;\r\n pointer-events: none;\r\n}\r\n\r\n\r\n.as-img-btn {\r\n background-color: transparent;\r\n border: none;\r\n padding: 0;\r\n margin: 0;\r\n cursor: pointer;\r\n pointer-events: initial;\r\n position: relative;\r\n font: inherit;\r\n}\r\n\r\n.as-img-btn:disabled {\r\n cursor: not-allowed;\r\n pointer-events: none;\r\n}\r\n\r\n.as-img-btn:disabled img {\r\n filter: brightness(0.4);\r\n}\r\n\r\n.as-img-btn-text {\r\n left: 0;\r\n top: 0;\r\n width: 100%;\r\n height: 100%;\r\n position: absolute;\r\n text-align: center;\r\n white-space: nowrap;\r\n box-sizing: border-box;\r\n z-index: 10;\r\n}\r\n\r\n.as-img-btn-text::before {\r\n content: \"\";\r\n height: 100%;\r\n}\r\n\r\n.as-img-btn-text::after {\r\n content: attr(data-text);\r\n}\r\n\r\n.as-img-btn-text::before,\r\n.as-img-btn-text::after {\r\n display: inline-block;\r\n vertical-align: middle;\r\n box-sizing: border-box;\r\n\r\n}\r\n\r\n/*********************************************/\r\n.as-loading-bg {\r\n background-image: url(\"assets/bg2.png\");\r\n width: 100%;\r\n height: 100%;\r\n background-size: cover;\r\n}\r\n\r\n.as-loading-book {\r\n position: absolute;\r\n left: 109px;\r\n top: 109px;\r\n}\r\n\r\n.as-loading-cat-zzz {\r\n position: absolute;\r\n background-image: url(\"assets/cat_zzz.png\");\r\n left: 604px;\r\n top: 338px;\r\n}\r\n\r\n.as-loading-text {\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: 578px;\r\n color: #994e11;\r\n text-align: center;\r\n font-size: 74px;\r\n}\r\n\r\n/*********************************************/\r\n.as-main-menu-logo {\r\n position: absolute;\r\n left: 158px;\r\n top: 65px;\r\n animation: logo_float 5s ease-in-out infinite;\r\n}\r\n\r\n@keyframes logo_float {\r\n 0% {\r\n top: 65px;\r\n }\r\n 50% {\r\n top: 80px;\r\n }\r\n 100% {\r\n top: 65px;\r\n }\r\n}\r\n\r\n.as-main-menu-bg {\r\n background-image: url(\"assets/menu_bg.png\");\r\n width: 100%;\r\n height: 100%;\r\n background-size: cover;\r\n}\r\n\r\n\r\n.as-main-menu-button-list {\r\n position: absolute;\r\n left: 230px;\r\n top: 492px;\r\n padding-left: 47px;\r\n /*background-color: #9c2929;*/\r\n overflow: visible;\r\n box-sizing: border-box;\r\n pointer-events: initial;\r\n}\r\n\r\n.as-main-menu-button {\r\n display: block;\r\n overflow: visible;\r\n transition: transform 0.1s ease-in-out;\r\n transform: scale(0.77);\r\n}\r\n\r\n.as-main-menu-button-wrapper.as-hover .as-main-menu-button {\r\n transform: scale(0.9);\r\n}\r\n\r\n\r\n.as-main-menu-button-wrapper.as-start-btn .as-main-menu-button {\r\n transform: scale(0.85);\r\n}\r\n\r\n.as-main-menu-button-wrapper.as-hover.as-start-btn .as-main-menu-button {\r\n transform: scale(1);\r\n}\r\n\r\n.as-main-menu-button-wrapper.as-hover:active .as-main-menu-button {\r\n transform: scale(0.95);\r\n\r\n}\r\n\r\n.as-main-menu-button img {\r\n filter: drop-shadow(5px 5px 4px white);\r\n position: relative;\r\n z-index: 3;\r\n}\r\n\r\n.as-main-menu-button::before {\r\n content: \"\";\r\n display: block;\r\n background-image: url(assets/menu_button_wood.png);\r\n filter: brightness(0.8) blur(2px);\r\n opacity: 0.45;\r\n position: absolute;\r\n z-index: 1;\r\n width: 100%;\r\n height: 100%;\r\n top: 5px;\r\n left: 8px;\r\n}\r\n\r\n.as-main-menu-button .as-img-btn-text {\r\n font-size: 52px;\r\n color: white;\r\n font-weight: bold;\r\n padding-bottom: 15px;\r\n}\r\n\r\n\r\n.as-menu-cursor {\r\n position: absolute;\r\n z-index: 12;\r\n --value: 0;\r\n top: calc(134px * var(--value) + 45px);\r\n transition: top 0.12s;\r\n left: 0;\r\n opacity: 0;\r\n pointer-events: none;\r\n}\r\n\r\n/*.as-main-menu-button-list:hover .as-menu-cursor{*/\r\n/* opacity: 1;*/\r\n/*}*/\r\n/*********************************************/\r\n\r\n.as-summary-bg {\r\n background-image: url(\"assets/bg1.png\");\r\n width: 100%;\r\n height: 100%;\r\n background-size: cover;\r\n}\r\n\r\n.as-summary-gui {\r\n width: 100%;\r\n height: 100%;\r\n overflow: visible;\r\n position: relative;\r\n}\r\n\r\n.as-summary-tab-view {\r\n position: absolute;\r\n width: 1150px;\r\n height: 850px;\r\n pointer-events: initial;\r\n display: grid;\r\n grid-template-rows: 100px 1fr;\r\n background-size: contain;\r\n left: 250px;\r\n}\r\n\r\n.as-summary-header {\r\n position: absolute;\r\n left: 327px;\r\n top: 100px;\r\n z-index: 1;\r\n}\r\n\r\n.as-summary-body {\r\n position: absolute;\r\n left: 230px;\r\n top: 163px;\r\n width: 1155px;\r\n z-index: 6;\r\n}\r\n\r\n.as-summary-body > img {\r\n width: 100%;\r\n\r\n\r\n}\r\n\r\n.as-summary-body::before {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n top: 35px;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n\r\n pointer-events: initial;\r\n}\r\n\r\n.as-summary-close-btn {\r\n position: absolute;\r\n left: 1303px;\r\n top: 135px;\r\n z-index: 20;\r\n}\r\n\r\n.as-summary-tab-btn {\r\n position: absolute;\r\n top: 22px;\r\n left: 0;\r\n z-index: 3;\r\n transition: top 0.1s;\r\n}\r\n\r\n.as-summary-tab-btn:hover {\r\n filter: drop-shadow(-1px -2px 5px rgba(131, 244, 250, 0.4));\r\n}\r\n\r\n.as-summary-tab-btn.as-active {\r\n top: 0;\r\n z-index: 4;\r\n filter: drop-shadow(-1px -2px 5px rgba(131, 244, 250, 0.8));\r\n font-weight: bold;\r\n\r\n}\r\n\r\n.as-summary-tab-btn {\r\n font-size: 32px;\r\n color: #0a4548;\r\n}\r\n\r\n.as-summary-tab-btn .as-img-btn-text {\r\n height: 83px;\r\n padding-left: 32px;\r\n text-align: left;\r\n}\r\n\r\n.as-summary-content{\r\n position: absolute;\r\n z-index: 30;\r\n display: none;\r\n left: 0;\r\n top: 0;\r\n}\r\n\r\n.as-summary-content.as-active{\r\n display: block;\r\n}\r\n\r\n/************************** LEVEL 1 ********/\r\n\r\n.as-bottom-bar {\r\n position: absolute;\r\n bottom: 0;\r\n right: 0;\r\n width: 945px;\r\n height: 136px;\r\n overflow: visible;\r\n transition: bottom 0.5s;\r\n z-index: 20;\r\n}\r\n\r\n\r\n.as-bottom-bar button::after {\r\n content: \"x0\";\r\n display: block;\r\n position: absolute;\r\n line-height: 50px;\r\n font-size: 30px;\r\n right: -10px;\r\n top: 5px;\r\n background-color: #4ea345;\r\n color: white;\r\n width: 50px;\r\n height: 50px;\r\n border-radius: 50%;\r\n}\r\n\r\n.as-bottom-bar-bg {\r\n position: absolute;\r\n top: 48px;\r\n z-index: 1;\r\n}\r\n\r\n\r\n.as-bottom-bar button {\r\n position: absolute;\r\n z-index: 3;\r\n left: 40px;\r\n}\r\n\r\n.as-bottom-bar button:active {\r\n transform: scale(0.95);\r\n}\r\n\r\n.as-top-bar {\r\n position: absolute;\r\n z-index: 20;\r\n top: 0;\r\n left: 69px;\r\n pointer-events: initial;\r\n line-height: 1.5;\r\n transition: top 0.5s;\r\n}\r\n\r\n\r\n.as-top-bar > button {\r\n position: absolute;\r\n}\r\n\r\n.as-top-bar > button:active {\r\n transform: scale(0.95);\r\n}\r\n\r\n.as-top-bar .as-pause-btn {\r\n left: 1188px;\r\n top: 18px;\r\n z-index: 3;\r\n}\r\n\r\n.as-top-bar .as-menu-btn {\r\n left: 1328px;\r\n top: 18px;\r\n z-index: 3;\r\n}\r\n\r\n.as-top-bar .as-score {\r\n position: absolute;\r\n font-size: 55px;\r\n color: #265c5c;\r\n font-weight: bold;\r\n left: 162px;\r\n top: 30px;\r\n}\r\n\r\n.as-top-bar .as-waves {\r\n position: absolute;\r\n font-size: 57px;\r\n color: #674b45;\r\n left: 472px;\r\n top: 27px;\r\n white-space: nowrap;\r\n font-weight: bold;\r\n}\r\n\r\n.as-waves strong {\r\n font-weight: bolder;\r\n}\r\n\r\n.as-top-bar .as-switch {\r\n position: absolute;\r\n top: 27px;\r\n left: 972px;\r\n overflow: visible;\r\n pointer-events: initial;\r\n}\r\n\r\n.as-switch-bg {\r\n height: 70px;\r\n width: auto;\r\n z-index: 1;\r\n}\r\n\r\n.as-switch-x1,\r\n.as-switch-x2 {\r\n position: absolute;\r\n z-index: 2;\r\n height: 78px;\r\n left: -2px;\r\n top: -3px;\r\n transition: left 0.25s ease-in-out, opacity 0.25s ease-in-out;\r\n}\r\n\r\n\r\n.as-switch.as-checked .as-switch-x2,\r\n.as-switch.as-checked .as-switch-x1 {\r\n left: calc(100% - 74px);\r\n}\r\n\r\n.as-switch.as-checked .as-switch-x2,\r\n.as-switch-x1 {\r\n z-index: 3;\r\n opacity: 1;\r\n}\r\n\r\n.as-switch.as-checked .as-switch-x1,\r\n.as-switch-x2 {\r\n z-index: 2;\r\n opacity: 0;\r\n}\r\n\r\n.as-game-grid {\r\n width: 1296px;\r\n height: 648px;\r\n box-sizing: border-box;\r\n display: grid;\r\n grid-template-rows: repeat(6, 1fr);\r\n grid-template-columns: repeat(12, 1fr);\r\n /*pointer-events: initial;*/\r\n}\r\n\r\n.as-static-object-ctn {\r\n position: absolute;\r\n top: 225px;\r\n left: 218px;\r\n width: 1296px;\r\n height: 648px;\r\n overflow: visible;\r\n pointer-events: initial;\r\n}\r\n\r\n.as-cell {\r\n box-sizing: border-box;\r\n border: 1px solid red;\r\n}\r\n\r\n.as-map-ground {\r\n position: absolute;\r\n z-index: 0;\r\n width: 100%;\r\n height: 100%;\r\n left: 0;\r\n top: 0;\r\n}\r\n\r\n/******************************************/\r\n\r\n.as-monster-home {\r\n position: absolute;\r\n z-index: 10;\r\n}\r\n\r\n.as-static-object {\r\n position: absolute;\r\n overflow: visible;\r\n}\r\n\r\n.as-static-object > img {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n}\r\n\r\n.as-rock-2x2 {\r\n position: absolute;\r\n z-index: 2;\r\n}\r\n\r\n.as-place-holder {\r\n position: absolute;\r\n z-index: 3;\r\n left: 0;\r\n top: 0;\r\n width: 108px;\r\n height: 108px;\r\n\r\n}\r\n\r\n.as-place-holder::before {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n left: 3px;\r\n right: 3px;\r\n top: 3px;\r\n bottom: 3px;\r\n border-radius: 25px;\r\n background-color: rgba(77, 103, 67, 0.5);\r\n box-sizing: border-box;\r\n}\r\n\r\n.as-protected-target-hp {\r\n position: absolute;\r\n z-index: 9999;\r\n}\r\n\r\n.as-protected-target-text {\r\n position: absolute;\r\n top: 9px;\r\n right: 20px;\r\n font-size: 40px;\r\n color: white;\r\n text-align: right;\r\n}\r\n\r\n\r\n/********************************************/\r\n\r\n.as-tree-picker-box {\r\n position: absolute;\r\n left: 300px;\r\n top: 300px;\r\n background-color: rgba(77, 103, 67, 0.8);\r\n border-radius: 15px;\r\n z-index: 20;\r\n pointer-events: initial;\r\n}\r\n\r\n.as-tree-picker-box button {\r\n width: 120px;\r\n height: 90px;\r\n text-align: center;\r\n display: inline-block;\r\n vertical-align: top;\r\n}\r\n\r\n.as-tree-picker-box button:active {\r\n transform: scale(0.9);\r\n}\r\n\r\n.as-tree-picker-cursor {\r\n z-index: 20;\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n}\r\n\r\n/********************************************/\r\n\r\n.as-modal {\r\n position: absolute;\r\n z-index: 21;\r\n right: 80px;\r\n top: 100px;\r\n pointer-events: initial;\r\n}\r\n\r\n\r\n.as-modal > img {\r\n height: 600px;\r\n}\r\n\r\n.as-modal-content {\r\n position: absolute;\r\n left: 100px;\r\n top: 100px;\r\n right: 100px;\r\n}\r\n\r\n.as-modal-button {\r\n font-family: inherit;\r\n font-size: 50px;\r\n width: 100%;\r\n margin-bottom: 50px;\r\n border: 6px solid #315b4d;\r\n height: 90px;\r\n border-radius: 45px;\r\n color: #74b485;\r\n box-shadow: 2px 2px 5px #315b4d;\r\n}\r\n\r\n.as-modal-button:active {\r\n box-shadow: 0px 0px 3px #315b4d;\r\n}\r\n\r\n/********************/\r\n\r\n.as-result-modal {\r\n position: absolute;\r\n z-index: 30;\r\n transition: opacity 0.5s ease-out;\r\n opacity: 0;\r\n background-color: rgba(48, 22, 6, 0.6);\r\n pointer-events: initial;\r\n left: 0;\r\n top: 0;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.as-result-modal button {\r\n z-index: 10;\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n}\r\n\r\n.as-result-modal button:active {\r\n transform: scale(0.95);\r\n}\r\n\r\n.as-result-win-stars {\r\n position: absolute;\r\n z-index: 51;\r\n top: 190px;\r\n left: 600px;\r\n}\r\n\r\n.as-result-modal.as-win::after,\r\n.as-result-modal.as-fail::after {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n width: 100%;\r\n height: 100%;\r\n z-index: 50;\r\n pointer-events: none;\r\n background-image: url(\"assets/star_light.png\");\r\n background-size: cover;\r\n}\r\n\r\n.as-result-modal.as-fail::after {\r\n filter: grayscale(100%) brightness(80%) hue-rotate(-50deg);\r\n}\r\n\r\n.as-result-modal.as-fail .as-result-win-stars {\r\n filter: grayscale(90%) hue-rotate(-50deg);\r\n}\r\n\r\n.as-map-scene {\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n overflow: hidden;\r\n pointer-events: initial;\r\n user-select: none;\r\n}\r\n\r\n.as-map-scene img {\r\n user-select: none;\r\n}\r\n\r\n.as-map-scene-page {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n width: calc(100% + 20px);\r\n height: 100%;\r\n overflow: hidden;\r\n /*transition: left 0.25s ease-in-out;*/\r\n}\r\n\r\n.as-map-scene-page-viewport {\r\n width: calc(100% + 20px);\r\n height: 100%;\r\n overflow-y: scroll;\r\n}\r\n\r\n.as-map-scene-page-arrow-btn {\r\n position: absolute;\r\n top: calc(50% - 40px);\r\n z-index: 1000;\r\n\r\n}\r\n\r\n\r\n.as-map-scene-page-arrow-btn:active {\r\n transform: scale(0.95);\r\n}\r\n\r\n.as-map-scene-page-arrow-btn img {\r\n height: 80px;\r\n}\r\n\r\n.as-map-scene-page-arrow-btn:disabled {\r\n pointer-events: none;\r\n filter: brightness(0.6);\r\n opacity: 0.6;\r\n}\r\n\r\n.as-map-scene-page-arrow-btn.as-left {\r\n left: 20px;\r\n}\r\n\r\n\r\n.as-map-scene-page-arrow-btn.as-right {\r\n right: 20px;\r\n}\r\n\r\n.as-map-scene-page-content {\r\n position: relative;\r\n}\r\n\r\n@keyframes skew-y-shaking {\r\n 0% {\r\n transform: skewY(-5deg);\r\n }\r\n 5% {\r\n transform: skewY(5deg);\r\n }\r\n 10% {\r\n transform: skewY(-5deg);\r\n }\r\n 15% {\r\n transform: skewY(5deg);\r\n }\r\n 20% {\r\n transform: skewY(0deg);\r\n }\r\n 100% {\r\n transform: skewY(0deg);\r\n }\r\n}\r\n\r\n.as-map-scene-level-btn {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n z-index: 50;\r\n filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.4));\r\n}\r\n\r\n.as-map-scene-level-btn:active {\r\n transform: scale(0.95);\r\n}\r\n\r\n.as-map-scene-level-btn img {\r\n height: 120px;\r\n}\r\n\r\n.as-map-scene-level-btn:not(:disabled) {\r\n animation: skew-y-shaking 1s infinite;\r\n}\r\n\r\n.as-map-scene-level-btn:disabled {\r\n filter: grayscale(50%) brightness(180%) hue-rotate(120deg);\r\n}", ""]); /***/ }), /***/ 49698: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Texture = __webpack_require__(73782); var warn = __webpack_require__(57371); var Cache = __webpack_require__(65278); "use strict"; function createTexture(source, loader, url) { source.label = url; source._sourceOrigin = url; var texture = new Texture.Texture({ source: source, label: url }); var unload = function unload() { delete loader.promiseCache[url]; if (Cache.Cache.has(url)) { Cache.Cache.remove(url); } }; texture.source.once("destroy", function () { if (loader.promiseCache[url]) { warn.warn("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."); unload(); } }); texture.once("destroy", function () { if (!source.destroyed) { warn.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."); unload(); } }); return texture; } exports.createTexture = createTexture; /***/ }), /***/ 49997: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = exports._ = exports.$$ = exports.$ = void 0; var _Dom = _interopRequireDefault(__webpack_require__(15851)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } var FCore = new _Dom["default"](); var _ = exports._ = FCore._; var $ = exports.$ = FCore.$; var $$ = exports.$$ = FCore.$$; var _default = exports["default"] = FCore; /***/ }), /***/ 50132: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var adapter = __webpack_require__(72450); "use strict"; var _isWebGPUSupported; function isWebGPUSupported() { return _isWebGPUSupported2.apply(this, arguments); } function _isWebGPUSupported2() { _isWebGPUSupported2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() { var options, _args2 = arguments; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: options = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}; if (!(_isWebGPUSupported !== void 0)) { _context2.n = 1; break; } return _context2.a(2, _isWebGPUSupported); case 1: _context2.n = 2; return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var gpu, _adapter, _t; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: gpu = adapter.DOMAdapter.get().getNavigator().gpu; if (gpu) { _context.n = 1; break; } return _context.a(2, false); case 1: _context.p = 1; _context.n = 2; return gpu.requestAdapter(options); case 2: _adapter = _context.v; _context.n = 3; return _adapter.requestDevice(); case 3: return _context.a(2, true); case 4: _context.p = 4; _t = _context.v; return _context.a(2, false); } }, _callee, null, [[1, 4]]); }))(); case 2: _isWebGPUSupported = _context2.v; return _context2.a(2, _isWebGPUSupported); } }, _callee2); })); return _isWebGPUSupported2.apply(this, arguments); } exports.isWebGPUSupported = isWebGPUSupported; /***/ }), /***/ 50626: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var unsafeEvalSupported = __webpack_require__(70688); var Buffer = __webpack_require__(59832); var _const = __webpack_require__(33843); "use strict"; var UboSystem = /*#__PURE__*/function () { function UboSystem(adaptor) { _classCallCheck(this, UboSystem); /** Cache of uniform buffer layouts and sync functions, so we don't have to re-create them */ this._syncFunctionHash = /* @__PURE__ */Object.create(null); this._adaptor = adaptor; this._systemCheck(); } /** * Overridable function by `pixi.js/unsafe-eval` to silence * throwing an error if platform doesn't support unsafe-evals. * @private */ return _createClass(UboSystem, [{ key: "_systemCheck", value: function _systemCheck() { if (!unsafeEvalSupported.unsafeEvalSupported()) { throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support."); } } }, { key: "ensureUniformGroup", value: function ensureUniformGroup(uniformGroup) { var uniformData = this.getUniformGroupData(uniformGroup); uniformGroup.buffer || (uniformGroup.buffer = new Buffer.Buffer({ data: new Float32Array(uniformData.layout.size / 4), usage: _const.BufferUsage.UNIFORM | _const.BufferUsage.COPY_DST })); } }, { key: "getUniformGroupData", value: function getUniformGroupData(uniformGroup) { return this._syncFunctionHash[uniformGroup._signature] || this._initUniformGroup(uniformGroup); } }, { key: "_initUniformGroup", value: function _initUniformGroup(uniformGroup) { var uniformGroupSignature = uniformGroup._signature; var uniformData = this._syncFunctionHash[uniformGroupSignature]; if (!uniformData) { var elements = Object.keys(uniformGroup.uniformStructures).map(function (i) { return uniformGroup.uniformStructures[i]; }); var layout = this._adaptor.createUboElements(elements); var syncFunction = this._generateUboSync(layout.uboElements); uniformData = this._syncFunctionHash[uniformGroupSignature] = { layout: layout, syncFunction: syncFunction }; } return this._syncFunctionHash[uniformGroupSignature]; } }, { key: "_generateUboSync", value: function _generateUboSync(uboElements) { return this._adaptor.generateUboSync(uboElements); } }, { key: "syncUniformGroup", value: function syncUniformGroup(uniformGroup, data, offset) { var uniformGroupData = this.getUniformGroupData(uniformGroup); uniformGroup.buffer || (uniformGroup.buffer = new Buffer.Buffer({ data: new Float32Array(uniformGroupData.layout.size / 4), usage: _const.BufferUsage.UNIFORM | _const.BufferUsage.COPY_DST })); var dataInt32 = null; if (!data) { data = uniformGroup.buffer.data; dataInt32 = uniformGroup.buffer.dataInt32; } offset || (offset = 0); uniformGroupData.syncFunction(uniformGroup.uniforms, data, dataInt32, offset); return true; } }, { key: "updateUniformGroup", value: function updateUniformGroup(uniformGroup) { if (uniformGroup.isStatic && !uniformGroup._dirtyId) return false; uniformGroup._dirtyId = 0; var synced = this.syncUniformGroup(uniformGroup); uniformGroup.buffer.update(); return synced; } }, { key: "destroy", value: function destroy() { this._syncFunctionHash = null; } }]); }(); exports.UboSystem = UboSystem; /***/ }), /***/ 50827: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Matrix = __webpack_require__(20764); var Rectangle = __webpack_require__(74731); var _const = __webpack_require__(63548); var calculateProjection = __webpack_require__(46415); var SystemRunner = __webpack_require__(70652); var CanvasSource = __webpack_require__(35879); var TextureSource = __webpack_require__(55406); var Texture = __webpack_require__(73782); var getCanvasTexture = __webpack_require__(57240); var isRenderingToScreen = __webpack_require__(33490); var RenderTarget = __webpack_require__(25654); "use strict"; var RenderTargetSystem = /*#__PURE__*/function () { function RenderTargetSystem(renderer) { _classCallCheck(this, RenderTargetSystem); /** This is the root viewport for the render pass*/ this.rootViewPort = new Rectangle.Rectangle(); /** the current viewport that the gpu is using */ this.viewport = new Rectangle.Rectangle(); /** * a runner that lets systems know if the active render target has changed. * Eg the Stencil System needs to know so it can manage the stencil buffer */ this.onRenderTargetChange = new SystemRunner.SystemRunner("onRenderTargetChange"); /** the projection matrix that is used by the shaders based on the active render target and the viewport */ this.projectionMatrix = new Matrix.Matrix(); /** the default clear color for render targets */ this.defaultClearColor = [0, 0, 0, 0]; /** * a hash that stores the render target for a given render surface. When you pass in a texture source, * a render target is created for it. This map stores and makes it easy to retrieve the render target */ this._renderSurfaceToRenderTargetHash = /* @__PURE__ */new Map(); /** A hash that stores a gpu render target for a given render target. */ this._gpuRenderTargetHash = /* @__PURE__ */Object.create(null); /** * A stack that stores the render target and frame that is currently being rendered to. * When push is called, the current render target is stored in this stack. * When pop is called, the previous render target is restored. */ this._renderTargetStack = []; this._renderer = renderer; renderer.renderableGC.addManagedHash(this, "_gpuRenderTargetHash"); } /** called when dev wants to finish a render pass */ return _createClass(RenderTargetSystem, [{ key: "finishRenderPass", value: function finishRenderPass() { this.adaptor.finishRenderPass(this.renderTarget); } /** * called when the renderer starts to render a scene. * @param options * @param options.target - the render target to render to * @param options.clear - the clear mode to use. Can be true or a CLEAR number 'COLOR | DEPTH | STENCIL' 0b111 * @param options.clearColor - the color to clear to * @param options.frame - the frame to render to */ }, { key: "renderStart", value: function renderStart(_ref) { var _this$adaptor$prerend, _this$adaptor; var target = _ref.target, clear = _ref.clear, clearColor = _ref.clearColor, frame = _ref.frame; this._renderTargetStack.length = 0; this.push(target, clear, clearColor, frame); this.rootViewPort.copyFrom(this.viewport); this.rootRenderTarget = this.renderTarget; this.renderingToScreen = isRenderingToScreen.isRenderingToScreen(this.rootRenderTarget); (_this$adaptor$prerend = (_this$adaptor = this.adaptor).prerender) === null || _this$adaptor$prerend === void 0 || _this$adaptor$prerend.call(_this$adaptor, this.rootRenderTarget); } }, { key: "postrender", value: function postrender() { var _this$adaptor$postren, _this$adaptor2; (_this$adaptor$postren = (_this$adaptor2 = this.adaptor).postrender) === null || _this$adaptor$postren === void 0 || _this$adaptor$postren.call(_this$adaptor2, this.rootRenderTarget); } /** * Binding a render surface! This is the main function of the render target system. * It will take the RenderSurface (which can be a texture, canvas, or render target) and bind it to the renderer. * Once bound all draw calls will be rendered to the render surface. * * If a frame is not provide and the render surface is a texture, the frame of the texture will be used. * @param renderSurface - the render surface to bind * @param clear - the clear mode to use. Can be true or a CLEAR number 'COLOR | DEPTH | STENCIL' 0b111 * @param clearColor - the color to clear to * @param frame - the frame to render to * @returns the render target that was bound */ }, { key: "bind", value: function bind(renderSurface) { var clear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var clearColor = arguments.length > 2 ? arguments[2] : undefined; var frame = arguments.length > 3 ? arguments[3] : undefined; var renderTarget = this.getRenderTarget(renderSurface); var didChange = this.renderTarget !== renderTarget; this.renderTarget = renderTarget; this.renderSurface = renderSurface; var gpuRenderTarget = this.getGpuRenderTarget(renderTarget); if (renderTarget.pixelWidth !== gpuRenderTarget.width || renderTarget.pixelHeight !== gpuRenderTarget.height) { this.adaptor.resizeGpuRenderTarget(renderTarget); gpuRenderTarget.width = renderTarget.pixelWidth; gpuRenderTarget.height = renderTarget.pixelHeight; } var source = renderTarget.colorTexture; var viewport = this.viewport; var pixelWidth = source.pixelWidth; var pixelHeight = source.pixelHeight; if (!frame && renderSurface instanceof Texture.Texture) { frame = renderSurface.frame; } if (frame) { var resolution = source._resolution; viewport.x = frame.x * resolution + 0.5 | 0; viewport.y = frame.y * resolution + 0.5 | 0; viewport.width = frame.width * resolution + 0.5 | 0; viewport.height = frame.height * resolution + 0.5 | 0; } else { viewport.x = 0; viewport.y = 0; viewport.width = pixelWidth; viewport.height = pixelHeight; } calculateProjection.calculateProjection(this.projectionMatrix, 0, 0, viewport.width / source.resolution, viewport.height / source.resolution, !renderTarget.isRoot); this.adaptor.startRenderPass(renderTarget, clear, clearColor, viewport); if (didChange) { this.onRenderTargetChange.emit(renderTarget); } return renderTarget; } }, { key: "clear", value: function clear(target) { var _clear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _const.CLEAR.ALL; var clearColor = arguments.length > 2 ? arguments[2] : undefined; if (!_clear) return; if (target) { target = this.getRenderTarget(target); } this.adaptor.clear(target || this.renderTarget, _clear, clearColor, this.viewport); } }, { key: "contextChange", value: function contextChange() { this._gpuRenderTargetHash = /* @__PURE__ */Object.create(null); } /** * Push a render surface to the renderer. This will bind the render surface to the renderer, * @param renderSurface - the render surface to push * @param clear - the clear mode to use. Can be true or a CLEAR number 'COLOR | DEPTH | STENCIL' 0b111 * @param clearColor - the color to clear to * @param frame - the frame to use when rendering to the render surface */ }, { key: "push", value: function push(renderSurface) { var clear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _const.CLEAR.ALL; var clearColor = arguments.length > 2 ? arguments[2] : undefined; var frame = arguments.length > 3 ? arguments[3] : undefined; var renderTarget = this.bind(renderSurface, clear, clearColor, frame); this._renderTargetStack.push({ renderTarget: renderTarget, frame: frame }); return renderTarget; } /** Pops the current render target from the renderer and restores the previous render target. */ }, { key: "pop", value: function pop() { this._renderTargetStack.pop(); var currentRenderTargetData = this._renderTargetStack[this._renderTargetStack.length - 1]; this.bind(currentRenderTargetData.renderTarget, false, null, currentRenderTargetData.frame); } /** * Gets the render target from the provide render surface. Eg if its a texture, * it will return the render target for the texture. * If its a render target, it will return the same render target. * @param renderSurface - the render surface to get the render target for * @returns the render target for the render surface */ }, { key: "getRenderTarget", value: function getRenderTarget(renderSurface) { var _this$_renderSurfaceT; if (renderSurface.isTexture) { renderSurface = renderSurface.source; } return (_this$_renderSurfaceT = this._renderSurfaceToRenderTargetHash.get(renderSurface)) !== null && _this$_renderSurfaceT !== void 0 ? _this$_renderSurfaceT : this._initRenderTarget(renderSurface); } /** * Copies a render surface to another texture. * * NOTE: * for sourceRenderSurfaceTexture, The render target must be something that is written too by the renderer * * The following is not valid: * @example * const canvas = document.createElement('canvas') * canvas.width = 200; * canvas.height = 200; * * const ctx = canvas2.getContext('2d')! * ctx.fillStyle = 'red' * ctx.fillRect(0, 0, 200, 200); * * const texture = RenderTexture.create({ * width: 200, * height: 200, * }) * const renderTarget = renderer.renderTarget.getRenderTarget(canvas2); * * renderer.renderTarget.copyToTexture(renderTarget,texture, {x:0,y:0},{width:200,height:200},{x:0,y:0}); * * The best way to copy a canvas is to create a texture from it. Then render with that. * * Parsing in a RenderTarget canvas context (with a 2d context) * @param sourceRenderSurfaceTexture - the render surface to copy from * @param destinationTexture - the texture to copy to * @param originSrc - the origin of the copy * @param originSrc.x - the x origin of the copy * @param originSrc.y - the y origin of the copy * @param size - the size of the copy * @param size.width - the width of the copy * @param size.height - the height of the copy * @param originDest - the destination origin (top left to paste from!) * @param originDest.x - the x origin of the paste * @param originDest.y - the y origin of the paste */ }, { key: "copyToTexture", value: function copyToTexture(sourceRenderSurfaceTexture, destinationTexture, originSrc, size, originDest) { if (originSrc.x < 0) { size.width += originSrc.x; originDest.x -= originSrc.x; originSrc.x = 0; } if (originSrc.y < 0) { size.height += originSrc.y; originDest.y -= originSrc.y; originSrc.y = 0; } var pixelWidth = sourceRenderSurfaceTexture.pixelWidth, pixelHeight = sourceRenderSurfaceTexture.pixelHeight; size.width = Math.min(size.width, pixelWidth - originSrc.x); size.height = Math.min(size.height, pixelHeight - originSrc.y); return this.adaptor.copyToTexture(sourceRenderSurfaceTexture, destinationTexture, originSrc, size, originDest); } /** * ensures that we have a depth stencil buffer available to render to * This is used by the mask system to make sure we have a stencil buffer. */ }, { key: "ensureDepthStencil", value: function ensureDepthStencil() { if (!this.renderTarget.stencil) { this.renderTarget.stencil = true; this.adaptor.startRenderPass(this.renderTarget, false, null, this.viewport); } } /** nukes the render target system */ }, { key: "destroy", value: function destroy() { this._renderer = null; this._renderSurfaceToRenderTargetHash.forEach(function (renderTarget, key) { if (renderTarget !== key) { renderTarget.destroy(); } }); this._renderSurfaceToRenderTargetHash.clear(); this._gpuRenderTargetHash = /* @__PURE__ */Object.create(null); } }, { key: "_initRenderTarget", value: function _initRenderTarget(renderSurface) { var _this = this; var renderTarget = null; if (CanvasSource.CanvasSource.test(renderSurface)) { renderSurface = getCanvasTexture.getCanvasTexture(renderSurface).source; } if (renderSurface instanceof RenderTarget.RenderTarget) { renderTarget = renderSurface; } else if (renderSurface instanceof TextureSource.TextureSource) { renderTarget = new RenderTarget.RenderTarget({ colorTextures: [renderSurface] }); if (CanvasSource.CanvasSource.test(renderSurface.source.resource)) { renderTarget.isRoot = true; } renderSurface.once("destroy", function () { renderTarget.destroy(); _this._renderSurfaceToRenderTargetHash["delete"](renderSurface); var gpuRenderTarget = _this._gpuRenderTargetHash[renderTarget.uid]; if (gpuRenderTarget) { _this._gpuRenderTargetHash[renderTarget.uid] = null; _this.adaptor.destroyGpuRenderTarget(gpuRenderTarget); } }); } this._renderSurfaceToRenderTargetHash.set(renderSurface, renderTarget); return renderTarget; } }, { key: "getGpuRenderTarget", value: function getGpuRenderTarget(renderTarget) { return this._gpuRenderTargetHash[renderTarget.uid] || (this._gpuRenderTargetHash[renderTarget.uid] = this.adaptor.initGpuRenderTarget(renderTarget)); } }, { key: "resetState", value: function resetState() { this.renderTarget = null; this.renderSurface = null; } }]); }(); exports.RenderTargetSystem = RenderTargetSystem; /***/ }), /***/ 50859: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["noise", "seed"]; function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var UniformGroup = __webpack_require__(34400); var Filter = __webpack_require__(92393); var defaultFilter = __webpack_require__(78440); var noise$1 = __webpack_require__(55191); var noise = __webpack_require__(83014); "use strict"; var _NoiseFilter = /*#__PURE__*/function (_Filter$Filter) { /** * @param options - The options of the noise filter. */ function _NoiseFilter() { var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _NoiseFilter); options = _objectSpread(_objectSpread({}, _NoiseFilter.defaultOptions), options); var gpuProgram = GpuProgram.GpuProgram.from({ vertex: { source: noise["default"], entryPoint: "mainVertex" }, fragment: { source: noise["default"], entryPoint: "mainFragment" } }); var glProgram = GlProgram.GlProgram.from({ vertex: defaultFilter["default"], fragment: noise$1["default"], name: "noise-filter" }); var _options = options, noise$2 = _options.noise, seed = _options.seed, rest = _objectWithoutProperties(_options, _excluded); _this = _callSuper(this, _NoiseFilter, [_objectSpread(_objectSpread({}, rest), {}, { gpuProgram: gpuProgram, glProgram: glProgram, resources: { noiseUniforms: new UniformGroup.UniformGroup({ uNoise: { value: 1, type: "f32" }, uSeed: { value: 1, type: "f32" } }) } })]); _this.noise = noise$2; _this.seed = seed !== null && seed !== void 0 ? seed : Math.random(); return _this; } /** * The amount of noise to apply, this value should be in the range (0, 1]. * @default 0.5 */ _inherits(_NoiseFilter, _Filter$Filter); return _createClass(_NoiseFilter, [{ key: "noise", get: function get() { return this.resources.noiseUniforms.uniforms.uNoise; }, set: function set(value) { this.resources.noiseUniforms.uniforms.uNoise = value; } /** A seed value to apply to the random noise generation. `Math.random()` is a good value to use. */ }, { key: "seed", get: function get() { return this.resources.noiseUniforms.uniforms.uSeed; }, set: function set(value) { this.resources.noiseUniforms.uniforms.uSeed = value; } }]); }(Filter.Filter); _NoiseFilter.defaultOptions = { noise: 0.5 }; var NoiseFilter = _NoiseFilter; exports.NoiseFilter = NoiseFilter; /***/ }), /***/ 51080: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var compileHighShaderToProgram = __webpack_require__(97754); var colorBit = __webpack_require__(78786); var generateTextureBatchBit = __webpack_require__(96847); var roundPixelsBit = __webpack_require__(35268); var getBatchSamplersUniformGroup = __webpack_require__(72059); var Shader = __webpack_require__(27866); "use strict"; var DefaultShader = /*#__PURE__*/function (_Shader$Shader) { function DefaultShader(maxTextures) { _classCallCheck(this, DefaultShader); var glProgram = compileHighShaderToProgram.compileHighShaderGlProgram({ name: "batch", bits: [colorBit.colorBitGl, generateTextureBatchBit.generateTextureBatchBitGl(maxTextures), roundPixelsBit.roundPixelsBitGl] }); var gpuProgram = compileHighShaderToProgram.compileHighShaderGpuProgram({ name: "batch", bits: [colorBit.colorBit, generateTextureBatchBit.generateTextureBatchBit(maxTextures), roundPixelsBit.roundPixelsBit] }); return _callSuper(this, DefaultShader, [{ glProgram: glProgram, gpuProgram: gpuProgram, resources: { batchSamplers: getBatchSamplersUniformGroup.getBatchSamplersUniformGroup(maxTextures) } }]); } _inherits(DefaultShader, _Shader$Shader); return _createClass(DefaultShader); }(Shader.Shader); exports.DefaultShader = DefaultShader; /***/ }), /***/ 51274: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Color = __webpack_require__(98828); var warn = __webpack_require__(57371); var FillGradient = __webpack_require__(57315); var parseSVGFloatAttribute = __webpack_require__(99836); "use strict"; function parseSVGDefinitions(svg, session) { var definitions = svg.querySelectorAll("defs"); for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; for (var j = 0; j < definition.children.length; j++) { var child = definition.children[j]; switch (child.nodeName.toLowerCase()) { case "lineargradient": session.defs[child.id] = parseLinearGradient(child); break; case "radialgradient": session.defs[child.id] = parseRadialGradient(child); break; default: break; } } } } function parseLinearGradient(child) { var x0 = parseSVGFloatAttribute.parseSVGFloatAttribute(child, "x1", 0); var y0 = parseSVGFloatAttribute.parseSVGFloatAttribute(child, "y1", 0); var x1 = parseSVGFloatAttribute.parseSVGFloatAttribute(child, "x2", 1); var y1 = parseSVGFloatAttribute.parseSVGFloatAttribute(child, "y2", 0); var gradientUnit = child.getAttribute("gradientUnits") || "objectBoundingBox"; var gradient = new FillGradient.FillGradient(x0, y0, x1, y1, gradientUnit === "objectBoundingBox" ? "local" : "global"); for (var k = 0; k < child.children.length; k++) { var stop = child.children[k]; var offset = parseSVGFloatAttribute.parseSVGFloatAttribute(stop, "offset", 0); var color = Color.Color.shared.setValue(stop.getAttribute("stop-color")).toNumber(); gradient.addColorStop(offset, color); } return gradient; } function parseRadialGradient(_child) { warn.warn("[SVG Parser] Radial gradients are not yet supported"); return new FillGradient.FillGradient(0, 0, 1, 0); } exports.parseSVGDefinitions = parseSVGDefinitions; /***/ }), /***/ 51305: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var FilterPipe = __webpack_require__(43717); var FilterSystem = __webpack_require__(10116); "use strict"; Extensions.extensions.add(FilterSystem.FilterSystem); Extensions.extensions.add(FilterPipe.FilterPipe); /***/ }), /***/ 51387: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var UboSystem = __webpack_require__(50626); var createUboElementsWGSL = __webpack_require__(30008); var createUboSyncFunctionWGSL = __webpack_require__(2898); "use strict"; var GpuUboSystem = /*#__PURE__*/function (_UboSystem$UboSystem) { function GpuUboSystem() { _classCallCheck(this, GpuUboSystem); return _callSuper(this, GpuUboSystem, [{ createUboElements: createUboElementsWGSL.createUboElementsWGSL, generateUboSync: createUboSyncFunctionWGSL.createUboSyncFunctionWGSL }]); } _inherits(GpuUboSystem, _UboSystem$UboSystem); return _createClass(GpuUboSystem); }(UboSystem.UboSystem); /** @ignore */ GpuUboSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "ubo" }; exports.GpuUboSystem = GpuUboSystem; /***/ }), /***/ 51783: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); "use strict"; var imageFormats = ["png", "jpg", "jpeg"]; var detectDefaults = { extension: { type: Extensions.ExtensionType.DetectionParser, priority: -1 }, test: function test() { return Promise.resolve(true); }, add: function () { var _add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(formats) { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: return _context.a(2, [].concat(_toConsumableArray(formats), imageFormats)); } }, _callee); })); function add(_x) { return _add.apply(this, arguments); } return add; }(), remove: function () { var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(formats) { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: return _context2.a(2, formats.filter(function (f) { return !imageFormats.includes(f); })); } }, _callee2); })); function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() }; exports.detectDefaults = detectDefaults; /***/ }), /***/ 51814: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BackgroundLoader = /*#__PURE__*/function () { /** * @param loader * @param verbose - should the loader log to the console */ function BackgroundLoader(loader) { var verbose = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; _classCallCheck(this, BackgroundLoader); this._loader = loader; this._assetList = []; this._isLoading = false; this._maxConcurrent = 1; this.verbose = verbose; } /** * Adds an array of assets to load. * @param assetUrls - assets to load */ return _createClass(BackgroundLoader, [{ key: "add", value: function add(assetUrls) { var _this = this; assetUrls.forEach(function (a) { _this._assetList.push(a); }); if (this.verbose) { console.log("[BackgroundLoader] assets: ", this._assetList); } if (this._isActive && !this._isLoading) { void this._next(); } } /** * Loads the next set of assets. Will try to load as many assets as it can at the same time. * * The max assets it will try to load at one time will be 4. */ }, { key: "_next", value: (function () { var _next2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var toLoad, toLoadAmount, i; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!(this._assetList.length && this._isActive)) { _context.n = 2; break; } this._isLoading = true; toLoad = []; toLoadAmount = Math.min(this._assetList.length, this._maxConcurrent); for (i = 0; i < toLoadAmount; i++) { toLoad.push(this._assetList.pop()); } _context.n = 1; return this._loader.load(toLoad); case 1: this._isLoading = false; void this._next(); case 2: return _context.a(2); } }, _callee, this); })); function _next() { return _next2.apply(this, arguments); } return _next; }() /** * Activate/Deactivate the loading. If set to true then it will immediately continue to load the next asset. * @returns whether the class is active */ ) }, { key: "active", get: function get() { return this._isActive; }, set: function set(value) { if (this._isActive === value) return; this._isActive = value; if (value && !this._isLoading) { void this._next(); } } }]); }(); exports.BackgroundLoader = BackgroundLoader; /***/ }), /***/ 51829: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isMobile; var appleIphone = /iPhone/i; var appleIpod = /iPod/i; var appleTablet = /iPad/i; var appleUniversal = /\biOS-universal(?:.+)Mac\b/i; var androidPhone = /\bAndroid(?:.+)Mobile\b/i; var androidTablet = /Android/i; var amazonPhone = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i; var amazonTablet = /Silk/i; var windowsPhone = /Windows Phone/i; var windowsTablet = /\bWindows(?:.+)ARM\b/i; var otherBlackBerry = /BlackBerry/i; var otherBlackBerry10 = /BB10/i; var otherOpera = /Opera Mini/i; var otherChrome = /\b(CriOS|Chrome)(?:.+)Mobile/i; var otherFirefox = /Mobile(?:.+)Firefox\b/i; var isAppleTabletOnIos13 = function isAppleTabletOnIos13(navigator) { return typeof navigator !== 'undefined' && navigator.platform === 'MacIntel' && typeof navigator.maxTouchPoints === 'number' && navigator.maxTouchPoints > 1 && typeof MSStream === 'undefined'; }; function createMatch(userAgent) { return function (regex) { return regex.test(userAgent); }; } function isMobile(param) { var nav = { userAgent: '', platform: '', maxTouchPoints: 0 }; if (!param && typeof navigator !== 'undefined') { nav = { userAgent: navigator.userAgent, platform: navigator.platform, maxTouchPoints: navigator.maxTouchPoints || 0 }; } else if (typeof param === 'string') { nav.userAgent = param; } else if (param && param.userAgent) { nav = { userAgent: param.userAgent, platform: param.platform, maxTouchPoints: param.maxTouchPoints || 0 }; } var userAgent = nav.userAgent; var tmp = userAgent.split('[FBAN'); if (typeof tmp[1] !== 'undefined') { userAgent = tmp[0]; } tmp = userAgent.split('Twitter'); if (typeof tmp[1] !== 'undefined') { userAgent = tmp[0]; } var match = createMatch(userAgent); var result = { apple: { phone: match(appleIphone) && !match(windowsPhone), ipod: match(appleIpod), tablet: !match(appleIphone) && (match(appleTablet) || isAppleTabletOnIos13(nav)) && !match(windowsPhone), universal: match(appleUniversal), device: (match(appleIphone) || match(appleIpod) || match(appleTablet) || match(appleUniversal) || isAppleTabletOnIos13(nav)) && !match(windowsPhone) }, amazon: { phone: match(amazonPhone), tablet: !match(amazonPhone) && match(amazonTablet), device: match(amazonPhone) || match(amazonTablet) }, android: { phone: !match(windowsPhone) && match(amazonPhone) || !match(windowsPhone) && match(androidPhone), tablet: !match(windowsPhone) && !match(amazonPhone) && !match(androidPhone) && (match(amazonTablet) || match(androidTablet)), device: !match(windowsPhone) && (match(amazonPhone) || match(amazonTablet) || match(androidPhone) || match(androidTablet)) || match(/\bokhttp\b/i) }, windows: { phone: match(windowsPhone), tablet: match(windowsTablet), device: match(windowsPhone) || match(windowsTablet) }, other: { blackberry: match(otherBlackBerry), blackberry10: match(otherBlackBerry10), opera: match(otherOpera), firefox: match(otherFirefox), chrome: match(otherChrome), device: match(otherBlackBerry) || match(otherBlackBerry10) || match(otherOpera) || match(otherFirefox) || match(otherChrome) }, any: false, phone: false, tablet: false }; result.any = result.apple.device || result.android.device || result.windows.device || result.other.device; result.phone = result.apple.phone || result.android.phone || result.windows.phone; result.tablet = result.apple.tablet || result.android.tablet || result.windows.tablet; return result; } /***/ }), /***/ 51856: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var FilterEffect = /*#__PURE__*/function () { function FilterEffect() { _classCallCheck(this, FilterEffect); /** the pipe that knows how to handle this effect */ this.pipe = "filter"; /** the priority of this effect */ this.priority = 1; } return _createClass(FilterEffect, [{ key: "destroy", value: function destroy() { for (var i = 0; i < this.filters.length; i++) { this.filters[i].destroy(); } this.filters = null; this.filterArea = null; } }]); }(); exports.FilterEffect = FilterEffect; /***/ }), /***/ 52029: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function loopMatrix(col, row) { var total = col * row; return "\n for (let i = 0; i < ".concat(total, "; i++) {\n data[offset + (((i / ").concat(col, ")|0) * 4) + (i % ").concat(col, ")] = v[i];\n }\n "); } var uboSyncFunctionsSTD40 = { f32: "\n data[offset] = v;", i32: "\n dataInt32[offset] = v;", "vec2<f32>": "\n data[offset] = v[0];\n data[offset + 1] = v[1];", "vec3<f32>": "\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];", "vec4<f32>": "\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 3] = v[3];", "vec2<i32>": "\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];", "vec3<i32>": "\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];\n dataInt32[offset + 2] = v[2];", "vec4<i32>": "\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];\n dataInt32[offset + 2] = v[2];\n dataInt32[offset + 3] = v[3];", "mat2x2<f32>": "\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 4] = v[2];\n data[offset + 5] = v[3];", "mat3x3<f32>": "\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];", "mat4x4<f32>": "\n for (let i = 0; i < 16; i++) {\n data[offset + i] = v[i];\n }", "mat3x2<f32>": loopMatrix(3, 2), "mat4x2<f32>": loopMatrix(4, 2), "mat2x3<f32>": loopMatrix(2, 3), "mat4x3<f32>": loopMatrix(4, 3), "mat2x4<f32>": loopMatrix(2, 4), "mat3x4<f32>": loopMatrix(3, 4) }; var uboSyncFunctionsWGSL = _objectSpread(_objectSpread({}, uboSyncFunctionsSTD40), {}, { "mat2x2<f32>": "\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 3] = v[3];\n " }); exports.uboSyncFunctionsSTD40 = uboSyncFunctionsSTD40; exports.uboSyncFunctionsWGSL = uboSyncFunctionsWGSL; /***/ }), /***/ 52070: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var clean = __webpack_require__(35775); "use strict"; var renderableGCTick = 0; var _RenderableGCSystem = /*#__PURE__*/function () { /** * Creates a new RenderableGCSystem instance. * @param renderer - The renderer this garbage collection system works for */ function _RenderableGCSystem(renderer) { _classCallCheck(this, _RenderableGCSystem); /** Array of renderables being tracked for garbage collection */ this._managedRenderables = []; /** Array of hash objects being tracked for cleanup */ this._managedHashes = []; /** Array of arrays being tracked for cleanup */ this._managedArrays = []; this._renderer = renderer; } /** * Initializes the garbage collection system with the provided options. * @param options - Configuration options for the renderer */ return _createClass(_RenderableGCSystem, [{ key: "init", value: function init(options) { options = _objectSpread(_objectSpread({}, _RenderableGCSystem.defaultOptions), options); this.maxUnusedTime = options.renderableGCMaxUnusedTime; this._frequency = options.renderableGCFrequency; this.enabled = options.renderableGCActive; } /** * Gets whether the garbage collection system is currently enabled. * @returns True if GC is enabled, false otherwise */ }, { key: "enabled", get: function get() { return !!this._handler; } /** * Enables or disables the garbage collection system. * When enabled, schedules periodic cleanup of resources. * When disabled, cancels all scheduled cleanups. */, set: function set(value) { var _this = this; if (this.enabled === value) return; if (value) { this._handler = this._renderer.scheduler.repeat(function () { return _this.run(); }, this._frequency, false); this._hashHandler = this._renderer.scheduler.repeat(function () { var _iterator = _createForOfIteratorHelper(_this._managedHashes), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var hash = _step.value; hash.context[hash.hash] = clean.cleanHash(hash.context[hash.hash]); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } }, this._frequency); this._arrayHandler = this._renderer.scheduler.repeat(function () { var _iterator2 = _createForOfIteratorHelper(_this._managedArrays), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var array = _step2.value; clean.cleanArray(array.context[array.hash]); } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } }, this._frequency); } else { this._renderer.scheduler.cancel(this._handler); this._renderer.scheduler.cancel(this._hashHandler); this._renderer.scheduler.cancel(this._arrayHandler); } } /** * Adds a hash table to be managed by the garbage collector. * @param context - The object containing the hash table * @param hash - The property name of the hash table */ }, { key: "addManagedHash", value: function addManagedHash(context, hash) { this._managedHashes.push({ context: context, hash: hash }); } /** * Adds an array to be managed by the garbage collector. * @param context - The object containing the array * @param hash - The property name of the array */ }, { key: "addManagedArray", value: function addManagedArray(context, hash) { this._managedArrays.push({ context: context, hash: hash }); } /** * Updates the GC timestamp and tracking before rendering. * @param options - The render options * @param options.container - The container to render */ }, { key: "prerender", value: function prerender(_ref) { var container = _ref.container; this._now = performance.now(); container.renderGroup.gcTick = renderableGCTick++; this._updateInstructionGCTick(container.renderGroup, container.renderGroup.gcTick); } /** * Starts tracking a renderable for garbage collection. * @param renderable - The renderable to track */ }, { key: "addRenderable", value: function addRenderable(renderable) { if (!this.enabled) return; if (renderable._lastUsed === -1) { this._managedRenderables.push(renderable); renderable.once("destroyed", this._removeRenderable, this); } renderable._lastUsed = this._now; } /** * Performs garbage collection by cleaning up unused renderables. * Removes renderables that haven't been used for longer than maxUnusedTime. */ }, { key: "run", value: function run() { var now = this._now; var managedRenderables = this._managedRenderables; var renderPipes = this._renderer.renderPipes; var offset = 0; for (var i = 0; i < managedRenderables.length; i++) { var _renderable$renderGro, _renderGroup$instruct, _renderGroup$instruct2, _renderGroup$gcTick; var renderable = managedRenderables[i]; if (renderable === null) { offset++; continue; } var renderGroup = (_renderable$renderGro = renderable.renderGroup) !== null && _renderable$renderGro !== void 0 ? _renderable$renderGro : renderable.parentRenderGroup; var currentTick = (_renderGroup$instruct = renderGroup === null || renderGroup === void 0 || (_renderGroup$instruct2 = renderGroup.instructionSet) === null || _renderGroup$instruct2 === void 0 ? void 0 : _renderGroup$instruct2.gcTick) !== null && _renderGroup$instruct !== void 0 ? _renderGroup$instruct : -1; if (((_renderGroup$gcTick = renderGroup === null || renderGroup === void 0 ? void 0 : renderGroup.gcTick) !== null && _renderGroup$gcTick !== void 0 ? _renderGroup$gcTick : 0) === currentTick) { renderable._lastUsed = now; } if (now - renderable._lastUsed > this.maxUnusedTime) { if (!renderable.destroyed) { var rp = renderPipes; if (renderGroup) renderGroup.structureDidChange = true; rp[renderable.renderPipeId].destroyRenderable(renderable); } renderable._lastUsed = -1; offset++; renderable.off("destroyed", this._removeRenderable, this); } else { managedRenderables[i - offset] = renderable; } } managedRenderables.length -= offset; } /** Cleans up the garbage collection system. Disables GC and removes all tracked resources. */ }, { key: "destroy", value: function destroy() { this.enabled = false; this._renderer = null; this._managedRenderables.length = 0; this._managedHashes.length = 0; this._managedArrays.length = 0; } /** * Removes a renderable from being tracked when it's destroyed. * @param renderable - The renderable to stop tracking */ }, { key: "_removeRenderable", value: function _removeRenderable(renderable) { var index = this._managedRenderables.indexOf(renderable); if (index >= 0) { renderable.off("destroyed", this._removeRenderable, this); this._managedRenderables[index] = null; } } /** * Updates the GC tick counter for a render group and its children. * @param renderGroup - The render group to update * @param gcTick - The new tick value */ }, { key: "_updateInstructionGCTick", value: function _updateInstructionGCTick(renderGroup, gcTick) { renderGroup.instructionSet.gcTick = gcTick; var _iterator3 = _createForOfIteratorHelper(renderGroup.renderGroupChildren), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { var child = _step3.value; this._updateInstructionGCTick(child, gcTick); } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } } }]); }(); /** * Extension metadata for registering this system with the renderer. * @ignore */ _RenderableGCSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem], name: "renderableGC", priority: 0 }; /** * Default configuration options for the garbage collection system. * These can be overridden when initializing the renderer. */ _RenderableGCSystem.defaultOptions = { /** Enable/disable the garbage collector */ renderableGCActive: true, /** Time in ms before an unused resource is collected (default 1 minute) */ renderableGCMaxUnusedTime: 6e4, /** How often to run garbage collection in ms (default 30 seconds) */ renderableGCFrequency: 3e4 }; var RenderableGCSystem = _RenderableGCSystem; exports.RenderableGCSystem = RenderableGCSystem; /***/ }), /***/ 52138: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var gpuUploadBufferImageResource = { type: "image", upload: function upload(source, gpuTexture, gpu) { var resource = source.resource; var total = (source.pixelWidth | 0) * (source.pixelHeight | 0); var bytesPerPixel = resource.byteLength / total; gpu.device.queue.writeTexture({ texture: gpuTexture }, resource, { offset: 0, rowsPerImage: source.pixelHeight, bytesPerRow: source.pixelHeight * bytesPerPixel }, { width: source.pixelWidth, height: source.pixelHeight, depthOrArrayLayers: 1 }); } }; exports.gpuUploadBufferImageResource = gpuUploadBufferImageResource; /***/ }), /***/ 52165: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function buildArc(points, x, y, radius, start, end, clockwise, steps) { var dist = Math.abs(start - end); if (!clockwise && start > end) { dist = 2 * Math.PI - dist; } else if (clockwise && end > start) { dist = 2 * Math.PI - dist; } steps || (steps = Math.max(6, Math.floor(6 * Math.pow(radius, 1 / 3) * (dist / Math.PI)))); steps = Math.max(steps, 3); var f = dist / steps; var t = start; f *= clockwise ? -1 : 1; for (var i = 0; i < steps + 1; i++) { var cs = Math.cos(t); var sn = Math.sin(t); var nx = x + cs * radius; var ny = y + sn * radius; points.push(nx, ny); t += f; } } exports.buildArc = buildArc; /***/ }), /***/ 52179: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Color = __webpack_require__(98828); var Matrix = __webpack_require__(20764); var Texture = __webpack_require__(73782); var warn = __webpack_require__(57371); var FillGradient = __webpack_require__(57315); var FillPattern = __webpack_require__(95745); "use strict"; var PRECISION = 1e5; function getCanvasFillStyle(fillStyle, context, textMetrics) { var padding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; if (fillStyle.texture === Texture.Texture.WHITE && !fillStyle.fill) { var _fillStyle$alpha; return Color.Color.shared.setValue(fillStyle.color).setAlpha((_fillStyle$alpha = fillStyle.alpha) !== null && _fillStyle$alpha !== void 0 ? _fillStyle$alpha : 1).toHexa(); } else if (!fillStyle.fill) { var pattern = context.createPattern(fillStyle.texture.source.resource, "repeat"); var tempMatrix = fillStyle.matrix.copyTo(Matrix.Matrix.shared); tempMatrix.scale(fillStyle.texture.frame.width, fillStyle.texture.frame.height); pattern.setTransform(tempMatrix); return pattern; } else if (fillStyle.fill instanceof FillPattern.FillPattern) { var fillPattern = fillStyle.fill; var _pattern = context.createPattern(fillPattern.texture.source.resource, "repeat"); var _tempMatrix = fillPattern.transform.copyTo(Matrix.Matrix.shared); _tempMatrix.scale(fillPattern.texture.frame.width, fillPattern.texture.frame.height); _pattern.setTransform(_tempMatrix); return _pattern; } else if (fillStyle.fill instanceof FillGradient.FillGradient) { var fillGradient = fillStyle.fill; var isLinear = fillGradient.type === "linear"; var isLocal = fillGradient.textureSpace === "local"; var width = 1; var height = 1; if (isLocal && textMetrics) { width = textMetrics.width + padding; height = textMetrics.height + padding; } var gradient; var isNearlyVertical = false; if (isLinear) { var start = fillGradient.start, end = fillGradient.end; gradient = context.createLinearGradient(start.x * width, start.y * height, end.x * width, end.y * height); isNearlyVertical = Math.abs(end.x - start.x) < Math.abs((end.y - start.y) * 0.1); } else { var center = fillGradient.center, innerRadius = fillGradient.innerRadius, outerCenter = fillGradient.outerCenter, outerRadius = fillGradient.outerRadius; gradient = context.createRadialGradient(center.x * width, center.y * height, innerRadius * width, outerCenter.x * width, outerCenter.y * height, outerRadius * width); } if (isNearlyVertical && isLocal && textMetrics) { var ratio = textMetrics.lineHeight / height; var _loop = function _loop() { var start = (i * textMetrics.lineHeight + padding / 2) / height; fillGradient.colorStops.forEach(function (stop) { var globalStop = start + stop.offset * ratio; gradient.addColorStop( // fix to 5 decimal places to avoid floating point precision issues Math.floor(globalStop * PRECISION) / PRECISION, Color.Color.shared.setValue(stop.color).toHex()); }); }; for (var i = 0; i < textMetrics.lines.length; i++) { _loop(); } } else { fillGradient.colorStops.forEach(function (stop) { gradient.addColorStop(stop.offset, Color.Color.shared.setValue(stop.color).toHex()); }); } return gradient; } warn.warn("FillStyle not recognised", fillStyle); return "red"; } exports.getCanvasFillStyle = getCanvasFillStyle; /***/ }), /***/ 52371: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var Extensions = __webpack_require__(86890); var testVideoFormat = __webpack_require__(82788); "use strict"; var detectWebm = { extension: { type: Extensions.ExtensionType.DetectionParser, priority: 0 }, test: function () { var _test = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: return _context.a(2, testVideoFormat.testVideoFormat("video/webm")); } }, _callee); })); function test() { return _test.apply(this, arguments); } return test; }(), add: function () { var _add = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(formats) { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: return _context2.a(2, [].concat(_toConsumableArray(formats), ["webm"])); } }, _callee2); })); function add(_x) { return _add.apply(this, arguments); } return add; }(), remove: function () { var _remove = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(formats) { return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: return _context3.a(2, formats.filter(function (f) { return f !== "webm"; })); } }, _callee3); })); function remove(_x2) { return _remove.apply(this, arguments); } return remove; }() }; exports.detectWebm = detectWebm; /***/ }), /***/ 52481: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Color = __webpack_require__(98828); var Extensions = __webpack_require__(86890); "use strict"; var _BackgroundSystem = /*#__PURE__*/function () { function _BackgroundSystem() { _classCallCheck(this, _BackgroundSystem); this.clearBeforeRender = true; this._backgroundColor = new Color.Color(0); this.color = this._backgroundColor; this.alpha = 1; } /** * initiates the background system * @param options - the options for the background colors */ return _createClass(_BackgroundSystem, [{ key: "init", value: function init(options) { options = _objectSpread(_objectSpread({}, _BackgroundSystem.defaultOptions), options); this.clearBeforeRender = options.clearBeforeRender; this.color = options.background || options.backgroundColor || this._backgroundColor; this.alpha = options.backgroundAlpha; this._backgroundColor.setAlpha(options.backgroundAlpha); } /** The background color to fill if not transparent */ }, { key: "color", get: function get() { return this._backgroundColor; }, set: function set(value) { this._backgroundColor.setValue(value); } /** The background color alpha. Setting this to 0 will make the canvas transparent. */ }, { key: "alpha", get: function get() { return this._backgroundColor.alpha; }, set: function set(value) { this._backgroundColor.setAlpha(value); } /** The background color as an [R, G, B, A] array. */ }, { key: "colorRgba", get: function get() { return this._backgroundColor.toArray(); } /** * destroys the background system * @internal * @ignore */ }, { key: "destroy", value: function destroy() {} }]); }(); /** @ignore */ _BackgroundSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "background", priority: 0 }; /** default options used by the system */ _BackgroundSystem.defaultOptions = { /** * {@link WebGLOptions.backgroundAlpha} * @default 1 */ backgroundAlpha: 1, /** * {@link WebGLOptions.backgroundColor} * @default 0x000000 */ backgroundColor: 0, /** * {@link WebGLOptions.clearBeforeRender} * @default true */ clearBeforeRender: true }; var BackgroundSystem = _BackgroundSystem; exports.BackgroundSystem = BackgroundSystem; /***/ }), /***/ 52569: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; __webpack_require__(69840); __webpack_require__(23009); __webpack_require__(30263); __webpack_require__(12980); __webpack_require__(28464); __webpack_require__(30496); __webpack_require__(95236); __webpack_require__(60595); __webpack_require__(67478); __webpack_require__(71514); __webpack_require__(48084); __webpack_require__(70784); __webpack_require__(87528); __webpack_require__(51305); "use strict"; /***/ }), /***/ 52874: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Matrix = __webpack_require__(20764); var UniformGroup = __webpack_require__(34400); var getAdjustedBlendModeBlend = __webpack_require__(4794); var State = __webpack_require__(84938); var colorToUniform = __webpack_require__(6455); var ParticleBuffer = __webpack_require__(91743); var ParticleShader = __webpack_require__(70026); "use strict"; var ParticleContainerPipe = /*#__PURE__*/function () { /** * @param renderer - The renderer this sprite batch works for. * @param adaptor */ function ParticleContainerPipe(renderer, adaptor) { _classCallCheck(this, ParticleContainerPipe); this.state = State.State.for2d(); this._gpuBufferHash = /* @__PURE__ */Object.create(null); // eslint-disable-next-line max-len this._destroyRenderableBound = this.destroyRenderable.bind(this); this.localUniforms = new UniformGroup.UniformGroup({ uTranslationMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uColor: { value: new Float32Array(4), type: "vec4<f32>" }, uRound: { value: 1, type: "f32" }, uResolution: { value: [0, 0], type: "vec2<f32>" } }); this.renderer = renderer; this.adaptor = adaptor; this.defaultShader = new ParticleShader.ParticleShader(); this.state = State.State.for2d(); } return _createClass(ParticleContainerPipe, [{ key: "validateRenderable", value: function validateRenderable(_renderable) { return false; } }, { key: "addRenderable", value: function addRenderable(renderable, instructionSet) { this.renderer.renderPipes.batch["break"](instructionSet); instructionSet.add(renderable); } }, { key: "getBuffers", value: function getBuffers(renderable) { return this._gpuBufferHash[renderable.uid] || this._initBuffer(renderable); } }, { key: "_initBuffer", value: function _initBuffer(renderable) { this._gpuBufferHash[renderable.uid] = new ParticleBuffer.ParticleBuffer({ size: renderable.particleChildren.length, properties: renderable._properties }); renderable.on("destroyed", this._destroyRenderableBound); return this._gpuBufferHash[renderable.uid]; } }, { key: "updateRenderable", value: function updateRenderable(_renderable) {} }, { key: "destroyRenderable", value: function destroyRenderable(renderable) { var buffer = this._gpuBufferHash[renderable.uid]; buffer.destroy(); this._gpuBufferHash[renderable.uid] = null; renderable.off("destroyed", this._destroyRenderableBound); } }, { key: "execute", value: function execute(container) { var children = container.particleChildren; if (children.length === 0) { return; } var renderer = this.renderer; var buffer = this.getBuffers(container); container.texture || (container.texture = children[0].texture); var state = this.state; buffer.update(children, container._childrenDirty); container._childrenDirty = false; state.blendMode = getAdjustedBlendModeBlend.getAdjustedBlendModeBlend(container.blendMode, container.texture._source); var uniforms = this.localUniforms.uniforms; var transformationMatrix = uniforms.uTranslationMatrix; container.worldTransform.copyTo(transformationMatrix); transformationMatrix.prepend(renderer.globalUniforms.globalUniformData.projectionMatrix); uniforms.uResolution = renderer.globalUniforms.globalUniformData.resolution; uniforms.uRound = renderer._roundPixels | container._roundPixels; colorToUniform.color32BitToUniform(container.groupColorAlpha, uniforms.uColor, 0); this.adaptor.execute(this, container); } /** Destroys the ParticleRenderer. */ }, { key: "destroy", value: function destroy() { if (this.defaultShader) { this.defaultShader.destroy(); this.defaultShader = null; } } }]); }(); exports.ParticleContainerPipe = ParticleContainerPipe; /***/ }), /***/ 52878: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function nextPow2(v) { v += v === 0 ? 1 : 0; --v; v |= v >>> 1; v |= v >>> 2; v |= v >>> 4; v |= v >>> 8; v |= v >>> 16; return v + 1; } function isPow2(v) { return !(v & v - 1) && !!v; } function log2(v) { var r = (v > 65535 ? 1 : 0) << 4; v >>>= r; var shift = (v > 255 ? 1 : 0) << 3; v >>>= shift; r |= shift; shift = (v > 15 ? 1 : 0) << 2; v >>>= shift; r |= shift; shift = (v > 3 ? 1 : 0) << 1; v >>>= shift; r |= shift; return r | v >> 1; } exports.isPow2 = isPow2; exports.log2 = log2; exports.nextPow2 = nextPow2; /***/ }), /***/ 52962: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; function ContextManager() { this.__contextData__ = {}; } /** * @param {String} key * @returns {*} */ ContextManager.prototype.get = function (key) { return this.__contextData__[key]; }; /** * @param {String} key * @param {*} value * @returns {Context} */ ContextManager.prototype.set = function (key, value) { this.__contextData__[key] = value; return this; }; ContextManager.prototype.assign = function (obj) { Object.assign(this.__contextData__, obj); return this; }; ContextManager.prototype.remove = function (key) { delete this.__contextData__[key]; return this; }; ContextManager.prototype.contains = function (key) { return key in this.__contextData__; }; var _default = exports["default"] = ContextManager; /***/ }), /***/ 53027: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var stylesInDom = {}; var memoize = function (fn) { var memo; return function () { if (typeof memo === "undefined") memo = fn.apply(this, arguments); return memo; }; }; var isOldIE = memoize(function () { // Test for IE <= 9 as proposed by Browserhacks // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 // Tests for existence of standard globals is to allow style-loader // to operate correctly into non-standard environments // @see https://github.com/webpack-contrib/style-loader/issues/177 return window && document && document.all && !window.atob; }); var getTarget = function (target, parent) { if (parent){ return parent.querySelector(target); } return document.querySelector(target); }; var getElement = (function (fn) { var memo = {}; return function(target, parent) { // If passing function in options, then use it for resolve "head" element. // Useful for Shadow Root style i.e // { // insertInto: function () { return document.querySelector("#foo").shadowRoot } // } if (typeof target === 'function') { return target(); } if (typeof memo[target] === "undefined") { var styleTarget = getTarget.call(this, target, parent); // Special case to return head of iframe instead of iframe itself if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { try { // This will throw an exception if access to iframe is blocked // due to cross-origin restrictions styleTarget = styleTarget.contentDocument.head; } catch(e) { styleTarget = null; } } memo[target] = styleTarget; } return memo[target] }; })(); var singleton = null; var singletonCounter = 0; var stylesInsertedAtTop = []; var fixUrls = __webpack_require__(4411); module.exports = function(list, options) { if (typeof DEBUG !== "undefined" && DEBUG) { if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); } options = options || {}; options.attrs = typeof options.attrs === "object" ? options.attrs : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> // tags it will allow on a page if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE(); // By default, add <style> tags to the <head> element if (!options.insertInto) options.insertInto = "head"; // By default, add <style> tags to the bottom of the target if (!options.insertAt) options.insertAt = "bottom"; var styles = listToStyles(list, options); addStylesToDom(styles, options); return function update (newList) { var mayRemove = []; for (var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; domStyle.refs--; mayRemove.push(domStyle); } if(newList) { var newStyles = listToStyles(newList, options); addStylesToDom(newStyles, options); } for (var i = 0; i < mayRemove.length; i++) { var domStyle = mayRemove[i]; if(domStyle.refs === 0) { for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); delete stylesInDom[domStyle.id]; } } }; }; function addStylesToDom (styles, options) { for (var i = 0; i < styles.length; i++) { var item = styles[i]; var domStyle = stylesInDom[item.id]; if(domStyle) { domStyle.refs++; for(var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j](item.parts[j]); } for(; j < item.parts.length; j++) { domStyle.parts.push(addStyle(item.parts[j], options)); } } else { var parts = []; for(var j = 0; j < item.parts.length; j++) { parts.push(addStyle(item.parts[j], options)); } stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; } } } function listToStyles (list, options) { var styles = []; var newStyles = {}; for (var i = 0; i < list.length; i++) { var item = list[i]; var id = options.base ? item[0] + options.base : item[0]; var css = item[1]; var media = item[2]; var sourceMap = item[3]; var part = {css: css, media: media, sourceMap: sourceMap}; if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]}); else newStyles[id].parts.push(part); } return styles; } function insertStyleElement (options, style) { var target = getElement(options.insertInto) if (!target) { throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid."); } var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1]; if (options.insertAt === "top") { if (!lastStyleElementInsertedAtTop) { target.insertBefore(style, target.firstChild); } else if (lastStyleElementInsertedAtTop.nextSibling) { target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling); } else { target.appendChild(style); } stylesInsertedAtTop.push(style); } else if (options.insertAt === "bottom") { target.appendChild(style); } else if (typeof options.insertAt === "object" && options.insertAt.before) { var nextSibling = getElement(options.insertAt.before, target); target.insertBefore(style, nextSibling); } else { throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n"); } } function removeStyleElement (style) { if (style.parentNode === null) return false; style.parentNode.removeChild(style); var idx = stylesInsertedAtTop.indexOf(style); if(idx >= 0) { stylesInsertedAtTop.splice(idx, 1); } } function createStyleElement (options) { var style = document.createElement("style"); if(options.attrs.type === undefined) { options.attrs.type = "text/css"; } if(options.attrs.nonce === undefined) { var nonce = getNonce(); if (nonce) { options.attrs.nonce = nonce; } } addAttrs(style, options.attrs); insertStyleElement(options, style); return style; } function createLinkElement (options) { var link = document.createElement("link"); if(options.attrs.type === undefined) { options.attrs.type = "text/css"; } options.attrs.rel = "stylesheet"; addAttrs(link, options.attrs); insertStyleElement(options, link); return link; } function addAttrs (el, attrs) { Object.keys(attrs).forEach(function (key) { el.setAttribute(key, attrs[key]); }); } function getNonce() { if (false) // removed by dead control flow {} return __webpack_require__.nc; } function addStyle (obj, options) { var style, update, remove, result; // If a transform function was defined, run it on the css if (options.transform && obj.css) { result = typeof options.transform === 'function' ? options.transform(obj.css) : options.transform.default(obj.css); if (result) { // If transform returns a value, use that instead of the original css. // This allows running runtime transformations on the css. obj.css = result; } else { // If the transform function returns a falsy value, don't add this css. // This allows conditional loading of css return function() { // noop }; } } if (options.singleton) { var styleIndex = singletonCounter++; style = singleton || (singleton = createStyleElement(options)); update = applyToSingletonTag.bind(null, style, styleIndex, false); remove = applyToSingletonTag.bind(null, style, styleIndex, true); } else if ( obj.sourceMap && typeof URL === "function" && typeof URL.createObjectURL === "function" && typeof URL.revokeObjectURL === "function" && typeof Blob === "function" && typeof btoa === "function" ) { style = createLinkElement(options); update = updateLink.bind(null, style, options); remove = function () { removeStyleElement(style); if(style.href) URL.revokeObjectURL(style.href); }; } else { style = createStyleElement(options); update = applyToTag.bind(null, style); remove = function () { removeStyleElement(style); }; } update(obj); return function updateStyle (newObj) { if (newObj) { if ( newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap ) { return; } update(obj = newObj); } else { remove(); } }; } var replaceText = (function () { var textStore = []; return function (index, replacement) { textStore[index] = replacement; return textStore.filter(Boolean).join('\n'); }; })(); function applyToSingletonTag (style, index, remove, obj) { var css = remove ? "" : obj.css; if (style.styleSheet) { style.styleSheet.cssText = replaceText(index, css); } else { var cssNode = document.createTextNode(css); var childNodes = style.childNodes; if (childNodes[index]) style.removeChild(childNodes[index]); if (childNodes.length) { style.insertBefore(cssNode, childNodes[index]); } else { style.appendChild(cssNode); } } } function applyToTag (style, obj) { var css = obj.css; var media = obj.media; if(media) { style.setAttribute("media", media) } if(style.styleSheet) { style.styleSheet.cssText = css; } else { while(style.firstChild) { style.removeChild(style.firstChild); } style.appendChild(document.createTextNode(css)); } } function updateLink (link, options, obj) { var css = obj.css; var sourceMap = obj.sourceMap; /* If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled and there is no publicPath defined then lets turn convertToAbsoluteUrls on by default. Otherwise default to the convertToAbsoluteUrls option directly */ var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap; if (options.convertToAbsoluteUrls || autoFixUrls) { css = fixUrls(css); } if (sourceMap) { // http://stackoverflow.com/a/26603875 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; } var blob = new Blob([css], { type: "text/css" }); var oldSrc = link.href; link.href = URL.createObjectURL(blob); if(oldSrc) URL.revokeObjectURL(oldSrc); } /***/ }), /***/ 53248: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var pow2 = __webpack_require__(52878); var TextureSource = __webpack_require__(55406); var Texture = __webpack_require__(73782); "use strict"; var count = 0; var TexturePoolClass = /*#__PURE__*/function () { /** * @param textureOptions - options that will be passed to BaseRenderTexture constructor * @param {SCALE_MODE} [textureOptions.scaleMode] - See {@link SCALE_MODE} for possible values. */ function TexturePoolClass(textureOptions) { _classCallCheck(this, TexturePoolClass); this._poolKeyHash = /* @__PURE__ */Object.create(null); this._texturePool = {}; this.textureOptions = textureOptions || {}; this.enableFullScreen = false; } /** * Creates texture with params that were specified in pool constructor. * @param pixelWidth - Width of texture in pixels. * @param pixelHeight - Height of texture in pixels. * @param antialias */ return _createClass(TexturePoolClass, [{ key: "createTexture", value: function createTexture(pixelWidth, pixelHeight, antialias) { var textureSource = new TextureSource.TextureSource(_objectSpread(_objectSpread({}, this.textureOptions), {}, { width: pixelWidth, height: pixelHeight, resolution: 1, antialias: antialias, autoGarbageCollect: false })); return new Texture.Texture({ source: textureSource, label: "texturePool_".concat(count++) }); } /** * Gets a Power-of-Two render texture or fullScreen texture * @param frameWidth - The minimum width of the render texture. * @param frameHeight - The minimum height of the render texture. * @param resolution - The resolution of the render texture. * @param antialias * @returns The new render texture. */ }, { key: "getOptimalTexture", value: function getOptimalTexture(frameWidth, frameHeight) { var resolution = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; var antialias = arguments.length > 3 ? arguments[3] : undefined; var po2Width = Math.ceil(frameWidth * resolution - 1e-6); var po2Height = Math.ceil(frameHeight * resolution - 1e-6); po2Width = pow2.nextPow2(po2Width); po2Height = pow2.nextPow2(po2Height); var key = (po2Width << 17) + (po2Height << 1) + (antialias ? 1 : 0); if (!this._texturePool[key]) { this._texturePool[key] = []; } var texture = this._texturePool[key].pop(); if (!texture) { texture = this.createTexture(po2Width, po2Height, antialias); } texture.source._resolution = resolution; texture.source.width = po2Width / resolution; texture.source.height = po2Height / resolution; texture.source.pixelWidth = po2Width; texture.source.pixelHeight = po2Height; texture.frame.x = 0; texture.frame.y = 0; texture.frame.width = frameWidth; texture.frame.height = frameHeight; texture.updateUvs(); this._poolKeyHash[texture.uid] = key; return texture; } /** * Gets extra texture of the same size as input renderTexture * @param texture - The texture to check what size it is. * @param antialias - Whether to use antialias. * @returns A texture that is a power of two */ }, { key: "getSameSizeTexture", value: function getSameSizeTexture(texture) { var antialias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var source = texture.source; return this.getOptimalTexture(texture.width, texture.height, source._resolution, antialias); } /** * Place a render texture back into the pool. * @param renderTexture - The renderTexture to free */ }, { key: "returnTexture", value: function returnTexture(renderTexture) { var key = this._poolKeyHash[renderTexture.uid]; this._texturePool[key].push(renderTexture); } /** * Clears the pool. * @param destroyTextures - Destroy all stored textures. */ }, { key: "clear", value: function clear(destroyTextures) { destroyTextures = destroyTextures !== false; if (destroyTextures) { for (var i in this._texturePool) { var textures = this._texturePool[i]; if (textures) { for (var j = 0; j < textures.length; j++) { textures[j].destroy(true); } } } } this._texturePool = {}; } }]); }(); var TexturePool = new TexturePoolClass(); exports.TexturePool = TexturePool; exports.TexturePoolClass = TexturePoolClass; /***/ }), /***/ 53252: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var adapter = __webpack_require__(72450); "use strict"; var supportedGPUCompressedTextureFormats; function getSupportedGPUCompressedTextureFormats() { return _getSupportedGPUCompressedTextureFormats.apply(this, arguments); } function _getSupportedGPUCompressedTextureFormats() { _getSupportedGPUCompressedTextureFormats = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var adapter$1; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!supportedGPUCompressedTextureFormats) { _context.n = 1; break; } return _context.a(2, supportedGPUCompressedTextureFormats); case 1: _context.n = 2; return adapter.DOMAdapter.get().getNavigator().gpu.requestAdapter(); case 2: adapter$1 = _context.v; supportedGPUCompressedTextureFormats = [].concat(_toConsumableArray(adapter$1.features.has("texture-compression-bc") ? [ // BC compressed formats usable if "texture-compression-bc" is both // supported by the device/user agent and enabled in requestDevice. "bc1-rgba-unorm", "bc1-rgba-unorm-srgb", "bc2-rgba-unorm", "bc2-rgba-unorm-srgb", "bc3-rgba-unorm", "bc3-rgba-unorm-srgb", "bc4-r-unorm", "bc4-r-snorm", "bc5-rg-unorm", "bc5-rg-snorm", "bc6h-rgb-ufloat", "bc6h-rgb-float", "bc7-rgba-unorm", "bc7-rgba-unorm-srgb"] : []), _toConsumableArray(adapter$1.features.has("texture-compression-etc2") ? [ // ETC2 compressed formats usable if "texture-compression-etc2" is both // supported by the device/user agent and enabled in requestDevice. "etc2-rgb8unorm", "etc2-rgb8unorm-srgb", "etc2-rgb8a1unorm", "etc2-rgb8a1unorm-srgb", "etc2-rgba8unorm", "etc2-rgba8unorm-srgb", "eac-r11unorm", "eac-r11snorm", "eac-rg11unorm", "eac-rg11snorm"] : []), _toConsumableArray(adapter$1.features.has("texture-compression-astc") ? [ // ASTC compressed formats usable if "texture-compression-astc" is both // supported by the device/user agent and enabled in requestDevice. "astc-4x4-unorm", "astc-4x4-unorm-srgb", "astc-5x4-unorm", "astc-5x4-unorm-srgb", "astc-5x5-unorm", "astc-5x5-unorm-srgb", "astc-6x5-unorm", "astc-6x5-unorm-srgb", "astc-6x6-unorm", "astc-6x6-unorm-srgb", "astc-8x5-unorm", "astc-8x5-unorm-srgb", "astc-8x6-unorm", "astc-8x6-unorm-srgb", "astc-8x8-unorm", "astc-8x8-unorm-srgb", "astc-10x5-unorm", "astc-10x5-unorm-srgb", "astc-10x6-unorm", "astc-10x6-unorm-srgb", "astc-10x8-unorm", "astc-10x8-unorm-srgb", "astc-10x10-unorm", "astc-10x10-unorm-srgb", "astc-12x10-unorm", "astc-12x10-unorm-srgb", "astc-12x12-unorm", "astc-12x12-unorm-srgb"] : [])); return _context.a(2, supportedGPUCompressedTextureFormats); } }, _callee); })); return _getSupportedGPUCompressedTextureFormats.apply(this, arguments); } exports.getSupportedGPUCompressedTextureFormats = getSupportedGPUCompressedTextureFormats; /***/ }), /***/ 53310: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Rectangle = __webpack_require__(74731); var warn = __webpack_require__(57371); var CanvasSource = __webpack_require__(35879); var _const = __webpack_require__(63548); var GlRenderTarget = __webpack_require__(39401); "use strict"; var GlRenderTargetAdaptor = /*#__PURE__*/function () { function GlRenderTargetAdaptor() { _classCallCheck(this, GlRenderTargetAdaptor); this._clearColorCache = [0, 0, 0, 0]; this._viewPortCache = new Rectangle.Rectangle(); } return _createClass(GlRenderTargetAdaptor, [{ key: "init", value: function init(renderer, renderTargetSystem) { this._renderer = renderer; this._renderTargetSystem = renderTargetSystem; renderer.runners.contextChange.add(this); } }, { key: "contextChange", value: function contextChange() { this._clearColorCache = [0, 0, 0, 0]; this._viewPortCache = new Rectangle.Rectangle(); } }, { key: "copyToTexture", value: function copyToTexture(sourceRenderSurfaceTexture, destinationTexture, originSrc, size, originDest) { var renderTargetSystem = this._renderTargetSystem; var renderer = this._renderer; var glRenderTarget = renderTargetSystem.getGpuRenderTarget(sourceRenderSurfaceTexture); var gl = renderer.gl; this.finishRenderPass(sourceRenderSurfaceTexture); gl.bindFramebuffer(gl.FRAMEBUFFER, glRenderTarget.resolveTargetFramebuffer); renderer.texture.bind(destinationTexture, 0); gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, originDest.x, originDest.y, originSrc.x, originSrc.y, size.width, size.height); return destinationTexture; } }, { key: "startRenderPass", value: function startRenderPass(renderTarget) { var _this = this; var clear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var clearColor = arguments.length > 2 ? arguments[2] : undefined; var viewport = arguments.length > 3 ? arguments[3] : undefined; var renderTargetSystem = this._renderTargetSystem; var source = renderTarget.colorTexture; var gpuRenderTarget = renderTargetSystem.getGpuRenderTarget(renderTarget); var viewPortY = viewport.y; if (renderTarget.isRoot) { viewPortY = source.pixelHeight - viewport.height; } renderTarget.colorTextures.forEach(function (texture) { _this._renderer.texture.unbind(texture); }); var gl = this._renderer.gl; gl.bindFramebuffer(gl.FRAMEBUFFER, gpuRenderTarget.framebuffer); var viewPortCache = this._viewPortCache; if (viewPortCache.x !== viewport.x || viewPortCache.y !== viewPortY || viewPortCache.width !== viewport.width || viewPortCache.height !== viewport.height) { viewPortCache.x = viewport.x; viewPortCache.y = viewPortY; viewPortCache.width = viewport.width; viewPortCache.height = viewport.height; gl.viewport(viewport.x, viewPortY, viewport.width, viewport.height); } if (!gpuRenderTarget.depthStencilRenderBuffer && (renderTarget.stencil || renderTarget.depth)) { this._initStencil(gpuRenderTarget); } this.clear(renderTarget, clear, clearColor); } }, { key: "finishRenderPass", value: function finishRenderPass(renderTarget) { var renderTargetSystem = this._renderTargetSystem; var glRenderTarget = renderTargetSystem.getGpuRenderTarget(renderTarget); if (!glRenderTarget.msaa) return; var gl = this._renderer.gl; gl.bindFramebuffer(gl.FRAMEBUFFER, glRenderTarget.resolveTargetFramebuffer); gl.bindFramebuffer(gl.READ_FRAMEBUFFER, glRenderTarget.framebuffer); gl.blitFramebuffer(0, 0, glRenderTarget.width, glRenderTarget.height, 0, 0, glRenderTarget.width, glRenderTarget.height, gl.COLOR_BUFFER_BIT, gl.NEAREST); gl.bindFramebuffer(gl.FRAMEBUFFER, glRenderTarget.framebuffer); } }, { key: "initGpuRenderTarget", value: function initGpuRenderTarget(renderTarget) { var renderer = this._renderer; var gl = renderer.gl; var glRenderTarget = new GlRenderTarget.GlRenderTarget(); var colorTexture = renderTarget.colorTexture; if (CanvasSource.CanvasSource.test(colorTexture.resource)) { this._renderer.context.ensureCanvasSize(renderTarget.colorTexture.resource); glRenderTarget.framebuffer = null; return glRenderTarget; } this._initColor(renderTarget, glRenderTarget); gl.bindFramebuffer(gl.FRAMEBUFFER, null); return glRenderTarget; } }, { key: "destroyGpuRenderTarget", value: function destroyGpuRenderTarget(gpuRenderTarget) { var gl = this._renderer.gl; if (gpuRenderTarget.framebuffer) { gl.deleteFramebuffer(gpuRenderTarget.framebuffer); gpuRenderTarget.framebuffer = null; } if (gpuRenderTarget.resolveTargetFramebuffer) { gl.deleteFramebuffer(gpuRenderTarget.resolveTargetFramebuffer); gpuRenderTarget.resolveTargetFramebuffer = null; } if (gpuRenderTarget.depthStencilRenderBuffer) { gl.deleteRenderbuffer(gpuRenderTarget.depthStencilRenderBuffer); gpuRenderTarget.depthStencilRenderBuffer = null; } gpuRenderTarget.msaaRenderBuffer.forEach(function (renderBuffer) { gl.deleteRenderbuffer(renderBuffer); }); gpuRenderTarget.msaaRenderBuffer = null; } }, { key: "clear", value: function clear(_renderTarget, _clear, clearColor) { if (!_clear) return; var renderTargetSystem = this._renderTargetSystem; if (typeof _clear === "boolean") { _clear = _clear ? _const.CLEAR.ALL : _const.CLEAR.NONE; } var gl = this._renderer.gl; if (_clear & _const.CLEAR.COLOR) { clearColor !== null && clearColor !== void 0 ? clearColor : clearColor = renderTargetSystem.defaultClearColor; var clearColorCache = this._clearColorCache; var clearColorArray = clearColor; if (clearColorCache[0] !== clearColorArray[0] || clearColorCache[1] !== clearColorArray[1] || clearColorCache[2] !== clearColorArray[2] || clearColorCache[3] !== clearColorArray[3]) { clearColorCache[0] = clearColorArray[0]; clearColorCache[1] = clearColorArray[1]; clearColorCache[2] = clearColorArray[2]; clearColorCache[3] = clearColorArray[3]; gl.clearColor(clearColorArray[0], clearColorArray[1], clearColorArray[2], clearColorArray[3]); } } gl.clear(_clear); } }, { key: "resizeGpuRenderTarget", value: function resizeGpuRenderTarget(renderTarget) { if (renderTarget.isRoot) return; var renderTargetSystem = this._renderTargetSystem; var glRenderTarget = renderTargetSystem.getGpuRenderTarget(renderTarget); this._resizeColor(renderTarget, glRenderTarget); if (renderTarget.stencil || renderTarget.depth) { this._resizeStencil(glRenderTarget); } } }, { key: "_initColor", value: function _initColor(renderTarget, glRenderTarget) { var renderer = this._renderer; var gl = renderer.gl; var resolveTargetFramebuffer = gl.createFramebuffer(); glRenderTarget.resolveTargetFramebuffer = resolveTargetFramebuffer; gl.bindFramebuffer(gl.FRAMEBUFFER, resolveTargetFramebuffer); glRenderTarget.width = renderTarget.colorTexture.source.pixelWidth; glRenderTarget.height = renderTarget.colorTexture.source.pixelHeight; renderTarget.colorTextures.forEach(function (colorTexture, i) { var source = colorTexture.source; if (source.antialias) { if (renderer.context.supports.msaa) { glRenderTarget.msaa = true; } else { warn.warn("[RenderTexture] Antialiasing on textures is not supported in WebGL1"); } } renderer.texture.bindSource(source, 0); var glSource = renderer.texture.getGlSource(source); var glTexture = glSource.texture; gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, 3553, // texture.target, glTexture, 0); }); if (glRenderTarget.msaa) { var viewFramebuffer = gl.createFramebuffer(); glRenderTarget.framebuffer = viewFramebuffer; gl.bindFramebuffer(gl.FRAMEBUFFER, viewFramebuffer); renderTarget.colorTextures.forEach(function (_, i) { var msaaRenderBuffer = gl.createRenderbuffer(); glRenderTarget.msaaRenderBuffer[i] = msaaRenderBuffer; }); } else { glRenderTarget.framebuffer = resolveTargetFramebuffer; } this._resizeColor(renderTarget, glRenderTarget); } }, { key: "_resizeColor", value: function _resizeColor(renderTarget, glRenderTarget) { var source = renderTarget.colorTexture.source; glRenderTarget.width = source.pixelWidth; glRenderTarget.height = source.pixelHeight; renderTarget.colorTextures.forEach(function (colorTexture, i) { if (i === 0) return; colorTexture.source.resize(source.width, source.height, source._resolution); }); if (glRenderTarget.msaa) { var renderer = this._renderer; var gl = renderer.gl; var viewFramebuffer = glRenderTarget.framebuffer; gl.bindFramebuffer(gl.FRAMEBUFFER, viewFramebuffer); renderTarget.colorTextures.forEach(function (colorTexture, i) { var source2 = colorTexture.source; renderer.texture.bindSource(source2, 0); var glSource = renderer.texture.getGlSource(source2); var glInternalFormat = glSource.internalFormat; var msaaRenderBuffer = glRenderTarget.msaaRenderBuffer[i]; gl.bindRenderbuffer(gl.RENDERBUFFER, msaaRenderBuffer); gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, glInternalFormat, source2.pixelWidth, source2.pixelHeight); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, gl.RENDERBUFFER, msaaRenderBuffer); }); } } }, { key: "_initStencil", value: function _initStencil(glRenderTarget) { if (glRenderTarget.framebuffer === null) return; var gl = this._renderer.gl; var depthStencilRenderBuffer = gl.createRenderbuffer(); glRenderTarget.depthStencilRenderBuffer = depthStencilRenderBuffer; gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilRenderBuffer); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilRenderBuffer); this._resizeStencil(glRenderTarget); } }, { key: "_resizeStencil", value: function _resizeStencil(glRenderTarget) { var gl = this._renderer.gl; gl.bindRenderbuffer(gl.RENDERBUFFER, glRenderTarget.depthStencilRenderBuffer); if (glRenderTarget.msaa) { gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.DEPTH24_STENCIL8, glRenderTarget.width, glRenderTarget.height); } else { gl.renderbufferStorage(gl.RENDERBUFFER, this._renderer.context.webGLVersion === 2 ? gl.DEPTH24_STENCIL8 : gl.DEPTH_STENCIL, glRenderTarget.width, glRenderTarget.height); } } }, { key: "prerender", value: function prerender(renderTarget) { var resource = renderTarget.colorTexture.resource; if (this._renderer.context.multiView && CanvasSource.CanvasSource.test(resource)) { this._renderer.context.ensureCanvasSize(resource); } } }, { key: "postrender", value: function postrender(renderTarget) { if (!this._renderer.context.multiView) return; if (CanvasSource.CanvasSource.test(renderTarget.colorTexture.resource)) { var contextCanvas = this._renderer.context.canvas; var canvasSource = renderTarget.colorTexture; canvasSource.context2D.drawImage(contextCanvas, 0, canvasSource.pixelHeight - contextCanvas.height); } } }]); }(); exports.GlRenderTargetAdaptor = GlRenderTargetAdaptor; /***/ }), /***/ 53626: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var State = __webpack_require__(84938); var getTextureBatchBindGroup = __webpack_require__(62340); "use strict"; var tempState = State.State.for2d(); var GpuBatchAdaptor = /*#__PURE__*/function () { function GpuBatchAdaptor() { _classCallCheck(this, GpuBatchAdaptor); } return _createClass(GpuBatchAdaptor, [{ key: "start", value: function start(batchPipe, geometry, shader) { var renderer = batchPipe.renderer; var encoder = renderer.encoder; var program = shader.gpuProgram; this._shader = shader; this._geometry = geometry; encoder.setGeometry(geometry, program); tempState.blendMode = "normal"; renderer.pipeline.getPipeline(geometry, program, tempState); var globalUniformsBindGroup = renderer.globalUniforms.bindGroup; encoder.resetBindGroup(1); encoder.setBindGroup(0, globalUniformsBindGroup, program); } }, { key: "execute", value: function execute(batchPipe, batch) { var program = this._shader.gpuProgram; var renderer = batchPipe.renderer; var encoder = renderer.encoder; if (!batch.bindGroup) { var textureBatch = batch.textures; batch.bindGroup = getTextureBatchBindGroup.getTextureBatchBindGroup(textureBatch.textures, textureBatch.count); } tempState.blendMode = batch.blendMode; var gpuBindGroup = renderer.bindGroup.getBindGroup(batch.bindGroup, program, 1); var pipeline = renderer.pipeline.getPipeline(this._geometry, program, tempState, batch.topology); batch.bindGroup._touch(renderer.textureGC.count); encoder.setPipeline(pipeline); encoder.renderPassEncoder.setBindGroup(1, gpuBindGroup); encoder.renderPassEncoder.drawIndexed(batch.size, 1, batch.start); } }]); }(); /** @ignore */ GpuBatchAdaptor.extension = { type: [Extensions.ExtensionType.WebGPUPipesAdaptor], name: "batch" }; exports.GpuBatchAdaptor = GpuBatchAdaptor; /***/ }), /***/ 53659: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var fragment = "\nin vec2 vTextureCoord;\nin vec2 vFilterUv;\n\nout vec4 finalColor;\n\nuniform sampler2D uTexture;\nuniform sampler2D uMapTexture;\n\nuniform vec4 uInputClamp;\nuniform highp vec4 uInputSize;\nuniform mat2 uRotation;\nuniform vec2 uScale;\n\nvoid main()\n{\n vec4 map = texture(uMapTexture, vFilterUv);\n \n vec2 offset = uInputSize.zw * (uRotation * (map.xy - 0.5)) * uScale; \n\n finalColor = texture(uTexture, clamp(vTextureCoord + offset, uInputClamp.xy, uInputClamp.zw));\n}\n"; exports["default"] = fragment; /***/ }), /***/ 53932: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var squaredDistanceToLineSegment = __webpack_require__(34060); var Rectangle = __webpack_require__(74731); "use strict"; var tempRect; var tempRect2; var Polygon = /*#__PURE__*/function () { /** * @param points - This can be an array of Points * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or * the arguments passed can be all the points of the polygon e.g. * `new Polygon(new Point(), new Point(), ...)`, or the arguments passed can be flat * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers. */ function Polygon() { _classCallCheck(this, Polygon); /** * The type of the object, mainly used to avoid `instanceof` checks * @default 'polygon' */ this.type = "polygon"; for (var _len = arguments.length, points = new Array(_len), _key = 0; _key < _len; _key++) { points[_key] = arguments[_key]; } var flat = Array.isArray(points[0]) ? points[0] : points; if (typeof flat[0] !== "number") { var p = []; for (var i = 0, il = flat.length; i < il; i++) { p.push(flat[i].x, flat[i].y); } flat = p; } this.points = flat; this.closePath = true; } /** * Determines whether the polygon's points are arranged in a clockwise direction. * This is calculated using the "shoelace formula" (also known as surveyor's formula) to find the signed area. * A positive area indicates clockwise winding, while negative indicates counter-clockwise. * * The formula sums up the cross products of adjacent vertices: * For each pair of adjacent points (x1,y1) and (x2,y2), we calculate (x1*y2 - x2*y1) * The final sum divided by 2 gives the signed area - positive for clockwise. * @returns `true` if the polygon's points are arranged clockwise, `false` if counter-clockwise */ return _createClass(Polygon, [{ key: "isClockwise", value: function isClockwise() { var area = 0; var points = this.points; var length = points.length; for (var i = 0; i < length; i += 2) { var x1 = points[i]; var y1 = points[i + 1]; var x2 = points[(i + 2) % length]; var y2 = points[(i + 3) % length]; area += (x2 - x1) * (y2 + y1); } return area < 0; } /** * Checks if this polygon completely contains another polygon. * * This is useful for detecting holes in shapes, like when parsing SVG paths. * For example, if you have two polygons: * ```ts * const outerSquare = new Polygon([0,0, 100,0, 100,100, 0,100]); // A square * const innerSquare = new Polygon([25,25, 75,25, 75,75, 25,75]); // A smaller square inside * * outerSquare.containsPolygon(innerSquare); // Returns true * innerSquare.containsPolygon(outerSquare); // Returns false * ``` * @param polygon - The polygon to test for containment * @returns True if this polygon completely contains the other polygon */ }, { key: "containsPolygon", value: function containsPolygon(polygon) { var thisBounds = this.getBounds(tempRect); var otherBounds = polygon.getBounds(tempRect2); if (!thisBounds.containsRect(otherBounds)) { return false; } var points = polygon.points; for (var i = 0; i < points.length; i += 2) { var x = points[i]; var y = points[i + 1]; if (!this.contains(x, y)) { return false; } } return true; } /** * Creates a clone of this polygon. * @returns - A copy of the polygon. */ }, { key: "clone", value: function clone() { var points = this.points.slice(); var polygon = new Polygon(points); polygon.closePath = this.closePath; return polygon; } /** * Checks whether the x and y coordinates passed to this function are contained within this polygon. * @param x - The X coordinate of the point to test. * @param y - The Y coordinate of the point to test. * @returns - Whether the x/y coordinates are within this polygon. */ }, { key: "contains", value: function contains(x, y) { var inside = false; var length = this.points.length / 2; for (var i = 0, j = length - 1; i < length; j = i++) { var xi = this.points[i * 2]; var yi = this.points[i * 2 + 1]; var xj = this.points[j * 2]; var yj = this.points[j * 2 + 1]; var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi; if (intersect) { inside = !inside; } } return inside; } /** * Checks whether the x and y coordinates given are contained within this polygon including the stroke. * @param x - The X coordinate of the point to test * @param y - The Y coordinate of the point to test * @param strokeWidth - The width of the line to check * @param alignment - The alignment of the stroke, 0.5 by default * @returns Whether the x/y coordinates are within this polygon */ }, { key: "strokeContains", value: function strokeContains(x, y, strokeWidth) { var alignment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5; var strokeWidthSquared = strokeWidth * strokeWidth; var rightWidthSquared = strokeWidthSquared * (1 - alignment); var leftWidthSquared = strokeWidthSquared - rightWidthSquared; var points = this.points; var iterationLength = points.length - (this.closePath ? 0 : 2); for (var i = 0; i < iterationLength; i += 2) { var x1 = points[i]; var y1 = points[i + 1]; var x2 = points[(i + 2) % points.length]; var y2 = points[(i + 3) % points.length]; var distanceSquared = squaredDistanceToLineSegment.squaredDistanceToLineSegment(x, y, x1, y1, x2, y2); var sign = Math.sign((x2 - x1) * (y - y1) - (y2 - y1) * (x - x1)); if (distanceSquared <= (sign < 0 ? leftWidthSquared : rightWidthSquared)) { return true; } } return false; } /** * Returns the framing rectangle of the polygon as a Rectangle object * @param out - optional rectangle to store the result * @returns The framing rectangle */ }, { key: "getBounds", value: function getBounds(out) { out || (out = new Rectangle.Rectangle()); var points = this.points; var minX = Infinity; var maxX = -Infinity; var minY = Infinity; var maxY = -Infinity; for (var i = 0, n = points.length; i < n; i += 2) { var x = points[i]; var y = points[i + 1]; minX = x < minX ? x : minX; maxX = x > maxX ? x : maxX; minY = y < minY ? y : minY; maxY = y > maxY ? y : maxY; } out.x = minX; out.width = maxX - minX; out.y = minY; out.height = maxY - minY; return out; } /** * Copies another polygon to this one. * @param polygon - The polygon to copy from. * @returns Returns itself. */ }, { key: "copyFrom", value: function copyFrom(polygon) { this.points = polygon.points.slice(); this.closePath = polygon.closePath; return this; } /** * Copies this polygon to another one. * @param polygon - The polygon to copy to. * @returns Returns given parameter. */ }, { key: "copyTo", value: function copyTo(polygon) { polygon.copyFrom(this); return polygon; } }, { key: "toString", value: function toString() { return "[pixi.js/math:PolygoncloseStroke=".concat(this.closePath, "points=").concat(this.points.reduce(function (pointsDesc, currentPoint) { return "".concat(pointsDesc, ", ").concat(currentPoint); }, ""), "]"); } /** * Get the last X coordinate of the polygon * @readonly */ }, { key: "lastX", get: function get() { return this.points[this.points.length - 2]; } /** * Get the last Y coordinate of the polygon * @readonly */ }, { key: "lastY", get: function get() { return this.points[this.points.length - 1]; } /** * Get the first X coordinate of the polygon * @readonly */ }, { key: "x", get: function get() { return this.points[this.points.length - 2]; } /** * Get the first Y coordinate of the polygon * @readonly */ }, { key: "y", get: function get() { return this.points[this.points.length - 1]; } }]); }(); exports.Polygon = Polygon; /***/ }), /***/ 53976: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _AElementNS = _interopRequireDefault(__webpack_require__(34073)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } var _default = exports["default"] = _AElementNS["default"]; /***/ }), /***/ 54080: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var warn = __webpack_require__(57371); var path = __webpack_require__(30710); var convertToList = __webpack_require__(28097); var createStringVariations = __webpack_require__(24500); var isSingleItem = __webpack_require__(91208); "use strict"; var Resolver = /*#__PURE__*/function () { function Resolver() { var _this = this; _classCallCheck(this, Resolver); this._defaultBundleIdentifierOptions = { connector: "-", createBundleAssetId: function createBundleAssetId(bundleId, assetId) { return "".concat(bundleId).concat(_this._bundleIdConnector).concat(assetId); }, extractAssetIdFromBundle: function extractAssetIdFromBundle(bundleId, assetBundleId) { return assetBundleId.replace("".concat(bundleId).concat(_this._bundleIdConnector), ""); } }; /** The character that is used to connect the bundleId and the assetId when generating a bundle asset id key */ this._bundleIdConnector = this._defaultBundleIdentifierOptions.connector; /** * A function that generates a bundle asset id key from a bundleId and an assetId * @param bundleId - the bundleId * @param assetId - the assetId * @returns the bundle asset id key */ this._createBundleAssetId = this._defaultBundleIdentifierOptions.createBundleAssetId; /** * A function that generates an assetId from a bundle asset id key. This is the reverse of generateBundleAssetId * @param bundleId - the bundleId * @param assetBundleId - the bundle asset id key * @returns the assetId */ this._extractAssetIdFromBundle = this._defaultBundleIdentifierOptions.extractAssetIdFromBundle; this._assetMap = {}; this._preferredOrder = []; this._parsers = []; this._resolverHash = {}; this._bundles = {}; } /** * Override how the resolver deals with generating bundle ids. * must be called before any bundles are added * @param bundleIdentifier - the bundle identifier options */ return _createClass(Resolver, [{ key: "setBundleIdentifier", value: function setBundleIdentifier(bundleIdentifier) { var _bundleIdentifier$con, _bundleIdentifier$cre, _bundleIdentifier$ext; this._bundleIdConnector = (_bundleIdentifier$con = bundleIdentifier.connector) !== null && _bundleIdentifier$con !== void 0 ? _bundleIdentifier$con : this._bundleIdConnector; this._createBundleAssetId = (_bundleIdentifier$cre = bundleIdentifier.createBundleAssetId) !== null && _bundleIdentifier$cre !== void 0 ? _bundleIdentifier$cre : this._createBundleAssetId; this._extractAssetIdFromBundle = (_bundleIdentifier$ext = bundleIdentifier.extractAssetIdFromBundle) !== null && _bundleIdentifier$ext !== void 0 ? _bundleIdentifier$ext : this._extractAssetIdFromBundle; if (this._extractAssetIdFromBundle("foo", this._createBundleAssetId("foo", "bar")) !== "bar") { throw new Error("[Resolver] GenerateBundleAssetId are not working correctly"); } } /** * Let the resolver know which assets you prefer to use when resolving assets. * Multiple prefer user defined rules can be added. * @example * resolver.prefer({ * // first look for something with the correct format, and then then correct resolution * priority: ['format', 'resolution'], * params:{ * format:'webp', // prefer webp images * resolution: 2, // prefer a resolution of 2 * } * }) * resolver.add('foo', ['bar@2x.webp', 'bar@2x.png', 'bar.webp', 'bar.png']); * resolver.resolveUrl('foo') // => 'bar@2x.webp' * @param preferOrders - the prefer options */ }, { key: "prefer", value: function prefer() { var _this2 = this; for (var _len = arguments.length, preferOrders = new Array(_len), _key = 0; _key < _len; _key++) { preferOrders[_key] = arguments[_key]; } preferOrders.forEach(function (prefer) { _this2._preferredOrder.push(prefer); if (!prefer.priority) { prefer.priority = Object.keys(prefer.params); } }); this._resolverHash = {}; } /** * Set the base path to prepend to all urls when resolving * @example * resolver.basePath = 'https://home.com/'; * resolver.add('foo', 'bar.ong'); * resolver.resolveUrl('foo', 'bar.png'); // => 'https://home.com/bar.png' * @param basePath - the base path to use */ }, { key: "basePath", get: function get() { return this._basePath; } /** * Set the root path for root-relative URLs. By default the `basePath`'s root is used. If no `basePath` is set, then the * default value for browsers is `window.location.origin` * @example * // Application hosted on https://home.com/some-path/index.html * resolver.basePath = 'https://home.com/some-path/'; * resolver.rootPath = 'https://home.com/'; * resolver.add('foo', '/bar.png'); * resolver.resolveUrl('foo', '/bar.png'); // => 'https://home.com/bar.png' * @param rootPath - the root path to use */, set: function set(basePath) { this._basePath = basePath; } }, { key: "rootPath", get: function get() { return this._rootPath; } /** * All the active URL parsers that help the parser to extract information and create * an asset object-based on parsing the URL itself. * * Can be added using the extensions API * @example * resolver.add('foo', [ * { * resolution: 2, * format: 'png', * src: 'image@2x.png', * }, * { * resolution:1, * format:'png', * src: 'image.png', * }, * ]); * * // With a url parser the information such as resolution and file format could extracted from the url itself: * extensions.add({ * extension: ExtensionType.ResolveParser, * test: loadTextures.test, // test if url ends in an image * parse: (value: string) => * ({ * resolution: parseFloat(Resolver.RETINA_PREFIX.exec(value)?.[1] ?? '1'), * format: value.split('.').pop(), * src: value, * }), * }); * * // Now resolution and format can be extracted from the url * resolver.add('foo', [ * 'image@2x.png', * 'image.png', * ]); */, set: function set(rootPath) { this._rootPath = rootPath; } }, { key: "parsers", get: function get() { return this._parsers; } /** Used for testing, this resets the resolver to its initial state */ }, { key: "reset", value: function reset() { this.setBundleIdentifier(this._defaultBundleIdentifierOptions); this._assetMap = {}; this._preferredOrder = []; this._resolverHash = {}; this._rootPath = null; this._basePath = null; this._manifest = null; this._bundles = {}; this._defaultSearchParams = null; } /** * Sets the default URL search parameters for the URL resolver. The urls can be specified as a string or an object. * @param searchParams - the default url parameters to append when resolving urls */ }, { key: "setDefaultSearchParams", value: function setDefaultSearchParams(searchParams) { if (typeof searchParams === "string") { this._defaultSearchParams = searchParams; } else { var queryValues = searchParams; this._defaultSearchParams = Object.keys(queryValues).map(function (key) { return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(queryValues[key])); }).join("&"); } } /** * Returns the aliases for a given asset * @param asset - the asset to get the aliases for */ }, { key: "getAlias", value: function getAlias(asset) { var alias = asset.alias, src = asset.src; var aliasesToUse = convertToList.convertToList(alias || src, function (value) { if (typeof value === "string") return value; if (Array.isArray(value)) return value.map(function (v) { var _v$src; return (_v$src = v === null || v === void 0 ? void 0 : v.src) !== null && _v$src !== void 0 ? _v$src : v; }); if (value !== null && value !== void 0 && value.src) return value.src; return value; }, true); return aliasesToUse; } /** * Add a manifest to the asset resolver. This is a nice way to add all the asset information in one go. * generally a manifest would be built using a tool. * @param manifest - the manifest to add to the resolver */ }, { key: "addManifest", value: function addManifest(manifest) { var _this3 = this; if (this._manifest) { warn.warn("[Resolver] Manifest already exists, this will be overwritten"); } this._manifest = manifest; manifest.bundles.forEach(function (bundle) { _this3.addBundle(bundle.name, bundle.assets); }); } /** * This adds a bundle of assets in one go so that you can resolve them as a group. * For example you could add a bundle for each screen in you pixi app * @example * resolver.addBundle('animals', [ * { alias: 'bunny', src: 'bunny.png' }, * { alias: 'chicken', src: 'chicken.png' }, * { alias: 'thumper', src: 'thumper.png' }, * ]); * // or * resolver.addBundle('animals', { * bunny: 'bunny.png', * chicken: 'chicken.png', * thumper: 'thumper.png', * }); * * const resolvedAssets = await resolver.resolveBundle('animals'); * @param bundleId - The id of the bundle to add * @param assets - A record of the asset or assets that will be chosen from when loading via the specified key */ }, { key: "addBundle", value: function addBundle(bundleId, assets) { var _this4 = this; var assetNames = []; var convertedAssets = assets; if (!Array.isArray(assets)) { convertedAssets = Object.entries(assets).map(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), alias = _ref2[0], src = _ref2[1]; if (typeof src === "string" || Array.isArray(src)) { return { alias: alias, src: src }; } return _objectSpread({ alias: alias }, src); }); } convertedAssets.forEach(function (asset) { var srcs = asset.src; var aliases = asset.alias; var ids; if (typeof aliases === "string") { var bundleAssetId = _this4._createBundleAssetId(bundleId, aliases); assetNames.push(bundleAssetId); ids = [aliases, bundleAssetId]; } else { var bundleIds = aliases.map(function (name) { return _this4._createBundleAssetId(bundleId, name); }); assetNames.push.apply(assetNames, _toConsumableArray(bundleIds)); ids = [].concat(_toConsumableArray(aliases), _toConsumableArray(bundleIds)); } _this4.add(_objectSpread(_objectSpread({}, asset), { alias: ids, src: srcs })); }); this._bundles[bundleId] = assetNames; } /** * Tells the resolver what keys are associated with witch asset. * The most important thing the resolver does * @example * // Single key, single asset: * resolver.add({alias: 'foo', src: 'bar.png'); * resolver.resolveUrl('foo') // => 'bar.png' * * // Multiple keys, single asset: * resolver.add({alias: ['foo', 'boo'], src: 'bar.png'}); * resolver.resolveUrl('foo') // => 'bar.png' * resolver.resolveUrl('boo') // => 'bar.png' * * // Multiple keys, multiple assets: * resolver.add({alias: ['foo', 'boo'], src: ['bar.png', 'bar.webp']}); * resolver.resolveUrl('foo') // => 'bar.png' * * // Add custom data attached to the resolver * Resolver.add({ * alias: 'bunnyBooBooSmooth', * src: 'bunny{png,webp}', * data: { scaleMode:SCALE_MODES.NEAREST }, // Base texture options * }); * * resolver.resolve('bunnyBooBooSmooth') // => { src: 'bunny.png', data: { scaleMode: SCALE_MODES.NEAREST } } * @param aliases - the UnresolvedAsset or array of UnresolvedAssets to add to the resolver */ }, { key: "add", value: function add(aliases) { var _this5 = this; var assets = []; if (Array.isArray(aliases)) { assets.push.apply(assets, _toConsumableArray(aliases)); } else { assets.push(aliases); } var keyCheck; keyCheck = function keyCheck(key) { if (_this5.hasKey(key)) { warn.warn("[Resolver] already has key: ".concat(key, " overwriting")); } }; var assetArray = convertToList.convertToList(assets); assetArray.forEach(function (asset) { var src = asset.src; var data = asset.data, format = asset.format, loadParser = asset.loadParser; var srcsToUse = convertToList.convertToList(src).map(function (src2) { if (typeof src2 === "string") { return createStringVariations.createStringVariations(src2); } return Array.isArray(src2) ? src2 : [src2]; }); var aliasesToUse = _this5.getAlias(asset); Array.isArray(aliasesToUse) ? aliasesToUse.forEach(keyCheck) : keyCheck(aliasesToUse); var resolvedAssets = []; srcsToUse.forEach(function (srcs) { srcs.forEach(function (src2) { var formattedAsset = {}; if (_typeof(src2) !== "object") { formattedAsset.src = src2; for (var i = 0; i < _this5._parsers.length; i++) { var parser = _this5._parsers[i]; if (parser.test(src2)) { formattedAsset = parser.parse(src2); break; } } } else { var _src2$data, _src2$format, _src2$loadParser; data = (_src2$data = src2.data) !== null && _src2$data !== void 0 ? _src2$data : data; format = (_src2$format = src2.format) !== null && _src2$format !== void 0 ? _src2$format : format; loadParser = (_src2$loadParser = src2.loadParser) !== null && _src2$loadParser !== void 0 ? _src2$loadParser : loadParser; formattedAsset = _objectSpread(_objectSpread({}, formattedAsset), src2); } if (!aliasesToUse) { throw new Error("[Resolver] alias is undefined for this asset: ".concat(formattedAsset.src)); } formattedAsset = _this5._buildResolvedAsset(formattedAsset, { aliases: aliasesToUse, data: data, format: format, loadParser: loadParser }); resolvedAssets.push(formattedAsset); }); }); aliasesToUse.forEach(function (alias) { _this5._assetMap[alias] = resolvedAssets; }); }); } // TODO: this needs an overload like load did in Assets /** * If the resolver has had a manifest set via setManifest, this will return the assets urls for * a given bundleId or bundleIds. * @example * // Manifest Example * const manifest = { * bundles: [ * { * name: 'load-screen', * assets: [ * { * alias: 'background', * src: 'sunset.png', * }, * { * alias: 'bar', * src: 'load-bar.{png,webp}', * }, * ], * }, * { * name: 'game-screen', * assets: [ * { * alias: 'character', * src: 'robot.png', * }, * { * alias: 'enemy', * src: 'bad-guy.png', * }, * ], * }, * ] * }; * * resolver.setManifest(manifest); * const resolved = resolver.resolveBundle('load-screen'); * @param bundleIds - The bundle ids to resolve * @returns All the bundles assets or a hash of assets for each bundle specified */ }, { key: "resolveBundle", value: function resolveBundle(bundleIds) { var _this6 = this; var singleAsset = isSingleItem.isSingleItem(bundleIds); bundleIds = convertToList.convertToList(bundleIds); var out = {}; bundleIds.forEach(function (bundleId) { var assetNames = _this6._bundles[bundleId]; if (assetNames) { var results = _this6.resolve(assetNames); var assets = {}; for (var key in results) { var asset = results[key]; assets[_this6._extractAssetIdFromBundle(bundleId, key)] = asset; } out[bundleId] = assets; } }); return singleAsset ? out[bundleIds[0]] : out; } /** * Does exactly what resolve does, but returns just the URL rather than the whole asset object * @param key - The key or keys to resolve * @returns - The URLs associated with the key(s) */ }, { key: "resolveUrl", value: function resolveUrl(key) { var result = this.resolve(key); if (typeof key !== "string") { var out = {}; for (var i in result) { out[i] = result[i].src; } return out; } return result.src; } }, { key: "resolve", value: function resolve(keys) { var _this7 = this; var singleAsset = isSingleItem.isSingleItem(keys); keys = convertToList.convertToList(keys); var result = {}; keys.forEach(function (key) { if (!_this7._resolverHash[key]) { if (_this7._assetMap[key]) { var assets = _this7._assetMap[key]; var preferredOrder = _this7._getPreferredOrder(assets); preferredOrder === null || preferredOrder === void 0 || preferredOrder.priority.forEach(function (priorityKey) { preferredOrder.params[priorityKey].forEach(function (value) { var filteredAssets = assets.filter(function (asset) { if (asset[priorityKey]) { return asset[priorityKey] === value; } return false; }); if (filteredAssets.length) { assets = filteredAssets; } }); }); _this7._resolverHash[key] = assets[0]; } else { _this7._resolverHash[key] = _this7._buildResolvedAsset({ alias: [key], src: key }, {}); } } result[key] = _this7._resolverHash[key]; }); return singleAsset ? result[keys[0]] : result; } /** * Checks if an asset with a given key exists in the resolver * @param key - The key of the asset */ }, { key: "hasKey", value: function hasKey(key) { return !!this._assetMap[key]; } /** * Checks if a bundle with the given key exists in the resolver * @param key - The key of the bundle */ }, { key: "hasBundle", value: function hasBundle(key) { return !!this._bundles[key]; } /** * Internal function for figuring out what prefer criteria an asset should use. * @param assets */ }, { key: "_getPreferredOrder", value: function _getPreferredOrder(assets) { var _this8 = this; var _loop = function _loop() { var asset = assets[i]; var preferred = _this8._preferredOrder.find(function (preference) { return preference.params.format.includes(asset.format); }); if (preferred) { return { v: preferred }; } }, _ret; for (var i = 0; i < assets.length; i++) { _ret = _loop(); if (_ret) return _ret.v; } return this._preferredOrder[0]; } /** * Appends the default url parameters to the url * @param url - The url to append the default parameters to * @returns - The url with the default parameters appended */ }, { key: "_appendDefaultSearchParams", value: function _appendDefaultSearchParams(url) { if (!this._defaultSearchParams) return url; var paramConnector = /\?/.test(url) ? "&" : "?"; return "".concat(url).concat(paramConnector).concat(this._defaultSearchParams); } }, { key: "_buildResolvedAsset", value: function _buildResolvedAsset(formattedAsset, data) { var _ref3, _ref4; var aliases = data.aliases, assetData = data.data, loadParser = data.loadParser, format = data.format; if (this._basePath || this._rootPath) { formattedAsset.src = path.path.toAbsolute(formattedAsset.src, this._basePath, this._rootPath); } formattedAsset.alias = (_ref3 = aliases !== null && aliases !== void 0 ? aliases : formattedAsset.alias) !== null && _ref3 !== void 0 ? _ref3 : [formattedAsset.src]; formattedAsset.src = this._appendDefaultSearchParams(formattedAsset.src); formattedAsset.data = _objectSpread(_objectSpread({}, assetData || {}), formattedAsset.data); formattedAsset.loadParser = loadParser !== null && loadParser !== void 0 ? loadParser : formattedAsset.loadParser; formattedAsset.format = (_ref4 = format !== null && format !== void 0 ? format : formattedAsset.format) !== null && _ref4 !== void 0 ? _ref4 : getUrlExtension(formattedAsset.src); return formattedAsset; } }]); }(); /** * The prefix that denotes a URL is for a retina asset. * @static * @name RETINA_PREFIX * @type {RegExp} * @default /@([0-9\.]+)x/ * @example `@2x` */ Resolver.RETINA_PREFIX = /@([0-9\.]+)x/; function getUrlExtension(url) { return url.split(".").pop().split("?").shift().split("#").shift(); } exports.Resolver = Resolver; exports.getUrlExtension = getUrlExtension; /***/ }), /***/ 54122: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Rectangle = __webpack_require__(74731); "use strict"; var isCornerWithinStroke = function isCornerWithinStroke(pX, pY, cornerX, cornerY, radius, strokeWidthInner, strokeWidthOuter) { var dx = pX - cornerX; var dy = pY - cornerY; var distance = Math.sqrt(dx * dx + dy * dy); return distance >= radius - strokeWidthInner && distance <= radius + strokeWidthOuter; }; var RoundedRectangle = /*#__PURE__*/function () { /** * @param x - The X coordinate of the upper-left corner of the rounded rectangle * @param y - The Y coordinate of the upper-left corner of the rounded rectangle * @param width - The overall width of this rounded rectangle * @param height - The overall height of this rounded rectangle * @param radius - Controls the radius of the rounded corners */ function RoundedRectangle() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20; _classCallCheck(this, RoundedRectangle); /** * The type of the object, mainly used to avoid `instanceof` checks * @default 'roundedRectangle' */ this.type = "roundedRectangle"; this.x = x; this.y = y; this.width = width; this.height = height; this.radius = radius; } /** * Returns the framing rectangle of the rounded rectangle as a Rectangle object * @param out - optional rectangle to store the result * @returns The framing rectangle */ return _createClass(RoundedRectangle, [{ key: "getBounds", value: function getBounds(out) { out || (out = new Rectangle.Rectangle()); out.x = this.x; out.y = this.y; out.width = this.width; out.height = this.height; return out; } /** * Creates a clone of this Rounded Rectangle. * @returns - A copy of the rounded rectangle. */ }, { key: "clone", value: function clone() { return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); } /** * Copies another rectangle to this one. * @param rectangle - The rectangle to copy from. * @returns Returns itself. */ }, { key: "copyFrom", value: function copyFrom(rectangle) { this.x = rectangle.x; this.y = rectangle.y; this.width = rectangle.width; this.height = rectangle.height; return this; } /** * Copies this rectangle to another one. * @param rectangle - The rectangle to copy to. * @returns Returns given parameter. */ }, { key: "copyTo", value: function copyTo(rectangle) { rectangle.copyFrom(this); return rectangle; } /** * Checks whether the x and y coordinates given are contained within this Rounded Rectangle * @param x - The X coordinate of the point to test. * @param y - The Y coordinate of the point to test. * @returns - Whether the x/y coordinates are within this Rounded Rectangle. */ }, { key: "contains", value: function contains(x, y) { if (this.width <= 0 || this.height <= 0) { return false; } if (x >= this.x && x <= this.x + this.width) { if (y >= this.y && y <= this.y + this.height) { var radius = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2)); if (y >= this.y + radius && y <= this.y + this.height - radius || x >= this.x + radius && x <= this.x + this.width - radius) { return true; } var dx = x - (this.x + radius); var dy = y - (this.y + radius); var radius2 = radius * radius; if (dx * dx + dy * dy <= radius2) { return true; } dx = x - (this.x + this.width - radius); if (dx * dx + dy * dy <= radius2) { return true; } dy = y - (this.y + this.height - radius); if (dx * dx + dy * dy <= radius2) { return true; } dx = x - (this.x + radius); if (dx * dx + dy * dy <= radius2) { return true; } } } return false; } /** * Checks whether the x and y coordinates given are contained within this rectangle including the stroke. * @param pX - The X coordinate of the point to test * @param pY - The Y coordinate of the point to test * @param strokeWidth - The width of the line to check * @param alignment - The alignment of the stroke, 0.5 by default * @returns Whether the x/y coordinates are within this rectangle */ }, { key: "strokeContains", value: function strokeContains(pX, pY, strokeWidth) { var alignment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5; var x = this.x, y = this.y, width = this.width, height = this.height, radius = this.radius; var strokeWidthOuter = strokeWidth * (1 - alignment); var strokeWidthInner = strokeWidth - strokeWidthOuter; var innerX = x + radius; var innerY = y + radius; var innerWidth = width - radius * 2; var innerHeight = height - radius * 2; var rightBound = x + width; var bottomBound = y + height; if ((pX >= x - strokeWidthOuter && pX <= x + strokeWidthInner || pX >= rightBound - strokeWidthInner && pX <= rightBound + strokeWidthOuter) && pY >= innerY && pY <= innerY + innerHeight) { return true; } if ((pY >= y - strokeWidthOuter && pY <= y + strokeWidthInner || pY >= bottomBound - strokeWidthInner && pY <= bottomBound + strokeWidthOuter) && pX >= innerX && pX <= innerX + innerWidth) { return true; } return ( // Top-left pX < innerX && pY < innerY && isCornerWithinStroke(pX, pY, innerX, innerY, radius, strokeWidthInner, strokeWidthOuter) || pX > rightBound - radius && pY < innerY && isCornerWithinStroke(pX, pY, rightBound - radius, innerY, radius, strokeWidthInner, strokeWidthOuter) || pX > rightBound - radius && pY > bottomBound - radius && isCornerWithinStroke(pX, pY, rightBound - radius, bottomBound - radius, radius, strokeWidthInner, strokeWidthOuter) || pX < innerX && pY > bottomBound - radius && isCornerWithinStroke(pX, pY, innerX, bottomBound - radius, radius, strokeWidthInner, strokeWidthOuter) ); } }, { key: "toString", value: function toString() { return "[pixi.js/math:RoundedRectangle x=".concat(this.x, " y=").concat(this.y, "width=").concat(this.width, " height=").concat(this.height, " radius=").concat(this.radius, "]"); } }]); }(); exports.RoundedRectangle = RoundedRectangle; /***/ }), /***/ 54360: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _excluded = ["texture", "anchor", "tilePosition", "tileScale", "tileRotation", "width", "height", "applyAnchorToTexture", "roundPixels"]; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Cache = __webpack_require__(65278); var ObservablePoint = __webpack_require__(14823); var Texture = __webpack_require__(73782); var deprecation = __webpack_require__(11225); var warn = __webpack_require__(57371); var Transform = __webpack_require__(20806); var ViewContainer = __webpack_require__(23804); "use strict"; var _TilingSprite = /*#__PURE__*/function (_ViewContainer$ViewCo) { function _TilingSprite() { var _this; _classCallCheck(this, _TilingSprite); var options = (arguments.length <= 0 ? undefined : arguments[0]) || {}; if (options instanceof Texture.Texture) { options = { texture: options }; } if (arguments.length > 1) { deprecation.deprecation(deprecation.v8_0_0, "use new TilingSprite({ texture, width:100, height:100 }) instead"); options.width = arguments.length <= 1 ? undefined : arguments[1]; options.height = arguments.length <= 2 ? undefined : arguments[2]; } options = _objectSpread(_objectSpread({}, _TilingSprite.defaultOptions), options); var _ref = options !== null && options !== void 0 ? options : {}, texture = _ref.texture, anchor = _ref.anchor, tilePosition = _ref.tilePosition, tileScale = _ref.tileScale, tileRotation = _ref.tileRotation, width = _ref.width, height = _ref.height, applyAnchorToTexture = _ref.applyAnchorToTexture, roundPixels = _ref.roundPixels, rest = _objectWithoutProperties(_ref, _excluded); _this = _callSuper(this, _TilingSprite, [_objectSpread({ label: "TilingSprite" }, rest)]); _this.renderPipeId = "tilingSprite"; _this.batched = true; _this.allowChildren = false; _this._anchor = new ObservablePoint.ObservablePoint({ _onUpdate: function _onUpdate() { _this.onViewUpdate(); } }); _this.applyAnchorToTexture = applyAnchorToTexture; _this.texture = texture; _this._width = width !== null && width !== void 0 ? width : texture.width; _this._height = height !== null && height !== void 0 ? height : texture.height; _this._tileTransform = new Transform.Transform({ observer: { _onUpdate: function _onUpdate() { return _this.onViewUpdate(); } } }); if (anchor) _this.anchor = anchor; _this.tilePosition = tilePosition; _this.tileScale = tileScale; _this.tileRotation = tileRotation; _this.roundPixels = roundPixels !== null && roundPixels !== void 0 ? roundPixels : false; return _this; } /** * Creates a new tiling sprite. * @param source - The source to create the texture from. * @param options - The options for creating the tiling sprite. * @returns A new tiling sprite. */ _inherits(_TilingSprite, _ViewContainer$ViewCo); return _createClass(_TilingSprite, [{ key: "uvRespectAnchor", get: /** * @see {@link scene.TilingSpriteOptions.applyAnchorToTexture} * @deprecated since 8.0.0 */ function get() { warn.warn("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"); return this.applyAnchorToTexture; }, set: function set(value) { warn.warn("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"); this.applyAnchorToTexture = value; } /** * Changes frame clamping in corresponding textureMatrix * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas * @default 0.5 * @member {number} */ }, { key: "clampMargin", get: function get() { return this._texture.textureMatrix.clampMargin; }, set: function set(value) { this._texture.textureMatrix.clampMargin = value; } /** * The anchor sets the origin point of the sprite. The default value is taken from the {@link Texture} * and passed to the constructor. * * The default is `(0,0)`, this means the sprite's origin is the top left. * * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered. * * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner. * * If you pass only single parameter, it will set both x and y to the same value as shown in the example below. * @example * import { TilingSprite } from 'pixi.js'; * * const sprite = new TilingSprite({texture: Texture.WHITE}); * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5). */ }, { key: "anchor", get: function get() { return this._anchor; }, set: function set(value) { typeof value === "number" ? this._anchor.set(value) : this._anchor.copyFrom(value); } /** The offset of the image that is being tiled. */ }, { key: "tilePosition", get: function get() { return this._tileTransform.position; }, set: function set(value) { this._tileTransform.position.copyFrom(value); } /** The scaling of the image that is being tiled. */ }, { key: "tileScale", get: function get() { return this._tileTransform.scale; }, set: function set(value) { typeof value === "number" ? this._tileTransform.scale.set(value) : this._tileTransform.scale.copyFrom(value); } }, { key: "tileRotation", get: /** The rotation of the image that is being tiled. */ function get() { return this._tileTransform.rotation; } /** The transform of the image that is being tiled. */, set: function set(value) { this._tileTransform.rotation = value; } }, { key: "tileTransform", get: function get() { return this._tileTransform; } }, { key: "texture", get: /** The texture that the sprite is using. */ function get() { return this._texture; } /** The width of the tiling area. */, set: function set(value) { value || (value = Texture.Texture.EMPTY); var currentTexture = this._texture; if (currentTexture === value) return; if (currentTexture && currentTexture.dynamic) currentTexture.off("update", this.onViewUpdate, this); if (value.dynamic) value.on("update", this.onViewUpdate, this); this._texture = value; this.onViewUpdate(); } }, { key: "width", get: function get() { return this._width; }, set: function set(value) { this._width = value; this.onViewUpdate(); } }, { key: "height", get: /** The height of the tiling area. */ function get() { return this._height; } /** * Sets the size of the TilingSprite to the specified width and height. * This is faster than setting the width and height separately. * @param value - This can be either a number or a [Size]{@link Size} object. * @param height - The height to set. Defaults to the value of `width` if not provided. */, set: function set(value) { this._height = value; this.onViewUpdate(); } }, { key: "setSize", value: function setSize(value, height) { if (_typeof(value) === "object") { var _value$height; height = (_value$height = value.height) !== null && _value$height !== void 0 ? _value$height : value.width; value = value.width; } this._width = value; this._height = height !== null && height !== void 0 ? height : value; this.onViewUpdate(); } /** * Retrieves the size of the TilingSprite as a [Size]{@link Size} object. * This is faster than get the width and height separately. * @param out - Optional object to store the size in. * @returns - The size of the TilingSprite. */ }, { key: "getSize", value: function getSize(out) { out || (out = {}); out.width = this._width; out.height = this._height; return out; } /** * @private */ }, { key: "updateBounds", value: function updateBounds() { var bounds = this._bounds; var anchor = this._anchor; var width = this._width; var height = this._height; bounds.minX = -anchor._x * width; bounds.maxX = bounds.minX + width; bounds.minY = -anchor._y * height; bounds.maxY = bounds.minY + height; } /** * Checks if the object contains the given point. * @param point - The point to check */ }, { key: "containsPoint", value: function containsPoint(point) { var width = this._width; var height = this._height; var x1 = -width * this._anchor._x; var y1 = 0; if (point.x >= x1 && point.x <= x1 + width) { y1 = -height * this._anchor._y; if (point.y >= y1 && point.y <= y1 + height) return true; } return false; } /** * Destroys this sprite renderable and optionally its texture. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the current texture of the renderable as well * @param {boolean} [options.textureSource=false] - Should it destroy the textureSource of the renderable as well */ }, { key: "destroy", value: function destroy() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; _superPropGet(_TilingSprite, "destroy", this, 3)([options]); this._anchor = null; this._tileTransform = null; this._bounds = null; var destroyTexture = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.texture; if (destroyTexture) { var destroyTextureSource = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.textureSource; this._texture.destroy(destroyTextureSource); } this._texture = null; } }], [{ key: "from", value: function from(source) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (typeof source === "string") { return new _TilingSprite(_objectSpread({ texture: Cache.Cache.get(source) }, options)); } return new _TilingSprite(_objectSpread({ texture: source }, options)); } }]); }(ViewContainer.ViewContainer); /** default options for the TilingSprite */ _TilingSprite.defaultOptions = { /** The texture to use for the sprite. */ texture: Texture.Texture.EMPTY, /** The anchor point of the sprite */ anchor: { x: 0, y: 0 }, /** The offset of the image that is being tiled. */ tilePosition: { x: 0, y: 0 }, /** Scaling of the image that is being tiled. */ tileScale: { x: 1, y: 1 }, /** The rotation of the image that is being tiled. */ tileRotation: 0, /** * Flags whether the tiling pattern should originate from the origin instead of the top-left corner in * local space. * * This will make the texture coordinates assigned to each vertex dependent on the value of the anchor. Without * this, the top-left corner always gets the (0, 0) texture coordinate. * @default false */ applyAnchorToTexture: false }; var TilingSprite = _TilingSprite; exports.TilingSprite = TilingSprite; /***/ }), /***/ 54404: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BatchTextureArray = /*#__PURE__*/function () { function BatchTextureArray() { _classCallCheck(this, BatchTextureArray); /** Respective locations for textures. */ this.ids = /* @__PURE__ */Object.create(null); this.textures = []; this.count = 0; } /** Clear the textures and their locations. */ return _createClass(BatchTextureArray, [{ key: "clear", value: function clear() { for (var i = 0; i < this.count; i++) { var t = this.textures[i]; this.textures[i] = null; this.ids[t.uid] = null; } this.count = 0; } }]); }(); exports.BatchTextureArray = BatchTextureArray; /***/ }), /***/ 54600: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var GlParticleContainerAdaptor = /*#__PURE__*/function () { function GlParticleContainerAdaptor() { _classCallCheck(this, GlParticleContainerAdaptor); } return _createClass(GlParticleContainerAdaptor, [{ key: "execute", value: function execute(particleContainerPipe, container) { var state = particleContainerPipe.state; var renderer = particleContainerPipe.renderer; var shader = container.shader || particleContainerPipe.defaultShader; shader.resources.uTexture = container.texture._source; shader.resources.uniforms = particleContainerPipe.localUniforms; var gl = renderer.gl; var buffer = particleContainerPipe.getBuffers(container); renderer.shader.bind(shader); renderer.state.set(state); renderer.geometry.bind(buffer.geometry, shader.glProgram); var byteSize = buffer.geometry.indexBuffer.data.BYTES_PER_ELEMENT; var glType = byteSize === 2 ? gl.UNSIGNED_SHORT : gl.UNSIGNED_INT; gl.drawElements(gl.TRIANGLES, container.particleChildren.length * 6, glType, 0); } }]); }(); exports.GlParticleContainerAdaptor = GlParticleContainerAdaptor; /***/ }), /***/ 54676: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _EventEmitter = _interopRequireDefault(__webpack_require__(35513)); var _OOP = __webpack_require__(64181); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @extends EventEmitter * @constructor */ function DelaySignal() { _EventEmitter["default"].call(this); this.signals = {}; this.to = this.NO_WAIT; this.execSignal = this.execSignal.bind(this); } (0, _OOP.mixClass)(DelaySignal, _EventEmitter["default"]); DelaySignal.NO_WAIT = -1; DelaySignal.prototype.NO_WAIT = DelaySignal.NO_WAIT; DelaySignal.prototype.delay = 4; DelaySignal.prototype.execSignal = function () { this.to = this.NO_WAIT; var signals = this.signals; this.signals = {}; for (var name in signals) { this.fire.apply(this, [name].concat(signals[name])); } }; DelaySignal.prototype.emit = function (name) { this.signals[name] = Array.prototype.slice.call(arguments, 1); if (this.to === this.NO_WAIT) { if (window.Thread && window.Thread.setTimeout) { this.to = window.Thread.setTimeout({ func: this.execSignal, time: this.delay, type: 'background', args: [] }); } else { this.to = setTimeout(this.execSignal, this.delay); } } return this; }; DelaySignal.prototype.revokeResource = function () { if (this.to !== this.NO_WAIT) { clearTimeout(this.to); } delete this.signals; delete this.execSignal; }; var _default = exports["default"] = DelaySignal; /***/ }), /***/ 54748: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var HTMLTextRenderData = __webpack_require__(40180); "use strict"; var tempHTMLTextRenderData; function measureHtmlText(text, style, fontStyleCSS, htmlTextRenderData) { htmlTextRenderData || (htmlTextRenderData = tempHTMLTextRenderData || (tempHTMLTextRenderData = new HTMLTextRenderData.HTMLTextRenderData())); var _htmlTextRenderData = htmlTextRenderData, domElement = _htmlTextRenderData.domElement, styleElement = _htmlTextRenderData.styleElement, svgRoot = _htmlTextRenderData.svgRoot; domElement.innerHTML = "<style>".concat(style.cssStyle, ";</style><div style='padding:0'>").concat(text, "</div>"); domElement.setAttribute("style", "transform-origin: top left; display: inline-block"); if (fontStyleCSS) { styleElement.textContent = fontStyleCSS; } document.body.appendChild(svgRoot); var contentBounds = domElement.getBoundingClientRect(); svgRoot.remove(); var doublePadding = style.padding * 2; return { width: contentBounds.width - doublePadding, height: contentBounds.height - doublePadding }; } exports.measureHtmlText = measureHtmlText; /***/ }), /***/ 54807: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var blendTemplateVert = "in vec2 aPosition;\nout vec2 vTextureCoord;\nout vec2 backgroundUv;\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"; exports["default"] = blendTemplateVert; /***/ }), /***/ 55191: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var fragment = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nout vec4 finalColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uTexture;\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 = texture(uTexture, 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 finalColor = color;\n}\n"; exports["default"] = fragment; /***/ }), /***/ 55265: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 55403: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var uid = __webpack_require__(90844); var ViewableBuffer = __webpack_require__(73803); var fastCopy = __webpack_require__(36243); var getAdjustedBlendModeBlend = __webpack_require__(4794); var maxRecommendedTextures = __webpack_require__(6899); var BatchTextureArray = __webpack_require__(54404); "use strict"; var Batch = /*#__PURE__*/function () { function Batch() { _classCallCheck(this, Batch); this.renderPipeId = "batch"; this.action = "startBatch"; // TODO - eventually this could be useful for flagging batches as dirty and then only rebuilding those ones // public elementStart = 0; // public elementSize = 0; // for drawing.. this.start = 0; this.size = 0; this.textures = new BatchTextureArray.BatchTextureArray(); this.blendMode = "normal"; this.topology = "triangle-strip"; this.canBundle = true; } return _createClass(Batch, [{ key: "destroy", value: function destroy() { this.textures = null; this.gpuBindGroup = null; this.bindGroup = null; this.batcher = null; } }]); }(); var batchPool = []; var batchPoolIndex = 0; function getBatchFromPool() { return batchPoolIndex > 0 ? batchPool[--batchPoolIndex] : new Batch(); } function returnBatchToPool(batch) { batchPool[batchPoolIndex++] = batch; } var BATCH_TICK = 0; var _Batcher = /*#__PURE__*/function () { function _Batcher() { var _Batcher$defaultOptio; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _Batcher); /** unique id for this batcher */ this.uid = uid.uid("batcher"); /** Indicates whether the batch data has been modified and needs updating. */ this.dirty = true; /** The current index of the batch being processed. */ this.batchIndex = 0; /** An array of all batches created during the current rendering process. */ this.batches = []; this._elements = []; _Batcher.defaultOptions.maxTextures = (_Batcher$defaultOptio = _Batcher.defaultOptions.maxTextures) !== null && _Batcher$defaultOptio !== void 0 ? _Batcher$defaultOptio : maxRecommendedTextures.getMaxTexturesPerBatch(); options = _objectSpread(_objectSpread({}, _Batcher.defaultOptions), options); var _options = options, maxTextures = _options.maxTextures, attributesInitialSize = _options.attributesInitialSize, indicesInitialSize = _options.indicesInitialSize; this.attributeBuffer = new ViewableBuffer.ViewableBuffer(attributesInitialSize * 4); this.indexBuffer = new Uint16Array(indicesInitialSize); this.maxTextures = maxTextures; } return _createClass(_Batcher, [{ key: "begin", value: function begin() { this.elementSize = 0; this.elementStart = 0; this.indexSize = 0; this.attributeSize = 0; for (var i = 0; i < this.batchIndex; i++) { returnBatchToPool(this.batches[i]); } this.batchIndex = 0; this._batchIndexStart = 0; this._batchIndexSize = 0; this.dirty = true; } }, { key: "add", value: function add(batchableObject) { this._elements[this.elementSize++] = batchableObject; batchableObject._indexStart = this.indexSize; batchableObject._attributeStart = this.attributeSize; batchableObject._batcher = this; this.indexSize += batchableObject.indexSize; this.attributeSize += batchableObject.attributeSize * this.vertexSize; } }, { key: "checkAndUpdateTexture", value: function checkAndUpdateTexture(batchableObject, texture) { var textureId = batchableObject._batch.textures.ids[texture._source.uid]; if (!textureId && textureId !== 0) return false; batchableObject._textureId = textureId; batchableObject.texture = texture; return true; } }, { key: "updateElement", value: function updateElement(batchableObject) { this.dirty = true; var attributeBuffer = this.attributeBuffer; if (batchableObject.packAsQuad) { this.packQuadAttributes(batchableObject, attributeBuffer.float32View, attributeBuffer.uint32View, batchableObject._attributeStart, batchableObject._textureId); } else { this.packAttributes(batchableObject, attributeBuffer.float32View, attributeBuffer.uint32View, batchableObject._attributeStart, batchableObject._textureId); } } /** * breaks the batcher. This happens when a batch gets too big, * or we need to switch to a different type of rendering (a filter for example) * @param instructionSet */ }, { key: "break", value: function _break(instructionSet) { var elements = this._elements; if (!elements[this.elementStart]) return; var batch = getBatchFromPool(); var textureBatch = batch.textures; textureBatch.clear(); var firstElement = elements[this.elementStart]; var blendMode = getAdjustedBlendModeBlend.getAdjustedBlendModeBlend(firstElement.blendMode, firstElement.texture._source); var topology = firstElement.topology; if (this.attributeSize * 4 > this.attributeBuffer.size) { this._resizeAttributeBuffer(this.attributeSize * 4); } if (this.indexSize > this.indexBuffer.length) { this._resizeIndexBuffer(this.indexSize); } var f32 = this.attributeBuffer.float32View; var u32 = this.attributeBuffer.uint32View; var indexBuffer = this.indexBuffer; var size = this._batchIndexSize; var start = this._batchIndexStart; var action = "startBatch"; var maxTextures = this.maxTextures; for (var i = this.elementStart; i < this.elementSize; ++i) { var element = elements[i]; elements[i] = null; var texture = element.texture; var source = texture._source; var adjustedBlendMode = getAdjustedBlendModeBlend.getAdjustedBlendModeBlend(element.blendMode, source); var breakRequired = blendMode !== adjustedBlendMode || topology !== element.topology; if (source._batchTick === BATCH_TICK && !breakRequired) { element._textureId = source._textureBindLocation; size += element.indexSize; if (element.packAsQuad) { this.packQuadAttributes(element, f32, u32, element._attributeStart, element._textureId); this.packQuadIndex(indexBuffer, element._indexStart, element._attributeStart / this.vertexSize); } else { this.packAttributes(element, f32, u32, element._attributeStart, element._textureId); this.packIndex(element, indexBuffer, element._indexStart, element._attributeStart / this.vertexSize); } element._batch = batch; continue; } source._batchTick = BATCH_TICK; if (textureBatch.count >= maxTextures || breakRequired) { this._finishBatch(batch, start, size - start, textureBatch, blendMode, topology, instructionSet, action); action = "renderBatch"; start = size; blendMode = adjustedBlendMode; topology = element.topology; batch = getBatchFromPool(); textureBatch = batch.textures; textureBatch.clear(); ++BATCH_TICK; } element._textureId = source._textureBindLocation = textureBatch.count; textureBatch.ids[source.uid] = textureBatch.count; textureBatch.textures[textureBatch.count++] = source; element._batch = batch; size += element.indexSize; if (element.packAsQuad) { this.packQuadAttributes(element, f32, u32, element._attributeStart, element._textureId); this.packQuadIndex(indexBuffer, element._indexStart, element._attributeStart / this.vertexSize); } else { this.packAttributes(element, f32, u32, element._attributeStart, element._textureId); this.packIndex(element, indexBuffer, element._indexStart, element._attributeStart / this.vertexSize); } } if (textureBatch.count > 0) { this._finishBatch(batch, start, size - start, textureBatch, blendMode, topology, instructionSet, action); start = size; ++BATCH_TICK; } this.elementStart = this.elementSize; this._batchIndexStart = start; this._batchIndexSize = size; } }, { key: "_finishBatch", value: function _finishBatch(batch, indexStart, indexSize, textureBatch, blendMode, topology, instructionSet, action) { batch.gpuBindGroup = null; batch.bindGroup = null; batch.action = action; batch.batcher = this; batch.textures = textureBatch; batch.blendMode = blendMode; batch.topology = topology; batch.start = indexStart; batch.size = indexSize; ++BATCH_TICK; this.batches[this.batchIndex++] = batch; instructionSet.add(batch); } }, { key: "finish", value: function finish(instructionSet) { this["break"](instructionSet); } /** * Resizes the attribute buffer to the given size (1 = 1 float32) * @param size - the size in vertices to ensure (not bytes!) */ }, { key: "ensureAttributeBuffer", value: function ensureAttributeBuffer(size) { if (size * 4 <= this.attributeBuffer.size) return; this._resizeAttributeBuffer(size * 4); } /** * Resizes the index buffer to the given size (1 = 1 float32) * @param size - the size in vertices to ensure (not bytes!) */ }, { key: "ensureIndexBuffer", value: function ensureIndexBuffer(size) { if (size <= this.indexBuffer.length) return; this._resizeIndexBuffer(size); } }, { key: "_resizeAttributeBuffer", value: function _resizeAttributeBuffer(size) { var newSize = Math.max(size, this.attributeBuffer.size * 2); var newArrayBuffer = new ViewableBuffer.ViewableBuffer(newSize); fastCopy.fastCopy(this.attributeBuffer.rawBinaryData, newArrayBuffer.rawBinaryData); this.attributeBuffer = newArrayBuffer; } }, { key: "_resizeIndexBuffer", value: function _resizeIndexBuffer(size) { var indexBuffer = this.indexBuffer; var newSize = Math.max(size, indexBuffer.length * 1.5); newSize += newSize % 2; var newIndexBuffer = newSize > 65535 ? new Uint32Array(newSize) : new Uint16Array(newSize); if (newIndexBuffer.BYTES_PER_ELEMENT !== indexBuffer.BYTES_PER_ELEMENT) { for (var i = 0; i < indexBuffer.length; i++) { newIndexBuffer[i] = indexBuffer[i]; } } else { fastCopy.fastCopy(indexBuffer.buffer, newIndexBuffer.buffer); } this.indexBuffer = newIndexBuffer; } }, { key: "packQuadIndex", value: function packQuadIndex(indexBuffer, index, indicesOffset) { indexBuffer[index] = indicesOffset + 0; indexBuffer[index + 1] = indicesOffset + 1; indexBuffer[index + 2] = indicesOffset + 2; indexBuffer[index + 3] = indicesOffset + 0; indexBuffer[index + 4] = indicesOffset + 2; indexBuffer[index + 5] = indicesOffset + 3; } }, { key: "packIndex", value: function packIndex(element, indexBuffer, index, indicesOffset) { var indices = element.indices; var size = element.indexSize; var indexOffset = element.indexOffset; var attributeOffset = element.attributeOffset; for (var i = 0; i < size; i++) { indexBuffer[index++] = indicesOffset + indices[i + indexOffset] - attributeOffset; } } }, { key: "destroy", value: function destroy() { for (var i = 0; i < this.batches.length; i++) { returnBatchToPool(this.batches[i]); } this.batches = null; for (var _i = 0; _i < this._elements.length; _i++) { this._elements[_i]._batch = null; } this._elements = null; this.indexBuffer = null; this.attributeBuffer.destroy(); this.attributeBuffer = null; } }]); }(); _Batcher.defaultOptions = { maxTextures: null, attributesInitialSize: 4, indicesInitialSize: 6 }; var Batcher = _Batcher; exports.Batch = Batch; exports.Batcher = Batcher; /***/ }), /***/ 55406: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var pow2 = __webpack_require__(52878); var definedProps = __webpack_require__(48629); var uid = __webpack_require__(90844); var TextureStyle = __webpack_require__(62881); "use strict"; var _TextureSource = /*#__PURE__*/function (_EventEmitter) { /** * @param options - options for creating a new TextureSource */ function _TextureSource() { var _options$label; var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _TextureSource); _this = _callSuper(this, _TextureSource); _this.options = options; /** unique id for this Texture source */ _this.uid = uid.uid("textureSource"); /** * The resource type used by this TextureSource. This is used by the bind groups to determine * how to handle this resource. * @ignore * @internal */ _this._resourceType = "textureSource"; /** * i unique resource id, used by the bind group systems. * This can change if the texture is resized or its resource changes */ _this._resourceId = uid.uid("resource"); /** * this is how the backends know how to upload this texture to the GPU * It changes depending on the resource type. Classes that extend TextureSource * should override this property. * @ignore * @internal */ _this.uploadMethodId = "unknown"; // dimensions _this._resolution = 1; /** the pixel width of this texture source. This is the REAL pure number, not accounting resolution */ _this.pixelWidth = 1; /** the pixel height of this texture source. This is the REAL pure number, not accounting resolution */ _this.pixelHeight = 1; /** * the width of this texture source, accounting for resolution * eg pixelWidth 200, resolution 2, then width will be 100 */ _this.width = 1; /** * the height of this texture source, accounting for resolution * eg pixelHeight 200, resolution 2, then height will be 100 */ _this.height = 1; /** * The number of samples of a multisample texture. This is always 1 for non-multisample textures. * To enable multisample for a texture, set antialias to true * @internal * @ignore */ _this.sampleCount = 1; /** The number of mip levels to generate for this texture. this is overridden if autoGenerateMipmaps is true */ _this.mipLevelCount = 1; /** * Should we auto generate mipmaps for this texture? This will automatically generate mipmaps * for this texture when uploading to the GPU. Mipmapped textures take up more memory, but * can look better when scaled down. * * For performance reasons, it is recommended to NOT use this with RenderTextures, as they are often updated every frame. * If you do, make sure to call `updateMipmaps` after you update the texture. */ _this.autoGenerateMipmaps = false; /** the format that the texture data has */ _this.format = "rgba8unorm"; /** how many dimensions does this texture have? currently v8 only supports 2d */ _this.dimension = "2d"; /** * Only really affects RenderTextures. * Should we use antialiasing for this texture. It will look better, but may impact performance as a * Blit operation will be required to resolve the texture. */ _this.antialias = false; /** * Used by automatic texture Garbage Collection, stores last GC tick when it was bound * @protected */ _this._touched = 0; /** * Used by the batcher to build texture batches. faster to have the variable here! * @protected */ _this._batchTick = -1; /** * A temporary batch location for the texture batching. Here for performance reasons only! * @protected */ _this._textureBindLocation = -1; options = _objectSpread(_objectSpread({}, _TextureSource.defaultOptions), options); _this.label = (_options$label = options.label) !== null && _options$label !== void 0 ? _options$label : ""; _this.resource = options.resource; _this.autoGarbageCollect = options.autoGarbageCollect; _this._resolution = options.resolution; if (options.width) { _this.pixelWidth = options.width * _this._resolution; } else { var _this$resourceWidth; _this.pixelWidth = _this.resource ? (_this$resourceWidth = _this.resourceWidth) !== null && _this$resourceWidth !== void 0 ? _this$resourceWidth : 1 : 1; } if (options.height) { _this.pixelHeight = options.height * _this._resolution; } else { var _this$resourceHeight; _this.pixelHeight = _this.resource ? (_this$resourceHeight = _this.resourceHeight) !== null && _this$resourceHeight !== void 0 ? _this$resourceHeight : 1 : 1; } _this.width = _this.pixelWidth / _this._resolution; _this.height = _this.pixelHeight / _this._resolution; _this.format = options.format; _this.dimension = options.dimensions; _this.mipLevelCount = options.mipLevelCount; _this.autoGenerateMipmaps = options.autoGenerateMipmaps; _this.sampleCount = options.sampleCount; _this.antialias = options.antialias; _this.alphaMode = options.alphaMode; _this.style = new TextureStyle.TextureStyle(definedProps.definedProps(options)); _this.destroyed = false; _this._refreshPOT(); return _this; } /** returns itself */ _inherits(_TextureSource, _EventEmitter); return _createClass(_TextureSource, [{ key: "source", get: function get() { return this; } /** the style of the texture */ }, { key: "style", get: function get() { return this._style; }, set: function set(value) { var _this$_style, _this$_style2; if (this.style === value) return; (_this$_style = this._style) === null || _this$_style === void 0 || _this$_style.off("change", this._onStyleChange, this); this._style = value; (_this$_style2 = this._style) === null || _this$_style2 === void 0 || _this$_style2.on("change", this._onStyleChange, this); this._onStyleChange(); } /** setting this will set wrapModeU,wrapModeV and wrapModeW all at once! */ }, { key: "addressMode", get: function get() { return this._style.addressMode; }, set: function set(value) { this._style.addressMode = value; } /** setting this will set wrapModeU,wrapModeV and wrapModeW all at once! */ }, { key: "repeatMode", get: function get() { return this._style.addressMode; }, set: function set(value) { this._style.addressMode = value; } /** Specifies the sampling behavior when the sample footprint is smaller than or equal to one texel. */ }, { key: "magFilter", get: function get() { return this._style.magFilter; }, set: function set(value) { this._style.magFilter = value; } /** Specifies the sampling behavior when the sample footprint is larger than one texel. */ }, { key: "minFilter", get: function get() { return this._style.minFilter; }, set: function set(value) { this._style.minFilter = value; } /** Specifies behavior for sampling between mipmap levels. */ }, { key: "mipmapFilter", get: function get() { return this._style.mipmapFilter; }, set: function set(value) { this._style.mipmapFilter = value; } /** Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */ }, { key: "lodMinClamp", get: function get() { return this._style.lodMinClamp; }, set: function set(value) { this._style.lodMinClamp = value; } /** Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture. */ }, { key: "lodMaxClamp", get: function get() { return this._style.lodMaxClamp; }, set: function set(value) { this._style.lodMaxClamp = value; } }, { key: "_onStyleChange", value: function _onStyleChange() { this.emit("styleChange", this); } /** call this if you have modified the texture outside of the constructor */ }, { key: "update", value: function update() { if (this.resource) { var resolution = this._resolution; var didResize = this.resize(this.resourceWidth / resolution, this.resourceHeight / resolution); if (didResize) return; } this.emit("update", this); } /** Destroys this texture source */ }, { key: "destroy", value: function destroy() { this.destroyed = true; this.emit("destroy", this); this.emit("change", this); if (this._style) { this._style.destroy(); this._style = null; } this.uploadMethodId = null; this.resource = null; this.removeAllListeners(); } /** * This will unload the Texture source from the GPU. This will free up the GPU memory * As soon as it is required fore rendering, it will be re-uploaded. */ }, { key: "unload", value: function unload() { this._resourceId = uid.uid("resource"); this.emit("change", this); this.emit("unload", this); } /** the width of the resource. This is the REAL pure number, not accounting resolution */ }, { key: "resourceWidth", get: function get() { var resource = this.resource; return resource.naturalWidth || resource.videoWidth || resource.displayWidth || resource.width; } /** the height of the resource. This is the REAL pure number, not accounting resolution */ }, { key: "resourceHeight", get: function get() { var resource = this.resource; return resource.naturalHeight || resource.videoHeight || resource.displayHeight || resource.height; } /** * the resolution of the texture. Changing this number, will not change the number of pixels in the actual texture * but will the size of the texture when rendered. * * changing the resolution of this texture to 2 for example will make it appear twice as small when rendered (as pixel * density will have increased) */ }, { key: "resolution", get: function get() { return this._resolution; }, set: function set(resolution) { if (this._resolution === resolution) return; this._resolution = resolution; this.width = this.pixelWidth / resolution; this.height = this.pixelHeight / resolution; } /** * Resize the texture, this is handy if you want to use the texture as a render texture * @param width - the new width of the texture * @param height - the new height of the texture * @param resolution - the new resolution of the texture * @returns - if the texture was resized */ }, { key: "resize", value: function resize(width, height, resolution) { resolution || (resolution = this._resolution); width || (width = this.width); height || (height = this.height); var newPixelWidth = Math.round(width * resolution); var newPixelHeight = Math.round(height * resolution); this.width = newPixelWidth / resolution; this.height = newPixelHeight / resolution; this._resolution = resolution; if (this.pixelWidth === newPixelWidth && this.pixelHeight === newPixelHeight) { return false; } this._refreshPOT(); this.pixelWidth = newPixelWidth; this.pixelHeight = newPixelHeight; this.emit("resize", this); this._resourceId = uid.uid("resource"); this.emit("change", this); return true; } /** * Lets the renderer know that this texture has been updated and its mipmaps should be re-generated. * This is only important for RenderTexture instances, as standard Texture instances will have their * mipmaps generated on upload. You should call this method after you make any change to the texture * * The reason for this is is can be quite expensive to update mipmaps for a texture. So by default, * We want you, the developer to specify when this action should happen. * * Generally you don't want to have mipmaps generated on Render targets that are changed every frame, */ }, { key: "updateMipmaps", value: function updateMipmaps() { if (this.autoGenerateMipmaps && this.mipLevelCount > 1) { this.emit("updateMipmaps", this); } } }, { key: "wrapMode", get: function get() { return this._style.wrapMode; }, set: function set(value) { this._style.wrapMode = value; } }, { key: "scaleMode", get: /** setting this will set magFilter,minFilter and mipmapFilter all at once! */ function get() { return this._style.scaleMode; } /** * Refresh check for isPowerOfTwo texture based on size * @private */, set: function set(value) { this._style.scaleMode = value; } }, { key: "_refreshPOT", value: function _refreshPOT() { this.isPowerOfTwo = pow2.isPow2(this.pixelWidth) && pow2.isPow2(this.pixelHeight); } }], [{ key: "test", value: function test(_resource) { throw new Error("Unimplemented"); } }]); }(EventEmitter); /** The default options used when creating a new TextureSource. override these to add your own defaults */ _TextureSource.defaultOptions = { resolution: 1, format: "bgra8unorm", alphaMode: "premultiply-alpha-on-upload", dimensions: "2d", mipLevelCount: 1, autoGenerateMipmaps: false, sampleCount: 1, antialias: false, autoGarbageCollect: false }; var TextureSource = _TextureSource; exports.TextureSource = TextureSource; /***/ }), /***/ 55774: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _AbstractScene = _interopRequireDefault(__webpack_require__(33186)); var _OOP = __webpack_require__(64181); var _RS = _interopRequireDefault(__webpack_require__(86109)); var _FCore = __webpack_require__(49997); var _MainMenuScene = _interopRequireDefault(__webpack_require__(40918)); var _PreviewScene = _interopRequireDefault(__webpack_require__(32230)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @extends AbstractScene * @constructor */ function LoadingScene() { _AbstractScene["default"].apply(this, arguments); this.dotCount = 0; } (0, _OOP.mixClass)(LoadingScene, _AbstractScene["default"]); LoadingScene.prototype.create = function () { this.$bg = (0, _FCore._)('.as-loading-bg'); this.$book = (0, _FCore._)({ tag: 'img', "class": 'as-loading-book', attr: { src: 'assets/book_loading.png' } }); this.$cat = (0, _FCore._)({ "class": 'as-loading-cat-zzz', style: {} }); this.$text = (0, _FCore._)({ "class": 'as-loading-text', child: { text: 'Loading' } }); }; LoadingScene.prototype.onAttached = function () { /** * @type {AssetManager} */ this.assetMng = this.getContext(_RS["default"].ASSET_MANAGER); }; LoadingScene.prototype.onStart = function () { var _this = this; this.$background.addChild(this.$bg); this.startTime = Date.now(); var sync = Promise.resolve(); ['bg1', 'box1', 'close_btn', 'reset_btn', 'win_3_stars', 'win_2_stars', 'win_1_stars', 'win_bg', 'star_light', 'tab_btn_1', 'tab_btn_2', 'tab_btn_3', 'locked_btn', 'menu_bg', 'menu_button_wood', 'menu_cursor', 'bottom_bar', 'top_bar', 'skill_1_btn', 'skill_2_btn', 'skill_3_btn', 'skill_4_btn', 'switch_bg', 'level1_map_ground', 'monster_home', 'grass_t1', 'grass_t2', 'grass_t3', 'grass_1x2', 'mushroom', 'rock_1x1', 'rock_2x1', 'pond_3x2', 'a_nhip_small', 'dlh_small', 'moon_small', 'bau_dat_small', 'sun_small', 'may_small', 'plus_e', 'pause_btn', 'play_btn', 'menu_btn', 'rice_hp', 'rec_complete', 'gia_lai_map', 'page_arrow_left', 'page_arrow_right', 'gia_lai_map', 'daklak_map', 'replay_btn', 'result_bg', 'option_content', 'summary_content'].forEach(function (name) { sync = sync.then(function () { console.log('load image', name); return _this.assetMng.loadImage(name, "assets/".concat(name, ".png")); }); }); ['main_logo', 'a_nhip', 'bau_dat', 'dao_ln_hot', 'anh_trang', 'tia_nang', 'may', 'bo_tri', 'vi_khuan', 'sau', 'oc_sen', 'nam_benh', 'bo_canh_cung', 'bo_rep', 'rice', 'dan_tho', 'dan_bang', 'dan_thuy', 'dan_hoa', 'dan_moc', 'dan_phong', 'upgrade_arrow', 'arrow_small', 'ngoc_linh', 'linh_chi', 'ca_phe', 'sau_rieng', 'ca_cao'].forEach(function (name) { sync = sync.then(function () { console.log('load texture', name); return _this.assetMng.loadTexture(name, "assets/".concat(name, ".png")); }); }); this.sync = sync; this.$book.addTo(this.$foreground); this.$cat.addTo(this.$foreground); this.$text.addTo(this.$foreground); var catImg = this.assetMng.getImage('cat_zzz'); this.$cat.addStyle({ width: catImg.naturalWidth + 'px', height: catImg.naturalHeight + 'px' }); var delaySync = new Promise(function (resolve) { return setTimeout(resolve, 1); }); this.sync.then(function () { Promise.all([_this.assetMng.ready(), delaySync]).then(function () { console.log('load content done'); console.log('load time: ', Date.now() - _this.startTime, 'ms'); setTimeout(function () { _this.app.startScene(_MainMenuScene["default"]); // this.app.startScene(PreviewScene) }, 5e2); }); }); }; LoadingScene.prototype.onResume = function () { var _this2 = this; clearTimeout(this.dotTO); var _tick = function tick() { if (_this2.state !== "RUNNING") return; _this2.dotCount = (_this2.dotCount + 1) % 6; _this2.$text.firstChild.data = '.'.repeat(_this2.dotCount) + ' Loading ' + '.'.repeat(_this2.dotCount); _this2.dotTO = setTimeout(_tick, 1000); }; this.dotTO = setTimeout(_tick, 1000); }; LoadingScene.prototype.onStop = function () { this.$bg.remove(); this.$cat.remove(); this.$text.remove(); this.$book.remove(); }; LoadingScene.prototype.onPause = function () { clearTimeout(this.dotTO); }; var _default = exports["default"] = LoadingScene; /***/ }), /***/ 55858: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var Color = __webpack_require__(98828); var deprecation = __webpack_require__(11225); var FillGradient = __webpack_require__(57315); var FillPattern = __webpack_require__(95745); var GraphicsContext = __webpack_require__(59244); var convertFillInputToFillStyle = __webpack_require__(88129); var generateTextStyleKey = __webpack_require__(5070); "use strict"; var _TextStyle = /*#__PURE__*/function (_EventEmitter) { function _TextStyle() { var _this; var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _TextStyle); _this = _callSuper(this, _TextStyle); convertV7Tov8Style(style); var fullStyle = _objectSpread(_objectSpread({}, _TextStyle.defaultTextStyle), style); for (var key in fullStyle) { var thisKey = key; _this[thisKey] = fullStyle[key]; } _this.update(); return _this; } /** * Alignment for multiline text, does not affect single line text. * @member {'left'|'center'|'right'|'justify'} */ _inherits(_TextStyle, _EventEmitter); return _createClass(_TextStyle, [{ key: "align", get: function get() { return this._align; }, set: function set(value) { this._align = value; this.update(); } /** Indicates if lines can be wrapped within words, it needs wordWrap to be set to true. */ }, { key: "breakWords", get: function get() { return this._breakWords; }, set: function set(value) { this._breakWords = value; this.update(); } /** Set a drop shadow for the text. */ }, { key: "dropShadow", get: function get() { return this._dropShadow; }, set: function set(value) { if (value !== null && _typeof(value) === "object") { this._dropShadow = this._createProxy(_objectSpread(_objectSpread({}, _TextStyle.defaultDropShadow), value)); } else { this._dropShadow = value ? this._createProxy(_objectSpread({}, _TextStyle.defaultDropShadow)) : null; } this.update(); } /** The font family, can be a single font name, or a list of names where the first is the preferred font. */ }, { key: "fontFamily", get: function get() { return this._fontFamily; }, set: function set(value) { this._fontFamily = value; this.update(); } /** The font size (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em') */ }, { key: "fontSize", get: function get() { return this._fontSize; }, set: function set(value) { if (typeof value === "string") { this._fontSize = parseInt(value, 10); } else { this._fontSize = value; } this.update(); } /** * The font style. * @member {'normal'|'italic'|'oblique'} */ }, { key: "fontStyle", get: function get() { return this._fontStyle; }, set: function set(value) { this._fontStyle = value.toLowerCase(); this.update(); } /** * The font variant. * @member {'normal'|'small-caps'} */ }, { key: "fontVariant", get: function get() { return this._fontVariant; }, set: function set(value) { this._fontVariant = value; this.update(); } /** * The font weight. * @member {'normal'|'bold'|'bolder'|'lighter'|'100'|'200'|'300'|'400'|'500'|'600'|'700'|'800'|'900'} */ }, { key: "fontWeight", get: function get() { return this._fontWeight; }, set: function set(value) { this._fontWeight = value; this.update(); } /** The space between lines. */ }, { key: "leading", get: function get() { return this._leading; }, set: function set(value) { this._leading = value; this.update(); } /** The amount of spacing between letters, default is 0. */ }, { key: "letterSpacing", get: function get() { return this._letterSpacing; }, set: function set(value) { this._letterSpacing = value; this.update(); } /** The line height, a number that represents the vertical space that a letter uses. */ }, { key: "lineHeight", get: function get() { return this._lineHeight; }, set: function set(value) { this._lineHeight = value; this.update(); } /** * Occasionally some fonts are cropped. Adding some padding will prevent this from happening * by adding padding to all sides of the text. */ }, { key: "padding", get: function get() { return this._padding; }, set: function set(value) { this._padding = value; this.update(); } /** Trim transparent borders. This is an expensive operation so only use this if you have to! */ }, { key: "trim", get: function get() { return this._trim; }, set: function set(value) { this._trim = value; this.update(); } /** * The baseline of the text that is rendered. * @member {'alphabetic'|'top'|'hanging'|'middle'|'ideographic'|'bottom'} */ }, { key: "textBaseline", get: function get() { return this._textBaseline; }, set: function set(value) { this._textBaseline = value; this.update(); } /** * How newlines and spaces should be handled. * Default is 'pre' (preserve, preserve). * * value | New lines | Spaces * --- | --- | --- * 'normal' | Collapse | Collapse * 'pre' | Preserve | Preserve * 'pre-line' | Preserve | Collapse * @member {'normal'|'pre'|'pre-line'} */ }, { key: "whiteSpace", get: function get() { return this._whiteSpace; }, set: function set(value) { this._whiteSpace = value; this.update(); } /** Indicates if word wrap should be used. */ }, { key: "wordWrap", get: function get() { return this._wordWrap; }, set: function set(value) { this._wordWrap = value; this.update(); } /** The width at which text will wrap, it needs wordWrap to be set to true. */ }, { key: "wordWrapWidth", get: function get() { return this._wordWrapWidth; }, set: function set(value) { this._wordWrapWidth = value; this.update(); } /** * The fill style that will be used to color the text. * This can be: * - A color string like 'red', '#00FF00', or 'rgba(255,0,0,0.5)' * - A hex number like 0xff0000 for red * - A FillStyle object with properties like { color: 0xff0000, alpha: 0.5 } * - A FillGradient for gradient fills * - A FillPattern for pattern/texture fills * * When using a FillGradient, vertical gradients (angle of 90 degrees) are applied per line of text, * while gradients at any other angle are spread across the entire text body as a whole. * @example * // Vertical gradient applied per line * const verticalGradient = new FillGradient(0, 0, 0, 1) * .addColorStop(0, 0xff0000) * .addColorStop(1, 0x0000ff); * * const text = new Text({ * text: 'Line 1\nLine 2', * style: { fill: verticalGradient } * }); * * To manage the gradient in a global scope, set the textureSpace property of the FillGradient to 'global'. * @type {string|number|FillStyle|FillGradient|FillPattern} */ }, { key: "fill", get: function get() { return this._originalFill; }, set: function set(value) { var _this2 = this; if (value === this._originalFill) return; this._originalFill = value; if (this._isFillStyle(value)) { this._originalFill = this._createProxy(_objectSpread(_objectSpread({}, GraphicsContext.GraphicsContext.defaultFillStyle), value), function () { _this2._fill = convertFillInputToFillStyle.toFillStyle(_objectSpread({}, _this2._originalFill), GraphicsContext.GraphicsContext.defaultFillStyle); }); } this._fill = convertFillInputToFillStyle.toFillStyle(value === 0 ? "black" : value, GraphicsContext.GraphicsContext.defaultFillStyle); this.update(); } /** A fillstyle that will be used on the text stroke, e.g., 'blue', '#FCFF00'. */ }, { key: "stroke", get: function get() { return this._originalStroke; }, set: function set(value) { var _this3 = this; if (value === this._originalStroke) return; this._originalStroke = value; if (this._isFillStyle(value)) { this._originalStroke = this._createProxy(_objectSpread(_objectSpread({}, GraphicsContext.GraphicsContext.defaultStrokeStyle), value), function () { _this3._stroke = convertFillInputToFillStyle.toStrokeStyle(_objectSpread({}, _this3._originalStroke), GraphicsContext.GraphicsContext.defaultStrokeStyle); }); } this._stroke = convertFillInputToFillStyle.toStrokeStyle(value, GraphicsContext.GraphicsContext.defaultStrokeStyle); this.update(); } }, { key: "_generateKey", value: function _generateKey() { this._styleKey = generateTextStyleKey.generateTextStyleKey(this); return this._styleKey; } }, { key: "update", value: function update() { this._styleKey = null; this.emit("update", this); } /** Resets all properties to the default values */ }, { key: "reset", value: function reset() { var defaultStyle = _TextStyle.defaultTextStyle; for (var key in defaultStyle) { this[key] = defaultStyle[key]; } } }, { key: "styleKey", get: function get() { return this._styleKey || this._generateKey(); } /** * Creates a new TextStyle object with the same values as this one. * @returns New cloned TextStyle object */ }, { key: "clone", value: function clone() { return new _TextStyle({ align: this.align, breakWords: this.breakWords, dropShadow: this._dropShadow ? _objectSpread({}, this._dropShadow) : null, fill: this._fill, fontFamily: this.fontFamily, fontSize: this.fontSize, fontStyle: this.fontStyle, fontVariant: this.fontVariant, fontWeight: this.fontWeight, leading: this.leading, letterSpacing: this.letterSpacing, lineHeight: this.lineHeight, padding: this.padding, stroke: this._stroke, textBaseline: this.textBaseline, whiteSpace: this.whiteSpace, wordWrap: this.wordWrap, wordWrapWidth: this.wordWrapWidth }); } /** * Destroys this text style. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the texture of the this style * @param {boolean} [options.textureSource=false] - Should it destroy the textureSource of the this style */ }, { key: "destroy", value: function destroy() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this.removeAllListeners(); var destroyTexture = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.texture; if (destroyTexture) { var _this$_fill, _this$_originalFill, _this$_stroke, _this$_originalStroke; var destroyTextureSource = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.textureSource; if ((_this$_fill = this._fill) !== null && _this$_fill !== void 0 && _this$_fill.texture) { this._fill.texture.destroy(destroyTextureSource); } if ((_this$_originalFill = this._originalFill) !== null && _this$_originalFill !== void 0 && _this$_originalFill.texture) { this._originalFill.texture.destroy(destroyTextureSource); } if ((_this$_stroke = this._stroke) !== null && _this$_stroke !== void 0 && _this$_stroke.texture) { this._stroke.texture.destroy(destroyTextureSource); } if ((_this$_originalStroke = this._originalStroke) !== null && _this$_originalStroke !== void 0 && _this$_originalStroke.texture) { this._originalStroke.texture.destroy(destroyTextureSource); } } this._fill = null; this._stroke = null; this.dropShadow = null; this._originalStroke = null; this._originalFill = null; } }, { key: "_createProxy", value: function _createProxy(value, cb) { var _this4 = this; return new Proxy(value, { set: function set(target, property, newValue) { target[property] = newValue; cb === null || cb === void 0 || cb(property, newValue); _this4.update(); return true; } }); } }, { key: "_isFillStyle", value: function _isFillStyle(value) { return (value !== null && value !== void 0 ? value : null) !== null && !(Color.Color.isColorLike(value) || value instanceof FillGradient.FillGradient || value instanceof FillPattern.FillPattern); } }]); }(EventEmitter); /** The default drop shadow settings */ _TextStyle.defaultDropShadow = { /** Set alpha for the drop shadow */ alpha: 1, /** Set a angle of the drop shadow */ angle: Math.PI / 6, /** Set a shadow blur radius */ blur: 0, /** A fill style to be used on the e.g., 'red', '#00FF00' */ color: "black", /** Set a distance of the drop shadow */ distance: 5 }; /** The default text style settings */ _TextStyle.defaultTextStyle = { /** * See {@link TextStyle.align} * @type {'left'|'center'|'right'|'justify'} */ align: "left", /** See {@link TextStyle.breakWords} */ breakWords: false, /** See {@link TextStyle.dropShadow} */ dropShadow: null, /** * See {@link TextStyle.fill} * @type {string|string[]|number|number[]|CanvasGradient|CanvasPattern} */ fill: "black", /** * See {@link TextStyle.fontFamily} * @type {string|string[]} */ fontFamily: "Arial", /** * See {@link TextStyle.fontSize} * @type {number|string} */ fontSize: 26, /** * See {@link TextStyle.fontStyle} * @type {'normal'|'italic'|'oblique'} */ fontStyle: "normal", /** * See {@link TextStyle.fontVariant} * @type {'normal'|'small-caps'} */ fontVariant: "normal", /** * See {@link TextStyle.fontWeight} * @type {'normal'|'bold'|'bolder'|'lighter'|'100'|'200'|'300'|'400'|'500'|'600'|'700'|'800'|'900'} */ fontWeight: "normal", /** See {@link TextStyle.leading} */ leading: 0, /** See {@link TextStyle.letterSpacing} */ letterSpacing: 0, /** See {@link TextStyle.lineHeight} */ lineHeight: 0, /** See {@link TextStyle.padding} */ padding: 0, /** * See {@link TextStyle.stroke} * @type {string|number} */ stroke: null, /** * See {@link TextStyle.textBaseline} * @type {'alphabetic'|'top'|'hanging'|'middle'|'ideographic'|'bottom'} */ textBaseline: "alphabetic", /** See {@link TextStyle.trim} */ trim: false, /** * See {@link TextStyle.whiteSpace} * @type {'normal'|'pre'|'pre-line'} */ whiteSpace: "pre", /** See {@link TextStyle.wordWrap} */ wordWrap: false, /** See {@link TextStyle.wordWrapWidth} */ wordWrapWidth: 100 }; var TextStyle = _TextStyle; function convertV7Tov8Style(style) { var oldStyle = style; if (typeof oldStyle.dropShadow === "boolean" && oldStyle.dropShadow) { var _oldStyle$dropShadowA, _oldStyle$dropShadowA2, _oldStyle$dropShadowB, _oldStyle$dropShadowC, _oldStyle$dropShadowD; var defaults = TextStyle.defaultDropShadow; style.dropShadow = { alpha: (_oldStyle$dropShadowA = oldStyle.dropShadowAlpha) !== null && _oldStyle$dropShadowA !== void 0 ? _oldStyle$dropShadowA : defaults.alpha, angle: (_oldStyle$dropShadowA2 = oldStyle.dropShadowAngle) !== null && _oldStyle$dropShadowA2 !== void 0 ? _oldStyle$dropShadowA2 : defaults.angle, blur: (_oldStyle$dropShadowB = oldStyle.dropShadowBlur) !== null && _oldStyle$dropShadowB !== void 0 ? _oldStyle$dropShadowB : defaults.blur, color: (_oldStyle$dropShadowC = oldStyle.dropShadowColor) !== null && _oldStyle$dropShadowC !== void 0 ? _oldStyle$dropShadowC : defaults.color, distance: (_oldStyle$dropShadowD = oldStyle.dropShadowDistance) !== null && _oldStyle$dropShadowD !== void 0 ? _oldStyle$dropShadowD : defaults.distance }; } if (oldStyle.strokeThickness !== void 0) { deprecation.deprecation(deprecation.v8_0_0, "strokeThickness is now a part of stroke"); var color = oldStyle.stroke; var obj = {}; if (Color.Color.isColorLike(color)) { obj.color = color; } else if (color instanceof FillGradient.FillGradient || color instanceof FillPattern.FillPattern) { obj.fill = color; } else if (Object.hasOwnProperty.call(color, "color") || Object.hasOwnProperty.call(color, "fill")) { obj = color; } else { throw new Error("Invalid stroke value."); } style.stroke = _objectSpread(_objectSpread({}, obj), {}, { width: oldStyle.strokeThickness }); } if (Array.isArray(oldStyle.fillGradientStops)) { deprecation.deprecation(deprecation.v8_0_0, "gradient fill is now a fill pattern: `new FillGradient(...)`"); var fontSize; if (style.fontSize == null) { style.fontSize = TextStyle.defaultTextStyle.fontSize; } else if (typeof style.fontSize === "string") { fontSize = parseInt(style.fontSize, 10); } else { fontSize = style.fontSize; } var gradientFill = new FillGradient.FillGradient({ start: { x: 0, y: 0 }, end: { x: 0, y: (fontSize || 0) * 1.7 } }); var fills = oldStyle.fillGradientStops.map(function (color) { return Color.Color.shared.setValue(color).toNumber(); }); fills.forEach(function (number, index) { var ratio = index / (fills.length - 1); gradientFill.addColorStop(ratio, number); }); style.fill = { fill: gradientFill }; } } exports.TextStyle = TextStyle; /***/ }), /***/ 55946: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var fragmentNameCache = {}; var VertexNameCache = {}; function setProgramName(src, _ref) { var _ref$name = _ref.name, name = _ref$name === void 0 ? "pixi-program" : _ref$name; var isFragment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; name = name.replace(/\s+/g, "-"); name += isFragment ? "-fragment" : "-vertex"; var nameCache = isFragment ? fragmentNameCache : VertexNameCache; if (nameCache[name]) { nameCache[name]++; name += "-".concat(nameCache[name]); } else { nameCache[name] = 1; } if (src.indexOf("#define SHADER_NAME") !== -1) return src; var shaderName = "#define SHADER_NAME ".concat(name); return "".concat(shaderName, "\n").concat(src); } exports.setProgramName = setProgramName; /***/ }), /***/ 56018: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Matrix = __webpack_require__(20764); "use strict"; var ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1]; var uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1]; var vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1]; var vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1]; var rotationCayley = []; var rotationMatrices = []; var signum = Math.sign; function init() { for (var i = 0; i < 16; i++) { var row = []; rotationCayley.push(row); for (var j = 0; j < 16; j++) { var _ux = signum(ux[i] * ux[j] + vx[i] * uy[j]); var _uy = signum(uy[i] * ux[j] + vy[i] * uy[j]); var _vx = signum(ux[i] * vx[j] + vx[i] * vy[j]); var _vy = signum(uy[i] * vx[j] + vy[i] * vy[j]); for (var k = 0; k < 16; k++) { if (ux[k] === _ux && uy[k] === _uy && vx[k] === _vx && vy[k] === _vy) { row.push(k); break; } } } } for (var _i = 0; _i < 16; _i++) { var mat = new Matrix.Matrix(); mat.set(ux[_i], uy[_i], vx[_i], vy[_i], 0, 0); rotationMatrices.push(mat); } } init(); var groupD8 = { /** * | Rotation | Direction | * |----------|-----------| * | 0° | East | * @memberof maths.groupD8 * @constant {GD8Symmetry} */ E: 0, /** * | Rotation | Direction | * |----------|-----------| * | 45°↻ | Southeast | * @memberof maths.groupD8 * @constant {GD8Symmetry} */ SE: 1, /** * | Rotation | Direction | * |----------|-----------| * | 90°↻ | South | * @memberof maths.groupD8 * @constant {GD8Symmetry} */ S: 2, /** * | Rotation | Direction | * |----------|-----------| * | 135°↻ | Southwest | * @memberof maths.groupD8 * @constant {GD8Symmetry} */ SW: 3, /** * | Rotation | Direction | * |----------|-----------| * | 180° | West | * @memberof maths.groupD8 * @constant {GD8Symmetry} */ W: 4, /** * | Rotation | Direction | * |-------------|--------------| * | -135°/225°↻ | Northwest | * @memberof maths.groupD8 * @constant {GD8Symmetry} */ NW: 5, /** * | Rotation | Direction | * |-------------|--------------| * | -90°/270°↻ | North | * @memberof maths.groupD8 * @constant {GD8Symmetry} */ N: 6, /** * | Rotation | Direction | * |-------------|--------------| * | -45°/315°↻ | Northeast | * @memberof maths.groupD8 * @constant {GD8Symmetry} */ NE: 7, /** * Reflection about Y-axis. * @memberof maths.groupD8 * @constant {GD8Symmetry} */ MIRROR_VERTICAL: 8, /** * Reflection about the main diagonal. * @memberof maths.groupD8 * @constant {GD8Symmetry} */ MAIN_DIAGONAL: 10, /** * Reflection about X-axis. * @memberof maths.groupD8 * @constant {GD8Symmetry} */ MIRROR_HORIZONTAL: 12, /** * Reflection about reverse diagonal. * @memberof maths.groupD8 * @constant {GD8Symmetry} */ REVERSE_DIAGONAL: 14, /** * @memberof maths.groupD8 * @param {GD8Symmetry} ind - sprite rotation angle. * @returns {GD8Symmetry} The X-component of the U-axis * after rotating the axes. */ uX: function uX(ind) { return ux[ind]; }, /** * @memberof maths.groupD8 * @param {GD8Symmetry} ind - sprite rotation angle. * @returns {GD8Symmetry} The Y-component of the U-axis * after rotating the axes. */ uY: function uY(ind) { return uy[ind]; }, /** * @memberof maths.groupD8 * @param {GD8Symmetry} ind - sprite rotation angle. * @returns {GD8Symmetry} The X-component of the V-axis * after rotating the axes. */ vX: function vX(ind) { return vx[ind]; }, /** * @memberof maths.groupD8 * @param {GD8Symmetry} ind - sprite rotation angle. * @returns {GD8Symmetry} The Y-component of the V-axis * after rotating the axes. */ vY: function vY(ind) { return vy[ind]; }, /** * @memberof maths.groupD8 * @param {GD8Symmetry} rotation - symmetry whose opposite * is needed. Only rotations have opposite symmetries while * reflections don't. * @returns {GD8Symmetry} The opposite symmetry of `rotation` */ inv: function inv(rotation) { if (rotation & 8) { return rotation & 15; } return -rotation & 7; }, /** * Composes the two D8 operations. * * Taking `^` as reflection: * * | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 | * |-------|-----|-----|-----|-----|------|-------|-------|-------| * | E=0 | E | S | W | N | E^ | S^ | W^ | N^ | * | S=2 | S | W | N | E | S^ | W^ | N^ | E^ | * | W=4 | W | N | E | S | W^ | N^ | E^ | S^ | * | N=6 | N | E | S | W | N^ | E^ | S^ | W^ | * | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S | * | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W | * | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N | * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E | * * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table} * @memberof maths.groupD8 * @param {GD8Symmetry} rotationSecond - Second operation, which * is the row in the above cayley table. * @param {GD8Symmetry} rotationFirst - First operation, which * is the column in the above cayley table. * @returns {GD8Symmetry} Composed operation */ add: function add(rotationSecond, rotationFirst) { return rotationCayley[rotationSecond][rotationFirst]; }, /** * Reverse of `add`. * @memberof maths.groupD8 * @param {GD8Symmetry} rotationSecond - Second operation * @param {GD8Symmetry} rotationFirst - First operation * @returns {GD8Symmetry} Result */ sub: function sub(rotationSecond, rotationFirst) { return rotationCayley[rotationSecond][groupD8.inv(rotationFirst)]; }, /** * Adds 180 degrees to rotation, which is a commutative * operation. * @memberof maths.groupD8 * @param {number} rotation - The number to rotate. * @returns {number} Rotated number */ rotate180: function rotate180(rotation) { return rotation ^ 4; }, /** * Checks if the rotation angle is vertical, i.e. south * or north. It doesn't work for reflections. * @memberof maths.groupD8 * @param {GD8Symmetry} rotation - The number to check. * @returns {boolean} Whether or not the direction is vertical */ isVertical: function isVertical(rotation) { return (rotation & 3) === 2; }, // rotation % 4 === 2 /** * Approximates the vector `V(dx,dy)` into one of the * eight directions provided by `groupD8`. * @memberof maths.groupD8 * @param {number} dx - X-component of the vector * @param {number} dy - Y-component of the vector * @returns {GD8Symmetry} Approximation of the vector into * one of the eight symmetries. */ byDirection: function byDirection(dx, dy) { if (Math.abs(dx) * 2 <= Math.abs(dy)) { if (dy >= 0) { return groupD8.S; } return groupD8.N; } else if (Math.abs(dy) * 2 <= Math.abs(dx)) { if (dx > 0) { return groupD8.E; } return groupD8.W; } else if (dy > 0) { if (dx > 0) { return groupD8.SE; } return groupD8.SW; } else if (dx > 0) { return groupD8.NE; } return groupD8.NW; }, /** * Helps sprite to compensate texture packer rotation. * @memberof maths.groupD8 * @param {Matrix} matrix - sprite world matrix * @param {GD8Symmetry} rotation - The rotation factor to use. * @param {number} tx - sprite anchoring * @param {number} ty - sprite anchoring */ matrixAppendRotationInv: function matrixAppendRotationInv(matrix, rotation) { var tx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var ty = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; var mat = rotationMatrices[groupD8.inv(rotation)]; mat.tx = tx; mat.ty = ty; matrix.append(mat); } }; exports.groupD8 = groupD8; /***/ }), /***/ 56218: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var HTMLTextStyle = __webpack_require__(755); var TextStyle = __webpack_require__(55858); "use strict"; function ensureTextStyle(renderMode, style) { if (style instanceof TextStyle.TextStyle || style instanceof HTMLTextStyle.HTMLTextStyle) { return style; } return renderMode === "html" ? new HTMLTextStyle.HTMLTextStyle(style) : new TextStyle.TextStyle(style); } exports.ensureTextStyle = ensureTextStyle; /***/ }), /***/ 56400: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var squaredDistanceToLineSegment = __webpack_require__(34060); var Rectangle = __webpack_require__(74731); "use strict"; var Triangle = /*#__PURE__*/function () { /** * @param x - The X coord of the first point. * @param y - The Y coord of the first point. * @param x2 - The X coord of the second point. * @param y2 - The Y coord of the second point. * @param x3 - The X coord of the third point. * @param y3 - The Y coord of the third point. */ function Triangle() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; var x3 = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; var y3 = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; _classCallCheck(this, Triangle); /** * The type of the object, mainly used to avoid `instanceof` checks * @default 'triangle' */ this.type = "triangle"; this.x = x; this.y = y; this.x2 = x2; this.y2 = y2; this.x3 = x3; this.y3 = y3; } /** * Checks whether the x and y coordinates given are contained within this triangle * @param x - The X coordinate of the point to test * @param y - The Y coordinate of the point to test * @returns Whether the x/y coordinates are within this Triangle */ return _createClass(Triangle, [{ key: "contains", value: function contains(x, y) { var s = (this.x - this.x3) * (y - this.y3) - (this.y - this.y3) * (x - this.x3); var t = (this.x2 - this.x) * (y - this.y) - (this.y2 - this.y) * (x - this.x); if (s < 0 !== t < 0 && s !== 0 && t !== 0) { return false; } var d = (this.x3 - this.x2) * (y - this.y2) - (this.y3 - this.y2) * (x - this.x2); return d === 0 || d < 0 === s + t <= 0; } /** * Checks whether the x and y coordinates given are contained within this triangle including the stroke. * @param pointX - The X coordinate of the point to test * @param pointY - The Y coordinate of the point to test * @param strokeWidth - The width of the line to check * @param _alignment - The alignment of the stroke * @returns Whether the x/y coordinates are within this triangle */ }, { key: "strokeContains", value: function strokeContains(pointX, pointY, strokeWidth) { var _alignment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5; var halfStrokeWidth = strokeWidth / 2; var halfStrokeWidthSquared = halfStrokeWidth * halfStrokeWidth; var x = this.x, x2 = this.x2, x3 = this.x3, y = this.y, y2 = this.y2, y3 = this.y3; if (squaredDistanceToLineSegment.squaredDistanceToLineSegment(pointX, pointY, x, y, x2, y3) <= halfStrokeWidthSquared || squaredDistanceToLineSegment.squaredDistanceToLineSegment(pointX, pointY, x2, y2, x3, y3) <= halfStrokeWidthSquared || squaredDistanceToLineSegment.squaredDistanceToLineSegment(pointX, pointY, x3, y3, x, y) <= halfStrokeWidthSquared) { return true; } return false; } /** * Creates a clone of this Triangle * @returns a copy of the triangle */ }, { key: "clone", value: function clone() { var triangle = new Triangle(this.x, this.y, this.x2, this.y2, this.x3, this.y3); return triangle; } /** * Copies another triangle to this one. * @param triangle - The triangle to copy from. * @returns Returns itself. */ }, { key: "copyFrom", value: function copyFrom(triangle) { this.x = triangle.x; this.y = triangle.y; this.x2 = triangle.x2; this.y2 = triangle.y2; this.x3 = triangle.x3; this.y3 = triangle.y3; return this; } /** * Copies this triangle to another one. * @param triangle - The triangle to copy to. * @returns Returns given parameter. */ }, { key: "copyTo", value: function copyTo(triangle) { triangle.copyFrom(this); return triangle; } /** * Returns the framing rectangle of the triangle as a Rectangle object * @param out - optional rectangle to store the result * @returns The framing rectangle */ }, { key: "getBounds", value: function getBounds(out) { out || (out = new Rectangle.Rectangle()); var minX = Math.min(this.x, this.x2, this.x3); var maxX = Math.max(this.x, this.x2, this.x3); var minY = Math.min(this.y, this.y2, this.y3); var maxY = Math.max(this.y, this.y2, this.y3); out.x = minX; out.y = minY; out.width = maxX - minX; out.height = maxY - minY; return out; } }]); }(); exports.Triangle = Triangle; /***/ }), /***/ 56451: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Buffer = __webpack_require__(59832); var _const = __webpack_require__(33843); var Geometry = __webpack_require__(18964); var deprecation = __webpack_require__(11225); "use strict"; var _MeshGeometry = /*#__PURE__*/function (_Geometry$Geometry) { function _MeshGeometry() { var _ref; var _this; _classCallCheck(this, _MeshGeometry); var options = (_ref = arguments.length <= 0 ? undefined : arguments[0]) !== null && _ref !== void 0 ? _ref : {}; if (options instanceof Float32Array) { deprecation.deprecation(deprecation.v8_0_0, "use new MeshGeometry({ positions, uvs, indices }) instead"); options = { positions: options, uvs: arguments.length <= 1 ? undefined : arguments[1], indices: arguments.length <= 2 ? undefined : arguments[2] }; } options = _objectSpread(_objectSpread({}, _MeshGeometry.defaultOptions), options); var positions = options.positions || new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]); var uvs = options.uvs; if (!uvs) { if (options.positions) { uvs = new Float32Array(positions.length); } else { uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]); } } var indices = options.indices || new Uint32Array([0, 1, 2, 0, 2, 3]); var shrinkToFit = options.shrinkBuffersToFit; var positionBuffer = new Buffer.Buffer({ data: positions, label: "attribute-mesh-positions", shrinkToFit: shrinkToFit, usage: _const.BufferUsage.VERTEX | _const.BufferUsage.COPY_DST }); var uvBuffer = new Buffer.Buffer({ data: uvs, label: "attribute-mesh-uvs", shrinkToFit: shrinkToFit, usage: _const.BufferUsage.VERTEX | _const.BufferUsage.COPY_DST }); var indexBuffer = new Buffer.Buffer({ data: indices, label: "index-mesh-buffer", shrinkToFit: shrinkToFit, usage: _const.BufferUsage.INDEX | _const.BufferUsage.COPY_DST }); _this = _callSuper(this, _MeshGeometry, [{ attributes: { aPosition: { buffer: positionBuffer, format: "float32x2", stride: 2 * 4, offset: 0 }, aUV: { buffer: uvBuffer, format: "float32x2", stride: 2 * 4, offset: 0 } }, indexBuffer: indexBuffer, topology: options.topology }]); _this.batchMode = "auto"; return _this; } /** The positions of the mesh. */ _inherits(_MeshGeometry, _Geometry$Geometry); return _createClass(_MeshGeometry, [{ key: "positions", get: function get() { return this.attributes.aPosition.buffer.data; } /** * Set the positions of the mesh. * When setting the positions, its important that the uvs array is at least as long as the positions array. * otherwise the geometry will not be valid. * @param {Float32Array} value - The positions of the mesh. */, set: function set(value) { this.attributes.aPosition.buffer.data = value; } /** The UVs of the mesh. */ }, { key: "uvs", get: function get() { return this.attributes.aUV.buffer.data; } /** * Set the UVs of the mesh. * Its important that the uvs array you set is at least as long as the positions array. * otherwise the geometry will not be valid. * @param {Float32Array} value - The UVs of the mesh. */, set: function set(value) { this.attributes.aUV.buffer.data = value; } /** The indices of the mesh. */ }, { key: "indices", get: function get() { return this.indexBuffer.data; }, set: function set(value) { this.indexBuffer.data = value; } }]); }(Geometry.Geometry); _MeshGeometry.defaultOptions = { topology: "triangle-list", shrinkBuffersToFit: false }; var MeshGeometry = _MeshGeometry; exports.MeshGeometry = MeshGeometry; /***/ }), /***/ 56634: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var TextureSource = __webpack_require__(55406); "use strict"; var BufferImageSource = /*#__PURE__*/function (_TextureSource$Textur) { function BufferImageSource(options) { var _this; _classCallCheck(this, BufferImageSource); var buffer = options.resource || new Float32Array(options.width * options.height * 4); var format = options.format; if (!format) { if (buffer instanceof Float32Array) { format = "rgba32float"; } else if (buffer instanceof Int32Array) { format = "rgba32uint"; } else if (buffer instanceof Uint32Array) { format = "rgba32uint"; } else if (buffer instanceof Int16Array) { format = "rgba16uint"; } else if (buffer instanceof Uint16Array) { format = "rgba16uint"; } else if (buffer instanceof Int8Array) { format = "bgra8unorm"; } else { format = "bgra8unorm"; } } _this = _callSuper(this, BufferImageSource, [_objectSpread(_objectSpread({}, options), {}, { resource: buffer, format: format })]); _this.uploadMethodId = "buffer"; return _this; } _inherits(BufferImageSource, _TextureSource$Textur); return _createClass(BufferImageSource, null, [{ key: "test", value: function test(resource) { return resource instanceof Int8Array || resource instanceof Uint8Array || resource instanceof Uint8ClampedArray || resource instanceof Int16Array || resource instanceof Uint16Array || resource instanceof Int32Array || resource instanceof Uint32Array || resource instanceof Float32Array; } }]); }(TextureSource.TextureSource); BufferImageSource.extension = Extensions.ExtensionType.TextureSource; exports.BufferImageSource = BufferImageSource; /***/ }), /***/ 56643: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function clearList(list, index) { index || (index = 0); for (var j = index; j < list.length; j++) { if (list[j]) { list[j] = null; } else { break; } } } exports.clearList = clearList; /***/ }), /***/ 56655: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var source = "struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct MaskUniforms {\n uFilterMatrix:mat3x3<f32>,\n uMaskClamp:vec4<f32>,\n uAlpha:f32,\n uInverse:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;\n@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) filterUv : vec2<f32>,\n};\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);\n}\n\nfn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>\n{\n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>,\n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition),\n getFilterCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) filterUv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n\n var maskClamp = filterUniforms.uMaskClamp;\n var uAlpha = filterUniforms.uAlpha;\n\n var clip = step(3.5,\n step(maskClamp.x, filterUv.x) +\n step(maskClamp.y, filterUv.y) +\n step(filterUv.x, maskClamp.z) +\n step(filterUv.y, maskClamp.w));\n\n var mask = textureSample(uMaskTexture, uSampler, filterUv);\n var source = textureSample(uTexture, uSampler, uv);\n var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);\n\n var a: f32 = alphaMul * mask.r * uAlpha * clip;\n\n if (filterUniforms.uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n return source * a;\n}\n"; exports["default"] = source; /***/ }), /***/ 56696: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var getTestContext = __webpack_require__(25131); "use strict"; var maxFragmentPrecision; function getMaxFragmentPrecision() { if (!maxFragmentPrecision) { maxFragmentPrecision = "mediump"; var gl = getTestContext.getTestContext(); if (gl) { if (gl.getShaderPrecisionFormat) { var shaderFragment = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT); maxFragmentPrecision = shaderFragment.precision ? "highp" : "mediump"; } } } return maxFragmentPrecision; } exports.getMaxFragmentPrecision = getMaxFragmentPrecision; /***/ }), /***/ 57151: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function ensurePrecision(src, options, isFragment) { var maxSupportedPrecision = isFragment ? options.maxSupportedFragmentPrecision : options.maxSupportedVertexPrecision; if (src.substring(0, 9) !== "precision") { var precision = isFragment ? options.requestedFragmentPrecision : options.requestedVertexPrecision; if (precision === "highp" && maxSupportedPrecision !== "highp") { precision = "mediump"; } return "precision ".concat(precision, " float;\n").concat(src); } else if (maxSupportedPrecision !== "highp" && src.substring(0, 15) === "precision highp") { return src.replace("precision highp", "precision mediump"); } return src; } exports.ensurePrecision = ensurePrecision; /***/ }), /***/ 57240: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var CanvasSource = __webpack_require__(35879); var Texture = __webpack_require__(73782); "use strict"; var canvasCache = /* @__PURE__ */new Map(); function getCanvasTexture(canvas, options) { if (!canvasCache.has(canvas)) { var texture = new Texture.Texture({ source: new CanvasSource.CanvasSource(_objectSpread({ resource: canvas }, options)) }); var onDestroy = function onDestroy() { if (canvasCache.get(canvas) === texture) { canvasCache["delete"](canvas); } }; texture.once("destroy", onDestroy); texture.source.once("destroy", onDestroy); canvasCache.set(canvas, texture); } return canvasCache.get(canvas); } function hasCachedCanvasTexture(canvas) { return canvasCache.has(canvas); } exports.getCanvasTexture = getCanvasTexture; exports.hasCachedCanvasTexture = hasCachedCanvasTexture; /***/ }), /***/ 57315: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Color = __webpack_require__(98828); var adapter = __webpack_require__(72450); var Matrix = __webpack_require__(20764); var ImageSource = __webpack_require__(80344); var Texture = __webpack_require__(73782); var uid = __webpack_require__(90844); var deprecation = __webpack_require__(11225); var definedProps = __webpack_require__(48629); "use strict"; var emptyColorStops = [{ offset: 0, color: "white" }, { offset: 1, color: "black" }]; var _FillGradient = /*#__PURE__*/function () { function _FillGradient() { var _this = this; _classCallCheck(this, _FillGradient); /** Unique identifier for this gradient instance */ this.uid = uid.uid("fillGradient"); /** Type of gradient - currently only supports 'linear' */ this.type = "linear"; /** Array of color stops defining the gradient */ this.colorStops = []; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var options = ensureGradientOptions(args); var defaults = options.type === "radial" ? _FillGradient.defaultRadialOptions : _FillGradient.defaultLinearOptions; options = _objectSpread(_objectSpread({}, defaults), definedProps.definedProps(options)); this._textureSize = options.textureSize; if (options.type === "radial") { var _options$outerCenter; this.center = options.center; this.outerCenter = (_options$outerCenter = options.outerCenter) !== null && _options$outerCenter !== void 0 ? _options$outerCenter : this.center; this.innerRadius = options.innerRadius; this.outerRadius = options.outerRadius; this.scale = options.scale; this.rotation = options.rotation; } else { this.start = options.start; this.end = options.end; } this.textureSpace = options.textureSpace; this.type = options.type; options.colorStops.forEach(function (stop) { _this.addColorStop(stop.offset, stop.color); }); } /** * Adds a color stop to the gradient * @param offset - Position of the stop (0-1) * @param color - Color of the stop * @returns This gradient instance for chaining */ return _createClass(_FillGradient, [{ key: "addColorStop", value: function addColorStop(offset, color) { this.colorStops.push({ offset: offset, color: Color.Color.shared.setValue(color).toHexa() }); return this; } /** * Builds the internal texture and transform for the gradient. * Called automatically when the gradient is first used. * @internal */ }, { key: "buildLinearGradient", value: function buildLinearGradient() { if (this.texture) return; var colorStops = this.colorStops.length ? this.colorStops : emptyColorStops; var defaultSize = this._textureSize; var _getCanvas = getCanvas(defaultSize, 1), canvas = _getCanvas.canvas, context = _getCanvas.context; var gradient = context.createLinearGradient(0, 0, this._textureSize, 0); addColorStops(gradient, colorStops); context.fillStyle = gradient; context.fillRect(0, 0, defaultSize, 1); this.texture = new Texture.Texture({ source: new ImageSource.ImageSource({ resource: canvas }) }); var _this$start = this.start, x0 = _this$start.x, y0 = _this$start.y; var _this$end = this.end, x1 = _this$end.x, y1 = _this$end.y; var m = new Matrix.Matrix(); var dx = x1 - x0; var dy = y1 - y0; var dist = Math.sqrt(dx * dx + dy * dy); var angle = Math.atan2(dy, dx); m.scale(dist / defaultSize, 1); m.rotate(angle); m.translate(x0, y0); if (this.textureSpace === "local") { m.scale(defaultSize, defaultSize); } this.transform = m; } }, { key: "buildGradient", value: function buildGradient() { if (this.type === "linear") { this.buildLinearGradient(); } else { this.buildRadialGradient(); } } }, { key: "buildRadialGradient", value: function buildRadialGradient() { if (this.texture) return; var colorStops = this.colorStops.length ? this.colorStops : emptyColorStops; var defaultSize = this._textureSize; var _getCanvas2 = getCanvas(defaultSize, defaultSize), canvas = _getCanvas2.canvas, context = _getCanvas2.context; var _this$center = this.center, x0 = _this$center.x, y0 = _this$center.y; var _this$outerCenter = this.outerCenter, x1 = _this$outerCenter.x, y1 = _this$outerCenter.y; var r0 = this.innerRadius; var r1 = this.outerRadius; var ox = x1 - r1; var oy = y1 - r1; var scale = defaultSize / (r1 * 2); var cx = (x0 - ox) * scale; var cy = (y0 - oy) * scale; var gradient = context.createRadialGradient(cx, cy, r0 * scale, (x1 - ox) * scale, (y1 - oy) * scale, r1 * scale); addColorStops(gradient, colorStops); context.fillStyle = colorStops[colorStops.length - 1].color; context.fillRect(0, 0, defaultSize, defaultSize); context.fillStyle = gradient; context.translate(cx, cy); context.rotate(this.rotation); context.scale(1, this.scale); context.translate(-cx, -cy); context.fillRect(0, 0, defaultSize, defaultSize); this.texture = new Texture.Texture({ source: new ImageSource.ImageSource({ resource: canvas, addressModeU: "clamp-to-edge", addressModeV: "clamp-to-edge" }) }); var m = new Matrix.Matrix(); m.scale(1 / scale, 1 / scale); m.translate(ox, oy); if (this.textureSpace === "local") { m.scale(defaultSize, defaultSize); } this.transform = m; } /** * Gets a unique key representing the current state of the gradient. * Used internally for caching. * @returns Unique string key */ }, { key: "styleKey", get: function get() { return this.uid; } }, { key: "destroy", value: function destroy() { var _this$texture; (_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.destroy(true); this.texture = null; } }]); }(); /** * Default options for creating a gradient fill * @property {PointData} start - Start point of the gradient (default: { x: 0, y: 0 }) * @property {PointData} end - End point of the gradient (default: { x: 0, y: 1 }) * @property {TextureSpace} textureSpace - Whether coordinates are 'global' or 'local' (default: 'local') * @property {number} textureSize - The size of the texture to use for the gradient (default: 256) * @property {Array<{offset: number, color: ColorSource}>} colorStops - Array of color stops (default: empty array) * @property {GradientType} type - Type of gradient (default: 'linear') */ _FillGradient.defaultLinearOptions = { start: { x: 0, y: 0 }, end: { x: 0, y: 1 }, colorStops: [], textureSpace: "local", type: "linear", textureSize: 256 }; /** * Default options for creating a radial gradient fill * @property {PointData} innerCenter - Center of the inner circle (default: { x: 0.5, y: 0.5 }) * @property {number} innerRadius - Radius of the inner circle (default: 0) * @property {PointData} outerCenter - Center of the outer circle (default: { x: 0.5, y: 0.5 }) * @property {number} outerRadius - Radius of the outer circle (default: 0.5) * @property {TextureSpace} textureSpace - Whether coordinates are 'global' or 'local' (default: 'local') * @property {number} textureSize - The size of the texture to use for the gradient (default: 256) * @property {Array<{offset: number, color: ColorSource}>} colorStops - Array of color stops (default: empty array) * @property {GradientType} type - Type of gradient (default: 'radial') */ _FillGradient.defaultRadialOptions = { center: { x: 0.5, y: 0.5 }, innerRadius: 0, outerRadius: 0.5, colorStops: [], scale: 1, textureSpace: "local", type: "radial", textureSize: 256 }; var FillGradient = _FillGradient; function addColorStops(gradient, colorStops) { for (var i = 0; i < colorStops.length; i++) { var stop = colorStops[i]; gradient.addColorStop(stop.offset, stop.color); } } function getCanvas(width, height) { var canvas = adapter.DOMAdapter.get().createCanvas(width, height); var context = canvas.getContext("2d"); return { canvas: canvas, context: context }; } function ensureGradientOptions(args) { var _args$; var options = (_args$ = args[0]) !== null && _args$ !== void 0 ? _args$ : {}; if (typeof options === "number" || args[1]) { var _args$2; deprecation.deprecation("8.5.2", "use options object instead"); options = { type: "linear", start: { x: args[0], y: args[1] }, end: { x: args[2], y: args[3] }, textureSpace: args[4], textureSize: (_args$2 = args[5]) !== null && _args$2 !== void 0 ? _args$2 : FillGradient.defaultLinearOptions.textureSize }; } return options; } exports.FillGradient = FillGradient; /***/ }), /***/ 57371: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var warnCount = 0; var maxWarnings = 500; function warn() { if (warnCount === maxWarnings) return; warnCount++; if (warnCount === maxWarnings) { console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."); } else { var _console; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } (_console = console).warn.apply(_console, ["PixiJS Warning: "].concat(args)); } } exports.warn = warn; /***/ }), /***/ 57519: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var _INTERNAL_FORMAT_TO_T, _INTERNAL_FORMAT_TO_B; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var GL_INTERNAL_FORMAT = /* @__PURE__ */function (GL_INTERNAL_FORMAT2) { GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["RGBA8_SNORM"] = 36759] = "RGBA8_SNORM"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["RGBA"] = 6408] = "RGBA"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["RGBA8UI"] = 36220] = "RGBA8UI"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["SRGB8_ALPHA8"] = 35907] = "SRGB8_ALPHA8"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["RGBA8I"] = 36238] = "RGBA8I"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["RGBA8"] = 32856] = "RGBA8"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGB_S3TC_DXT1_EXT"] = 33776] = "COMPRESSED_RGB_S3TC_DXT1_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_S3TC_DXT1_EXT"] = 33777] = "COMPRESSED_RGBA_S3TC_DXT1_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_S3TC_DXT3_EXT"] = 33778] = "COMPRESSED_RGBA_S3TC_DXT3_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_S3TC_DXT5_EXT"] = 33779] = "COMPRESSED_RGBA_S3TC_DXT5_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT"] = 35917] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT"] = 35918] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT"] = 35919] = "COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB_S3TC_DXT1_EXT"] = 35916] = "COMPRESSED_SRGB_S3TC_DXT1_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RED_RGTC1_EXT"] = 36283] = "COMPRESSED_RED_RGTC1_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SIGNED_RED_RGTC1_EXT"] = 36284] = "COMPRESSED_SIGNED_RED_RGTC1_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RED_GREEN_RGTC2_EXT"] = 36285] = "COMPRESSED_RED_GREEN_RGTC2_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT"] = 36286] = "COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_R11_EAC"] = 37488] = "COMPRESSED_R11_EAC"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SIGNED_R11_EAC"] = 37489] = "COMPRESSED_SIGNED_R11_EAC"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RG11_EAC"] = 37490] = "COMPRESSED_RG11_EAC"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SIGNED_RG11_EAC"] = 37491] = "COMPRESSED_SIGNED_RG11_EAC"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGB8_ETC2"] = 37492] = "COMPRESSED_RGB8_ETC2"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA8_ETC2_EAC"] = 37496] = "COMPRESSED_RGBA8_ETC2_EAC"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ETC2"] = 37493] = "COMPRESSED_SRGB8_ETC2"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"] = 37497] = "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"] = 37494] = "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"] = 37495] = "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_4x4_KHR"] = 37808] = "COMPRESSED_RGBA_ASTC_4x4_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_5x4_KHR"] = 37809] = "COMPRESSED_RGBA_ASTC_5x4_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_5x5_KHR"] = 37810] = "COMPRESSED_RGBA_ASTC_5x5_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_6x5_KHR"] = 37811] = "COMPRESSED_RGBA_ASTC_6x5_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_6x6_KHR"] = 37812] = "COMPRESSED_RGBA_ASTC_6x6_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_8x5_KHR"] = 37813] = "COMPRESSED_RGBA_ASTC_8x5_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_8x6_KHR"] = 37814] = "COMPRESSED_RGBA_ASTC_8x6_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_8x8_KHR"] = 37815] = "COMPRESSED_RGBA_ASTC_8x8_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_10x5_KHR"] = 37816] = "COMPRESSED_RGBA_ASTC_10x5_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_10x6_KHR"] = 37817] = "COMPRESSED_RGBA_ASTC_10x6_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_10x8_KHR"] = 37818] = "COMPRESSED_RGBA_ASTC_10x8_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_10x10_KHR"] = 37819] = "COMPRESSED_RGBA_ASTC_10x10_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_12x10_KHR"] = 37820] = "COMPRESSED_RGBA_ASTC_12x10_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_ASTC_12x12_KHR"] = 37821] = "COMPRESSED_RGBA_ASTC_12x12_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"] = 37840] = "COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"] = 37841] = "COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"] = 37842] = "COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"] = 37843] = "COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"] = 37844] = "COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"] = 37845] = "COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"] = 37846] = "COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"] = 37847] = "COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"] = 37848] = "COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"] = 37849] = "COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"] = 37850] = "COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"] = 37851] = "COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"] = 37852] = "COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"] = 37853] = "COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGBA_BPTC_UNORM_EXT"] = 36492] = "COMPRESSED_RGBA_BPTC_UNORM_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT"] = 36493] = "COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT"] = 36494] = "COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT"; GL_INTERNAL_FORMAT2[GL_INTERNAL_FORMAT2["COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT"] = 36495] = "COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT"; return GL_INTERNAL_FORMAT2; }(GL_INTERNAL_FORMAT || {}); var GL_FORMATS = /* @__PURE__ */function (GL_FORMATS2) { GL_FORMATS2[GL_FORMATS2["RGBA"] = 6408] = "RGBA"; GL_FORMATS2[GL_FORMATS2["RGB"] = 6407] = "RGB"; GL_FORMATS2[GL_FORMATS2["RG"] = 33319] = "RG"; GL_FORMATS2[GL_FORMATS2["RED"] = 6403] = "RED"; GL_FORMATS2[GL_FORMATS2["RGBA_INTEGER"] = 36249] = "RGBA_INTEGER"; GL_FORMATS2[GL_FORMATS2["RGB_INTEGER"] = 36248] = "RGB_INTEGER"; GL_FORMATS2[GL_FORMATS2["RG_INTEGER"] = 33320] = "RG_INTEGER"; GL_FORMATS2[GL_FORMATS2["RED_INTEGER"] = 36244] = "RED_INTEGER"; GL_FORMATS2[GL_FORMATS2["ALPHA"] = 6406] = "ALPHA"; GL_FORMATS2[GL_FORMATS2["LUMINANCE"] = 6409] = "LUMINANCE"; GL_FORMATS2[GL_FORMATS2["LUMINANCE_ALPHA"] = 6410] = "LUMINANCE_ALPHA"; GL_FORMATS2[GL_FORMATS2["DEPTH_COMPONENT"] = 6402] = "DEPTH_COMPONENT"; GL_FORMATS2[GL_FORMATS2["DEPTH_STENCIL"] = 34041] = "DEPTH_STENCIL"; return GL_FORMATS2; }(GL_FORMATS || {}); var GL_TYPES = /* @__PURE__ */function (GL_TYPES2) { GL_TYPES2[GL_TYPES2["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE"; GL_TYPES2[GL_TYPES2["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT"; GL_TYPES2[GL_TYPES2["UNSIGNED_SHORT_5_6_5"] = 33635] = "UNSIGNED_SHORT_5_6_5"; GL_TYPES2[GL_TYPES2["UNSIGNED_SHORT_4_4_4_4"] = 32819] = "UNSIGNED_SHORT_4_4_4_4"; GL_TYPES2[GL_TYPES2["UNSIGNED_SHORT_5_5_5_1"] = 32820] = "UNSIGNED_SHORT_5_5_5_1"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT"] = 5125] = "UNSIGNED_INT"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT_10F_11F_11F_REV"] = 35899] = "UNSIGNED_INT_10F_11F_11F_REV"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT_2_10_10_10_REV"] = 33640] = "UNSIGNED_INT_2_10_10_10_REV"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT_24_8"] = 34042] = "UNSIGNED_INT_24_8"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT_5_9_9_9_REV"] = 35902] = "UNSIGNED_INT_5_9_9_9_REV"; GL_TYPES2[GL_TYPES2["BYTE"] = 5120] = "BYTE"; GL_TYPES2[GL_TYPES2["SHORT"] = 5122] = "SHORT"; GL_TYPES2[GL_TYPES2["INT"] = 5124] = "INT"; GL_TYPES2[GL_TYPES2["FLOAT"] = 5126] = "FLOAT"; GL_TYPES2[GL_TYPES2["FLOAT_32_UNSIGNED_INT_24_8_REV"] = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV"; GL_TYPES2[GL_TYPES2["HALF_FLOAT"] = 36193] = "HALF_FLOAT"; return GL_TYPES2; }(GL_TYPES || {}); var INTERNAL_FORMAT_TO_TEXTURE_FORMATS = (_INTERNAL_FORMAT_TO_T = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_T, 33776 /* COMPRESSED_RGB_S3TC_DXT1_EXT */, "bc1-rgba-unorm"), 33777 /* COMPRESSED_RGBA_S3TC_DXT1_EXT */, "bc1-rgba-unorm"), 33778 /* COMPRESSED_RGBA_S3TC_DXT3_EXT */, "bc2-rgba-unorm"), 33779 /* COMPRESSED_RGBA_S3TC_DXT5_EXT */, "bc3-rgba-unorm"), 35916 /* COMPRESSED_SRGB_S3TC_DXT1_EXT */, "bc1-rgba-unorm-srgb"), 35917 /* COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT */, "bc1-rgba-unorm-srgb"), 35918 /* COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT */, "bc2-rgba-unorm-srgb"), 35919 /* COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT */, "bc3-rgba-unorm-srgb"), 36283 /* COMPRESSED_RED_RGTC1_EXT */, "bc4-r-unorm"), 36284 /* COMPRESSED_SIGNED_RED_RGTC1_EXT */, "bc4-r-snorm"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_T, 36285 /* COMPRESSED_RED_GREEN_RGTC2_EXT */, "bc5-rg-unorm"), 36286 /* COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT */, "bc5-rg-snorm"), 37488 /* COMPRESSED_R11_EAC */, "eac-r11unorm"), 37490 /* COMPRESSED_RG11_EAC */, "eac-rg11snorm"), 37492 /* COMPRESSED_RGB8_ETC2 */, "etc2-rgb8unorm"), 37496 /* COMPRESSED_RGBA8_ETC2_EAC */, "etc2-rgba8unorm"), 37493 /* COMPRESSED_SRGB8_ETC2 */, "etc2-rgb8unorm-srgb"), 37497 /* COMPRESSED_SRGB8_ALPHA8_ETC2_EAC */, "etc2-rgba8unorm-srgb"), 37494 /* COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 */, "etc2-rgb8a1unorm"), 37495 /* COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 */, "etc2-rgb8a1unorm-srgb"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_T, 37808 /* COMPRESSED_RGBA_ASTC_4x4_KHR */, "astc-4x4-unorm"), 37840 /* COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR */, "astc-4x4-unorm-srgb"), 37809 /* COMPRESSED_RGBA_ASTC_5x4_KHR */, "astc-5x4-unorm"), 37841 /* COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR */, "astc-5x4-unorm-srgb"), 37810 /* COMPRESSED_RGBA_ASTC_5x5_KHR */, "astc-5x5-unorm"), 37842 /* COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR */, "astc-5x5-unorm-srgb"), 37811 /* COMPRESSED_RGBA_ASTC_6x5_KHR */, "astc-6x5-unorm"), 37843 /* COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR */, "astc-6x5-unorm-srgb"), 37812 /* COMPRESSED_RGBA_ASTC_6x6_KHR */, "astc-6x6-unorm"), 37844 /* COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR */, "astc-6x6-unorm-srgb"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_T, 37813 /* COMPRESSED_RGBA_ASTC_8x5_KHR */, "astc-8x5-unorm"), 37845 /* COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR */, "astc-8x5-unorm-srgb"), 37814 /* COMPRESSED_RGBA_ASTC_8x6_KHR */, "astc-8x6-unorm"), 37846 /* COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR */, "astc-8x6-unorm-srgb"), 37815 /* COMPRESSED_RGBA_ASTC_8x8_KHR */, "astc-8x8-unorm"), 37847 /* COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR */, "astc-8x8-unorm-srgb"), 37816 /* COMPRESSED_RGBA_ASTC_10x5_KHR */, "astc-10x5-unorm"), 37848 /* COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR */, "astc-10x5-unorm-srgb"), 37817 /* COMPRESSED_RGBA_ASTC_10x6_KHR */, "astc-10x6-unorm"), 37849 /* COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR */, "astc-10x6-unorm-srgb"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_T, 37818 /* COMPRESSED_RGBA_ASTC_10x8_KHR */, "astc-10x8-unorm"), 37850 /* COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR */, "astc-10x8-unorm-srgb"), 37819 /* COMPRESSED_RGBA_ASTC_10x10_KHR */, "astc-10x10-unorm"), 37851 /* COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR */, "astc-10x10-unorm-srgb"), 37820 /* COMPRESSED_RGBA_ASTC_12x10_KHR */, "astc-12x10-unorm"), 37852 /* COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR */, "astc-12x10-unorm-srgb"), 37821 /* COMPRESSED_RGBA_ASTC_12x12_KHR */, "astc-12x12-unorm"), 37853 /* COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR */, "astc-12x12-unorm-srgb"), 36492 /* COMPRESSED_RGBA_BPTC_UNORM_EXT */, "bc7-rgba-unorm"), 36493 /* COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT */, "bc7-rgba-unorm-srgb"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_T, 36494 /* COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT */, "bc6h-rgb-float"), 36495 /* COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT */, "bc6h-rgb-ufloat"), 35907 /* SRGB8_ALPHA8 */, "rgba8unorm-srgb"), 36759 /* RGBA8_SNORM */, "rgba8snorm"), 36220 /* RGBA8UI */, "rgba8uint"), 36238 /* RGBA8I */, "rgba8sint"), 6408 /* RGBA */, "rgba8unorm")); var FILE_IDENTIFIER = [171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10]; var FIELDS = { FILE_IDENTIFIER: 0, ENDIANNESS: 12, GL_TYPE: 16, GL_TYPE_SIZE: 20, GL_FORMAT: 24, GL_INTERNAL_FORMAT: 28, GL_BASE_INTERNAL_FORMAT: 32, PIXEL_WIDTH: 36, PIXEL_HEIGHT: 40, PIXEL_DEPTH: 44, NUMBER_OF_ARRAY_ELEMENTS: 48, NUMBER_OF_FACES: 52, NUMBER_OF_MIPMAP_LEVELS: 56, BYTES_OF_KEY_VALUE_DATA: 60 }; var FILE_HEADER_SIZE = 64; var ENDIANNESS = 67305985; var TYPES_TO_BYTES_PER_COMPONENT = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 5121 /* UNSIGNED_BYTE */, 1), 5123 /* UNSIGNED_SHORT */, 2), 5124 /* INT */, 4), 5125 /* UNSIGNED_INT */, 4), 5126 /* FLOAT */, 4), 36193 /* HALF_FLOAT */, 8); var FORMATS_TO_COMPONENTS = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, 6408 /* RGBA */, 4), 6407 /* RGB */, 3), 33319 /* RG */, 2), 6403 /* RED */, 1), 6409 /* LUMINANCE */, 1), 6410 /* LUMINANCE_ALPHA */, 2), 6406 /* ALPHA */, 1); var TYPES_TO_BYTES_PER_PIXEL = _defineProperty(_defineProperty(_defineProperty({}, 32819 /* UNSIGNED_SHORT_4_4_4_4 */, 2), 32820 /* UNSIGNED_SHORT_5_5_5_1 */, 2), 33635 /* UNSIGNED_SHORT_5_6_5 */, 2); var INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = (_INTERNAL_FORMAT_TO_B = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_B, 33776 /* COMPRESSED_RGB_S3TC_DXT1_EXT */, 0.5), 33777 /* COMPRESSED_RGBA_S3TC_DXT1_EXT */, 0.5), 33778 /* COMPRESSED_RGBA_S3TC_DXT3_EXT */, 1), 33779 /* COMPRESSED_RGBA_S3TC_DXT5_EXT */, 1), 35916 /* COMPRESSED_SRGB_S3TC_DXT1_EXT */, 0.5), 35917 /* COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT */, 0.5), 35918 /* COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT */, 1), 35919 /* COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT */, 1), 36283 /* COMPRESSED_RED_RGTC1_EXT */, 0.5), 36284 /* COMPRESSED_SIGNED_RED_RGTC1_EXT */, 0.5), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_B, 36285 /* COMPRESSED_RED_GREEN_RGTC2_EXT */, 1), 36286 /* COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT */, 1), 37488 /* COMPRESSED_R11_EAC */, 0.5), 37489 /* COMPRESSED_SIGNED_R11_EAC */, 0.5), 37490 /* COMPRESSED_RG11_EAC */, 1), 37491 /* COMPRESSED_SIGNED_RG11_EAC */, 1), 37492 /* COMPRESSED_RGB8_ETC2 */, 0.5), 37496 /* COMPRESSED_RGBA8_ETC2_EAC */, 1), 37493 /* COMPRESSED_SRGB8_ETC2 */, 0.5), 37497 /* COMPRESSED_SRGB8_ALPHA8_ETC2_EAC */, 1), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_B, 37494 /* COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 */, 0.5), 37495 /* COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 */, 0.5), 37808 /* COMPRESSED_RGBA_ASTC_4x4_KHR */, 1), 37840 /* COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR */, 1), 37809 /* COMPRESSED_RGBA_ASTC_5x4_KHR */, 0.8), 37841 /* COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR */, 0.8), 37810 /* COMPRESSED_RGBA_ASTC_5x5_KHR */, 0.64), 37842 /* COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR */, 0.64), 37811 /* COMPRESSED_RGBA_ASTC_6x5_KHR */, 0.53375), 37843 /* COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR */, 0.53375), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_B, 37812 /* COMPRESSED_RGBA_ASTC_6x6_KHR */, 0.445), 37844 /* COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR */, 0.445), 37813 /* COMPRESSED_RGBA_ASTC_8x5_KHR */, 0.4), 37845 /* COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR */, 0.4), 37814 /* COMPRESSED_RGBA_ASTC_8x6_KHR */, 0.33375), 37846 /* COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR */, 0.33375), 37815 /* COMPRESSED_RGBA_ASTC_8x8_KHR */, 0.25), 37847 /* COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR */, 0.25), 37816 /* COMPRESSED_RGBA_ASTC_10x5_KHR */, 0.32), 37848 /* COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR */, 0.32), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_B, 37817 /* COMPRESSED_RGBA_ASTC_10x6_KHR */, 0.26625), 37849 /* COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR */, 0.26625), 37818 /* COMPRESSED_RGBA_ASTC_10x8_KHR */, 0.2), 37850 /* COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR */, 0.2), 37819 /* COMPRESSED_RGBA_ASTC_10x10_KHR */, 0.16), 37851 /* COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR */, 0.16), 37820 /* COMPRESSED_RGBA_ASTC_12x10_KHR */, 0.13375), 37852 /* COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR */, 0.13375), 37821 /* COMPRESSED_RGBA_ASTC_12x12_KHR */, 0.11125), 37853 /* COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR */, 0.11125), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_INTERNAL_FORMAT_TO_B, 36492 /* COMPRESSED_RGBA_BPTC_UNORM_EXT */, 1), 36493 /* COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT */, 1), 36494 /* COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT */, 1), 36495 /* COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT */, 1)); var KTX = { FILE_HEADER_SIZE: FILE_HEADER_SIZE, FILE_IDENTIFIER: FILE_IDENTIFIER, FORMATS_TO_COMPONENTS: FORMATS_TO_COMPONENTS, INTERNAL_FORMAT_TO_BYTES_PER_PIXEL: INTERNAL_FORMAT_TO_BYTES_PER_PIXEL, INTERNAL_FORMAT_TO_TEXTURE_FORMATS: INTERNAL_FORMAT_TO_TEXTURE_FORMATS, FIELDS: FIELDS, TYPES_TO_BYTES_PER_COMPONENT: TYPES_TO_BYTES_PER_COMPONENT, TYPES_TO_BYTES_PER_PIXEL: TYPES_TO_BYTES_PER_PIXEL, ENDIANNESS: ENDIANNESS }; exports.GL_INTERNAL_FORMAT = GL_INTERNAL_FORMAT; exports.KTX = KTX; /***/ }), /***/ 57743: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var HardLightBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function HardLightBlend() { _classCallCheck(this, HardLightBlend); return _callSuper(this, HardLightBlend, [{ gl: { functions: "\n float hardLight(float base, float blend)\n {\n return (blend < 0.5) ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);\n }\n\n vec3 blendHardLight(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n hardLight(base.r, blend.r),\n hardLight(base.g, blend.g),\n hardLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendHardLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn hardLight(base: f32, blend: f32) -> f32\n {\n return select(1.0 - 2.0 * (1.0 - base) * (1.0 - blend), 2.0 * base * blend, blend < 0.5);\n }\n\n fn blendHardLight(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n hardLight(base.r, blend.r),\n hardLight(base.g, blend.g),\n hardLight(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendHardLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(HardLightBlend, _BlendModeFilter$Blen); return _createClass(HardLightBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ HardLightBlend.extension = { name: "hard-light", type: Extensions.ExtensionType.BlendMode }; exports.HardLightBlend = HardLightBlend; /***/ }), /***/ 57962: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 57974: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var createIdFromString = __webpack_require__(79471); var extractAttributesFromGpuProgram = __webpack_require__(10494); var extractStructAndGroups = __webpack_require__(23551); var generateGpuLayoutGroups = __webpack_require__(14405); var generateLayoutHash = __webpack_require__(70823); var removeStructAndGroupDuplicates = __webpack_require__(92893); "use strict"; var programCache = /* @__PURE__ */Object.create(null); var GpuProgram = /*#__PURE__*/function () { /** * Create a new GpuProgram * @param options - The options for the gpu program */ function GpuProgram(options) { var _this$layout$, _this$layout$2; _classCallCheck(this, GpuProgram); /** * @internal * @ignore */ this._layoutKey = 0; /** * @internal * @ignore */ this._attributeLocationsKey = 0; var fragment = options.fragment, vertex = options.vertex, layout = options.layout, gpuLayout = options.gpuLayout, name = options.name; this.name = name; this.fragment = fragment; this.vertex = vertex; if (fragment.source === vertex.source) { var structsAndGroups = extractStructAndGroups.extractStructAndGroups(fragment.source); this.structsAndGroups = structsAndGroups; } else { var vertexStructsAndGroups = extractStructAndGroups.extractStructAndGroups(vertex.source); var fragmentStructsAndGroups = extractStructAndGroups.extractStructAndGroups(fragment.source); this.structsAndGroups = removeStructAndGroupDuplicates.removeStructAndGroupDuplicates(vertexStructsAndGroups, fragmentStructsAndGroups); } this.layout = layout !== null && layout !== void 0 ? layout : generateLayoutHash.generateLayoutHash(this.structsAndGroups); this.gpuLayout = gpuLayout !== null && gpuLayout !== void 0 ? gpuLayout : generateGpuLayoutGroups.generateGpuLayoutGroups(this.structsAndGroups); this.autoAssignGlobalUniforms = !!(((_this$layout$ = this.layout[0]) === null || _this$layout$ === void 0 ? void 0 : _this$layout$.globalUniforms) !== void 0); this.autoAssignLocalUniforms = !!(((_this$layout$2 = this.layout[1]) === null || _this$layout$2 === void 0 ? void 0 : _this$layout$2.localUniforms) !== void 0); this._generateProgramKey(); } // TODO maker this pure return _createClass(GpuProgram, [{ key: "_generateProgramKey", value: function _generateProgramKey() { var vertex = this.vertex, fragment = this.fragment; var bigKey = vertex.source + fragment.source + vertex.entryPoint + fragment.entryPoint; this._layoutKey = createIdFromString.createIdFromString(bigKey, "program"); } }, { key: "attributeData", get: function get() { var _this$_attributeData; (_this$_attributeData = this._attributeData) !== null && _this$_attributeData !== void 0 ? _this$_attributeData : this._attributeData = extractAttributesFromGpuProgram.extractAttributesFromGpuProgram(this.vertex); return this._attributeData; } /** destroys the program */ }, { key: "destroy", value: function destroy() { this.gpuLayout = null; this.layout = null; this.structsAndGroups = null; this.fragment = null; this.vertex = null; } /** * Helper function that creates a program for a given source. * It will check the program cache if the program has already been created. * If it has that one will be returned, if not a new one will be created and cached. * @param options - The options for the program. * @returns A program using the same source */ }], [{ key: "from", value: function from(options) { var key = "".concat(options.vertex.source, ":").concat(options.fragment.source, ":").concat(options.fragment.entryPoint, ":").concat(options.vertex.entryPoint); if (!programCache[key]) { programCache[key] = new GpuProgram(options); } return programCache[key]; } }]); }(); exports.GpuProgram = GpuProgram; /***/ }), /***/ 58002: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var RenderTargetSystem = __webpack_require__(50827); var GlRenderTargetAdaptor = __webpack_require__(53310); "use strict"; var GlRenderTargetSystem = /*#__PURE__*/function (_RenderTargetSystem$R) { function GlRenderTargetSystem(renderer) { var _this; _classCallCheck(this, GlRenderTargetSystem); _this = _callSuper(this, GlRenderTargetSystem, [renderer]); _this.adaptor = new GlRenderTargetAdaptor.GlRenderTargetAdaptor(); _this.adaptor.init(renderer, _this); return _this; } _inherits(GlRenderTargetSystem, _RenderTargetSystem$R); return _createClass(GlRenderTargetSystem); }(RenderTargetSystem.RenderTargetSystem); /** @ignore */ GlRenderTargetSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "renderTarget" }; exports.GlRenderTargetSystem = GlRenderTargetSystem; /***/ }), /***/ 58122: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var FederatedMouseEvent = __webpack_require__(73616); "use strict"; var FederatedPointerEvent = /*#__PURE__*/function (_FederatedMouseEvent$) { function FederatedPointerEvent() { var _this; _classCallCheck(this, FederatedPointerEvent); _this = _callSuper(this, FederatedPointerEvent, arguments); /** * The width of the pointer's contact along the x-axis, measured in CSS pixels. * radiusX of TouchEvents will be represented by this value. * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width */ _this.width = 0; /** * The height of the pointer's contact along the y-axis, measured in CSS pixels. * radiusY of TouchEvents will be represented by this value. * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height */ _this.height = 0; /** * Indicates whether or not the pointer device that created the event is the primary pointer. * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary */ _this.isPrimary = false; return _this; } // Only included for completeness for now _inherits(FederatedPointerEvent, _FederatedMouseEvent$); return _createClass(FederatedPointerEvent, [{ key: "getCoalescedEvents", value: function getCoalescedEvents() { if (this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove") { return [this]; } return []; } // Only included for completeness for now }, { key: "getPredictedEvents", value: function getPredictedEvents() { throw new Error("getPredictedEvents is not supported!"); } }]); }(FederatedMouseEvent.FederatedMouseEvent); exports.FederatedPointerEvent = FederatedPointerEvent; /***/ }), /***/ 58208: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Bounds = __webpack_require__(76631); var getFastGlobalBounds = __webpack_require__(32160); var getGlobalBounds = __webpack_require__(27182); var getLocalBounds = __webpack_require__(81268); var getRenderableBounds = __webpack_require__(36869); var matrixAndBoundsPool = __webpack_require__(22727); var cacheAsTextureMixin = __webpack_require__(21963); var childrenHelperMixin = __webpack_require__(95033); var collectRenderablesMixin = __webpack_require__(3281); var effectsMixin = __webpack_require__(31594); var findMixin = __webpack_require__(24937); var getFastGlobalBoundsMixin = __webpack_require__(86512); var getGlobalMixin = __webpack_require__(62461); var measureMixin = __webpack_require__(44840); var onRenderMixin = __webpack_require__(75327); var sortMixin = __webpack_require__(39244); var toLocalGlobalMixin = __webpack_require__(64373); var Container = __webpack_require__(47719); var CustomRenderPipe = __webpack_require__(7705); __webpack_require__(40925); __webpack_require__(76835); var RenderContainer = __webpack_require__(10927); var RenderGroup = __webpack_require__(17019); var RenderGroupPipe = __webpack_require__(93839); var RenderGroupSystem = __webpack_require__(14342); var assignWithIgnore = __webpack_require__(69095); var checkChildrenDidChange = __webpack_require__(5040); var clearList = __webpack_require__(56643); var collectAllRenderables = __webpack_require__(41368); var definedProps = __webpack_require__(48629); var executeInstructions = __webpack_require__(38224); var mixHexColors = __webpack_require__(36007); var multiplyColors = __webpack_require__(79904); var multiplyHexColors = __webpack_require__(6967); var updateLocalTransform = __webpack_require__(98268); var updateRenderGroupTransforms = __webpack_require__(75315); var updateWorldTransform = __webpack_require__(24425); var validateRenderables = __webpack_require__(28085); var GlGraphicsAdaptor = __webpack_require__(22905); var colorToUniform = __webpack_require__(6455); var GpuGraphicsAdaptor = __webpack_require__(71717); var BatchableGraphics = __webpack_require__(84305); var buildAdaptiveBezier = __webpack_require__(80556); var buildAdaptiveQuadratic = __webpack_require__(6417); var buildArc = __webpack_require__(52165); var buildArcTo = __webpack_require__(64564); var buildArcToSvg = __webpack_require__(32680); var buildCircle = __webpack_require__(94641); var buildLine = __webpack_require__(21187); var buildPixelLine = __webpack_require__(22247); var buildPolygon = __webpack_require__(18591); var buildRectangle = __webpack_require__(92828); var buildTriangle = __webpack_require__(96465); __webpack_require__(55265); var _const = __webpack_require__(99799); var FillGradient = __webpack_require__(57315); var FillPattern = __webpack_require__(95745); __webpack_require__(2686); var Graphics = __webpack_require__(82323); var GraphicsContext = __webpack_require__(59244); var GraphicsContextSystem = __webpack_require__(40545); var GraphicsPipe = __webpack_require__(74199); var GraphicsPath = __webpack_require__(91058); var roundShape = __webpack_require__(6721); var ShapePath = __webpack_require__(71012); var parseSVGDefinitions = __webpack_require__(51274); var parseSVGFloatAttribute = __webpack_require__(99836); var parseSVGPath = __webpack_require__(91281); var parseSVGStyle = __webpack_require__(24185); var SVGParser = __webpack_require__(74704); var extractSvgUrlId = __webpack_require__(45084); var buildContextBatches = __webpack_require__(82847); var buildGeometryFromPath = __webpack_require__(60237); var convertFillInputToFillStyle = __webpack_require__(88129); var generateTextureFillMatrix = __webpack_require__(81004); var getOrientationOfPoints = __webpack_require__(11556); var triangulateWithHoles = __webpack_require__(39333); var RenderLayer = __webpack_require__(2110); var PerspectiveMesh = __webpack_require__(21408); var PerspectivePlaneGeometry = __webpack_require__(83675); var applyProjectiveTransformationToPlane = __webpack_require__(8952); var compute2DProjections = __webpack_require__(10026); var MeshPlane = __webpack_require__(69802); var PlaneGeometry = __webpack_require__(45301); var MeshRope = __webpack_require__(68520); var MeshSimple = __webpack_require__(3418); var RopeGeometry = __webpack_require__(72989); var GlMeshAdaptor = __webpack_require__(5661); var GpuMeshAdapter = __webpack_require__(3851); var BatchableMesh = __webpack_require__(8781); var getTextureDefaultMatrix = __webpack_require__(80657); var Mesh = __webpack_require__(60931); var MeshGeometry = __webpack_require__(56451); var MeshPipe = __webpack_require__(80871); var GlParticleContainerAdaptor = __webpack_require__(54600); var GpuParticleContainerAdaptor = __webpack_require__(98996); var GlParticleContainerPipe = __webpack_require__(61647); var GpuParticleContainerPipe = __webpack_require__(41412); var Particle = __webpack_require__(75313); var ParticleBuffer = __webpack_require__(91743); var ParticleContainer = __webpack_require__(4230); var ParticleContainerPipe = __webpack_require__(52874); var particleData = __webpack_require__(27265); var ParticleShader = __webpack_require__(70026); var createIndicesForQuads = __webpack_require__(33925); var generateParticleUpdateFunction = __webpack_require__(34413); var AnimatedSprite = __webpack_require__(39292); var NineSliceGeometry = __webpack_require__(31598); var NineSliceSprite = __webpack_require__(60583); var NineSliceSpritePipe = __webpack_require__(5699); var tilingBit = __webpack_require__(31054); var TilingSpriteShader = __webpack_require__(47465); var TilingSprite = __webpack_require__(54360); var TilingSpritePipe = __webpack_require__(38468); var applyMatrix = __webpack_require__(23963); var QuadGeometry = __webpack_require__(99539); var setPositions = __webpack_require__(60516); var setUvs = __webpack_require__(43884); var BatchableSprite = __webpack_require__(42517); var Sprite = __webpack_require__(27615); var SpritePipe = __webpack_require__(73707); var AbstractBitmapFont = __webpack_require__(17660); var bitmapFontTextParser = __webpack_require__(89907); var bitmapFontXMLParser = __webpack_require__(75037); var bitmapFontXMLStringParser = __webpack_require__(70868); var loadBitmapFont = __webpack_require__(87115); var BitmapFont = __webpack_require__(79826); var BitmapFontManager = __webpack_require__(30815); var BitmapText = __webpack_require__(84968); var BitmapTextPipe = __webpack_require__(74164); var DynamicBitmapFont = __webpack_require__(2441); var getBitmapTextLayout = __webpack_require__(41914); var resolveCharacters = __webpack_require__(8448); var HTMLText = __webpack_require__(7888); var HTMLTextPipe = __webpack_require__(39148); var HTMLTextRenderData = __webpack_require__(40180); var HTMLTextStyle = __webpack_require__(755); var HTMLTextSystem = __webpack_require__(77693); var extractFontFamilies = __webpack_require__(68618); var getFontCss = __webpack_require__(37368); var getSVGUrl = __webpack_require__(91945); var getTemporaryCanvasFromImage = __webpack_require__(4026); var loadFontAsBase64 = __webpack_require__(78974); var loadFontCSS = __webpack_require__(43382); var loadSVGImage = __webpack_require__(82423); var measureHtmlText = __webpack_require__(54748); var textStyleToCSS = __webpack_require__(85080); var AbstractText = __webpack_require__(93213); var CanvasTextMetrics = __webpack_require__(1635); var CanvasTextPipe = __webpack_require__(22572); var CanvasTextSystem = __webpack_require__(71581); var fontStringFromTextStyle = __webpack_require__(30145); var getCanvasFillStyle = __webpack_require__(52179); var SdfShader = __webpack_require__(10377); var localUniformMSDFBit = __webpack_require__(97018); var mSDFBit = __webpack_require__(85973); var Text = __webpack_require__(61787); var TextStyle = __webpack_require__(55858); var ensureTextStyle = __webpack_require__(56218); var generateTextStyleKey = __webpack_require__(5070); var getPo2TextureFromSource = __webpack_require__(41701); var updateTextBounds = __webpack_require__(38157); var ViewContainer = __webpack_require__(23804); var particles = __webpack_require__(92718); var particles$1 = __webpack_require__(10453); var particles$2 = __webpack_require__(27563); "use strict"; exports.Bounds = Bounds.Bounds; exports.getFastGlobalBounds = getFastGlobalBounds.getFastGlobalBounds; exports._getGlobalBounds = getGlobalBounds._getGlobalBounds; exports.getGlobalBounds = getGlobalBounds.getGlobalBounds; exports.updateTransformBackwards = getGlobalBounds.updateTransformBackwards; exports.getLocalBounds = getLocalBounds.getLocalBounds; exports.getParent = getLocalBounds.getParent; exports.getGlobalRenderableBounds = getRenderableBounds.getGlobalRenderableBounds; exports.boundsPool = matrixAndBoundsPool.boundsPool; exports.matrixPool = matrixAndBoundsPool.matrixPool; exports.cacheAsTextureMixin = cacheAsTextureMixin.cacheAsTextureMixin; exports.childrenHelperMixin = childrenHelperMixin.childrenHelperMixin; exports.collectRenderablesMixin = collectRenderablesMixin.collectRenderablesMixin; exports.effectsMixin = effectsMixin.effectsMixin; exports.findMixin = findMixin.findMixin; exports.getFastGlobalBoundsMixin = getFastGlobalBoundsMixin.getFastGlobalBoundsMixin; exports.bgr2rgb = getGlobalMixin.bgr2rgb; exports.getGlobalMixin = getGlobalMixin.getGlobalMixin; exports.measureMixin = measureMixin.measureMixin; exports.onRenderMixin = onRenderMixin.onRenderMixin; exports.sortMixin = sortMixin.sortMixin; exports.toLocalGlobalMixin = toLocalGlobalMixin.toLocalGlobalMixin; exports.Container = Container.Container; exports.UPDATE_BLEND = Container.UPDATE_BLEND; exports.UPDATE_COLOR = Container.UPDATE_COLOR; exports.UPDATE_TRANSFORM = Container.UPDATE_TRANSFORM; exports.UPDATE_VISIBLE = Container.UPDATE_VISIBLE; exports.CustomRenderPipe = CustomRenderPipe.CustomRenderPipe; exports.RenderContainer = RenderContainer.RenderContainer; exports.RenderGroup = RenderGroup.RenderGroup; exports.RenderGroupPipe = RenderGroupPipe.RenderGroupPipe; exports.RenderGroupSystem = RenderGroupSystem.RenderGroupSystem; exports.assignWithIgnore = assignWithIgnore.assignWithIgnore; exports.checkChildrenDidChange = checkChildrenDidChange.checkChildrenDidChange; exports.clearList = clearList.clearList; exports.collectAllRenderables = collectAllRenderables.collectAllRenderables; exports.definedProps = definedProps.definedProps; exports.executeInstructions = executeInstructions.executeInstructions; exports.mixHexColors = mixHexColors.mixHexColors; exports.multiplyColors = multiplyColors.multiplyColors; exports.multiplyHexColors = multiplyHexColors.multiplyHexColors; exports.updateLocalTransform = updateLocalTransform.updateLocalTransform; exports.updateRenderGroupTransform = updateRenderGroupTransforms.updateRenderGroupTransform; exports.updateRenderGroupTransforms = updateRenderGroupTransforms.updateRenderGroupTransforms; exports.updateTransformAndChildren = updateRenderGroupTransforms.updateTransformAndChildren; exports.updateWorldTransform = updateWorldTransform.updateWorldTransform; exports.validateRenderables = validateRenderables.validateRenderables; exports.GlGraphicsAdaptor = GlGraphicsAdaptor.GlGraphicsAdaptor; exports.color32BitToUniform = colorToUniform.color32BitToUniform; exports.colorToUniform = colorToUniform.colorToUniform; exports.GpuGraphicsAdaptor = GpuGraphicsAdaptor.GpuGraphicsAdaptor; exports.BatchableGraphics = BatchableGraphics.BatchableGraphics; exports.buildAdaptiveBezier = buildAdaptiveBezier.buildAdaptiveBezier; exports.buildAdaptiveQuadratic = buildAdaptiveQuadratic.buildAdaptiveQuadratic; exports.buildArc = buildArc.buildArc; exports.buildArcTo = buildArcTo.buildArcTo; exports.buildArcToSvg = buildArcToSvg.buildArcToSvg; exports.buildCircle = buildCircle.buildCircle; exports.buildEllipse = buildCircle.buildEllipse; exports.buildRoundedRectangle = buildCircle.buildRoundedRectangle; exports.buildLine = buildLine.buildLine; exports.buildPixelLine = buildPixelLine.buildPixelLine; exports.buildPolygon = buildPolygon.buildPolygon; exports.buildRectangle = buildRectangle.buildRectangle; exports.buildTriangle = buildTriangle.buildTriangle; exports.closePointEps = _const.closePointEps; exports.curveEps = _const.curveEps; exports.FillGradient = FillGradient.FillGradient; exports.FillPattern = FillPattern.FillPattern; exports.Graphics = Graphics.Graphics; exports.GraphicsContext = GraphicsContext.GraphicsContext; exports.GpuGraphicsContext = GraphicsContextSystem.GpuGraphicsContext; exports.GraphicsContextRenderData = GraphicsContextSystem.GraphicsContextRenderData; exports.GraphicsContextSystem = GraphicsContextSystem.GraphicsContextSystem; exports.GraphicsPipe = GraphicsPipe.GraphicsPipe; exports.GraphicsPath = GraphicsPath.GraphicsPath; exports.roundedShapeArc = roundShape.roundedShapeArc; exports.roundedShapeQuadraticCurve = roundShape.roundedShapeQuadraticCurve; exports.ShapePath = ShapePath.ShapePath; exports.parseSVGDefinitions = parseSVGDefinitions.parseSVGDefinitions; exports.parseSVGFloatAttribute = parseSVGFloatAttribute.parseSVGFloatAttribute; exports.parseSVGPath = parseSVGPath.parseSVGPath; exports.parseAttribute = parseSVGStyle.parseAttribute; exports.parseSVGStyle = parseSVGStyle.parseSVGStyle; exports.styleAttributes = parseSVGStyle.styleAttributes; exports.SVGParser = SVGParser.SVGParser; exports.extractSvgUrlId = extractSvgUrlId.extractSvgUrlId; exports.buildContextBatches = buildContextBatches.buildContextBatches; exports.shapeBuilders = buildContextBatches.shapeBuilders; exports.buildGeometryFromPath = buildGeometryFromPath.buildGeometryFromPath; exports.toFillStyle = convertFillInputToFillStyle.toFillStyle; exports.toStrokeStyle = convertFillInputToFillStyle.toStrokeStyle; exports.generateTextureMatrix = generateTextureFillMatrix.generateTextureMatrix; exports.getOrientationOfPoints = getOrientationOfPoints.getOrientationOfPoints; exports.triangulateWithHoles = triangulateWithHoles.triangulateWithHoles; exports.RenderLayer = RenderLayer.RenderLayer; exports.RenderLayerClass = RenderLayer.RenderLayerClass; exports.PerspectiveMesh = PerspectiveMesh.PerspectiveMesh; exports.PerspectivePlaneGeometry = PerspectivePlaneGeometry.PerspectivePlaneGeometry; exports.applyProjectiveTransformationToPlane = applyProjectiveTransformationToPlane.applyProjectiveTransformationToPlane; exports.compute2DProjection = compute2DProjections.compute2DProjection; exports.MeshPlane = MeshPlane.MeshPlane; exports.PlaneGeometry = PlaneGeometry.PlaneGeometry; exports.MeshRope = MeshRope.MeshRope; exports.MeshSimple = MeshSimple.MeshSimple; exports.RopeGeometry = RopeGeometry.RopeGeometry; exports.GlMeshAdaptor = GlMeshAdaptor.GlMeshAdaptor; exports.GpuMeshAdapter = GpuMeshAdapter.GpuMeshAdapter; exports.BatchableMesh = BatchableMesh.BatchableMesh; exports.getTextureDefaultMatrix = getTextureDefaultMatrix.getTextureDefaultMatrix; exports.Mesh = Mesh.Mesh; exports.MeshGeometry = MeshGeometry.MeshGeometry; exports.MeshPipe = MeshPipe.MeshPipe; exports.GlParticleContainerAdaptor = GlParticleContainerAdaptor.GlParticleContainerAdaptor; exports.GpuParticleContainerAdaptor = GpuParticleContainerAdaptor.GpuParticleContainerAdaptor; exports.GlParticleContainerPipe = GlParticleContainerPipe.GlParticleContainerPipe; exports.GpuParticleContainerPipe = GpuParticleContainerPipe.GpuParticleContainerPipe; exports.Particle = Particle.Particle; exports.ParticleBuffer = ParticleBuffer.ParticleBuffer; exports.ParticleContainer = ParticleContainer.ParticleContainer; exports.ParticleContainerPipe = ParticleContainerPipe.ParticleContainerPipe; exports.particleData = particleData.particleData; exports.ParticleShader = ParticleShader.ParticleShader; exports.createIndicesForQuads = createIndicesForQuads.createIndicesForQuads; exports.generateParticleUpdateFunction = generateParticleUpdateFunction.generateParticleUpdateFunction; exports.AnimatedSprite = AnimatedSprite.AnimatedSprite; exports.NineSliceGeometry = NineSliceGeometry.NineSliceGeometry; exports.NineSlicePlane = NineSliceSprite.NineSlicePlane; exports.NineSliceSprite = NineSliceSprite.NineSliceSprite; exports.NineSliceSpritePipe = NineSliceSpritePipe.NineSliceSpritePipe; exports.tilingBit = tilingBit.tilingBit; exports.tilingBitGl = tilingBit.tilingBitGl; exports.TilingSpriteShader = TilingSpriteShader.TilingSpriteShader; exports.TilingSprite = TilingSprite.TilingSprite; exports.TilingSpritePipe = TilingSpritePipe.TilingSpritePipe; exports.applyMatrix = applyMatrix.applyMatrix; exports.QuadGeometry = QuadGeometry.QuadGeometry; exports.setPositions = setPositions.setPositions; exports.setUvs = setUvs.setUvs; exports.BatchableSprite = BatchableSprite.BatchableSprite; exports.Sprite = Sprite.Sprite; exports.SpritePipe = SpritePipe.SpritePipe; exports.AbstractBitmapFont = AbstractBitmapFont.AbstractBitmapFont; exports.bitmapFontTextParser = bitmapFontTextParser.bitmapFontTextParser; exports.bitmapFontXMLParser = bitmapFontXMLParser.bitmapFontXMLParser; exports.bitmapFontXMLStringParser = bitmapFontXMLStringParser.bitmapFontXMLStringParser; exports.bitmapFontCachePlugin = loadBitmapFont.bitmapFontCachePlugin; exports.loadBitmapFont = loadBitmapFont.loadBitmapFont; exports.BitmapFont = BitmapFont.BitmapFont; exports.BitmapFontManager = BitmapFontManager.BitmapFontManager; exports.BitmapText = BitmapText.BitmapText; exports.BitmapTextPipe = BitmapTextPipe.BitmapTextPipe; exports.DynamicBitmapFont = DynamicBitmapFont.DynamicBitmapFont; exports.getBitmapTextLayout = getBitmapTextLayout.getBitmapTextLayout; exports.resolveCharacters = resolveCharacters.resolveCharacters; exports.HTMLText = HTMLText.HTMLText; exports.HTMLTextPipe = HTMLTextPipe.HTMLTextPipe; exports.HTMLTextRenderData = HTMLTextRenderData.HTMLTextRenderData; exports.nssvg = HTMLTextRenderData.nssvg; exports.nsxhtml = HTMLTextRenderData.nsxhtml; exports.HTMLTextStyle = HTMLTextStyle.HTMLTextStyle; exports.HTMLTextSystem = HTMLTextSystem.HTMLTextSystem; exports.extractFontFamilies = extractFontFamilies.extractFontFamilies; exports.FontStylePromiseCache = getFontCss.FontStylePromiseCache; exports.getFontCss = getFontCss.getFontCss; exports.getSVGUrl = getSVGUrl.getSVGUrl; exports.getTemporaryCanvasFromImage = getTemporaryCanvasFromImage.getTemporaryCanvasFromImage; exports.loadFontAsBase64 = loadFontAsBase64.loadFontAsBase64; exports.loadFontCSS = loadFontCSS.loadFontCSS; exports.loadSVGImage = loadSVGImage.loadSVGImage; exports.measureHtmlText = measureHtmlText.measureHtmlText; exports.textStyleToCSS = textStyleToCSS.textStyleToCSS; exports.AbstractText = AbstractText.AbstractText; exports.ensureTextOptions = AbstractText.ensureTextOptions; exports.CanvasTextMetrics = CanvasTextMetrics.CanvasTextMetrics; exports.CanvasTextPipe = CanvasTextPipe.CanvasTextPipe; exports.CanvasTextSystem = CanvasTextSystem.CanvasTextSystem; exports.fontStringFromTextStyle = fontStringFromTextStyle.fontStringFromTextStyle; exports.getCanvasFillStyle = getCanvasFillStyle.getCanvasFillStyle; exports.SdfShader = SdfShader.SdfShader; exports.localUniformMSDFBit = localUniformMSDFBit.localUniformMSDFBit; exports.localUniformMSDFBitGl = localUniformMSDFBit.localUniformMSDFBitGl; exports.mSDFBit = mSDFBit.mSDFBit; exports.mSDFBitGl = mSDFBit.mSDFBitGl; exports.Text = Text.Text; exports.TextStyle = TextStyle.TextStyle; exports.ensureTextStyle = ensureTextStyle.ensureTextStyle; exports.generateTextStyleKey = generateTextStyleKey.generateTextStyleKey; exports.getPo2TextureFromSource = getPo2TextureFromSource.getPo2TextureFromSource; exports.updateTextBounds = updateTextBounds.updateTextBounds; exports.ViewContainer = ViewContainer.ViewContainer; exports.particlesFrag = particles["default"]; exports.particlesVert = particles$1["default"]; exports.particlesWgsl = particles$2["default"]; /***/ }), /***/ 58212: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _OOP = __webpack_require__(64181); var _Fragment = _interopRequireDefault(__webpack_require__(32632)); var _FCore = __webpack_require__(49997); var _ResizeSystem = _interopRequireDefault(__webpack_require__(58594)); var _pixi = __webpack_require__(3635); var _AssetManager = _interopRequireDefault(__webpack_require__(47493)); var _RS = _interopRequireDefault(__webpack_require__(86109)); var _Vec = _interopRequireDefault(__webpack_require__(28239)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @augments Context * @extends Fragment * @constructor */ function FlavorAdventure() { var _this = this; _Fragment["default"].call(this); this.app = this; this.scene = null; this.assetMng = new _AssetManager["default"](); this.setContext(_RS["default"].ASSET_MANAGER, this.assetMng); this.pixi = new _pixi.Application(); this.audio = new Audio('./assets/bg.mp3'); this.audio.loop = true; var _waitInteract = function waitInteract() { _this.audio.play()["catch"](function (err) { console.log(err); }); document.removeEventListener('click', _waitInteract); }; document.addEventListener('click', _waitInteract); window.addEventListener('blur', function () { _this.audio.pause(); }); window.addEventListener('focus', function () { if (_this.state === 'RUNNING') { _this.audio.play()["catch"](function (err) { console.log(err); }); } }); } (0, _OOP.mixClass)(FlavorAdventure, _Fragment["default"]); FlavorAdventure.prototype.appWidth = 1620; FlavorAdventure.prototype.appHeight = 1080; FlavorAdventure.prototype.createView = function () { var _this2 = this; this.$attachHook = (0, _FCore._)('attachhook'); this.$view = (0, _FCore._)({ "class": 'as-application', child: [this.$attachHook, { "class": 'as-application-main', child: [{ "class": 'as-application-background' }, { "class": 'as-application-foreground' }] }] }); this.$attachHook.requestUpdateSize = this.onResize.bind(this); this.$attachHook.once('attached', function () { _ResizeSystem["default"].add(_this2.$attachHook); _this2.onResize(); }); this.$main = (0, _FCore.$)('.as-application-main', this.$view); this.$foreground = (0, _FCore.$)('.as-application-foreground', this.$main); this.$background = (0, _FCore.$)('.as-application-background', this.$main); this.$main.style.transform = 'scale(' + 0 + ')'; // // if (!BrowserDetector.isMobile) { // document.body.style.cursor = 'url(assets/cursor_64.png) 12 12, pointer'; // } }; FlavorAdventure.prototype.scale = 1; FlavorAdventure.prototype.onResize = function () { var bound = this.$view.getBoundingClientRect(); var width = bound.width; var height = bound.height; var temp; var needRotate = false; if (width < height) { temp = width; width = height; height = temp; needRotate = true; } var radio = Math.min(width / this.appWidth, height / this.appHeight); this.scale = radio; var transform = 'scale(' + radio + ')'; if (needRotate) { transform += ' rotate(90deg)'; } this.$main.style.transform = transform; this.$main.style.left = (bound.width - this.appWidth) / 2 + 'px'; this.$main.style.top = (bound.height - this.appHeight) / 2 + 'px'; }; /** * * @param {function} SceneClass * @param {any=} bundle */ FlavorAdventure.prototype.startScene = function (SceneClass, bundle) { if (this.scene) { this.scene.stop(); } this.scene = new SceneClass(this, bundle || {}); this.scene.attach(this); switch (this.state) { case "RUNNING": this.scene.start(); break; case "PAUSE": case "STANDBY": this.scene.start(true); break; } }; FlavorAdventure.prototype.onStart = function () { var _this3 = this; this.pixi.init({ width: this.appWidth, height: this.appHeight, backgroundColor: 0x000000, backgroundAlpha: 0 }).then(function () { _this3.$canvas = _this3.pixi.canvas; _this3.$canvas.classList.add('as-application-canvas'); _this3.$main.addChildBefore(_this3.$canvas, _this3.$foreground); _this3.lastUpdateTime = Date.now(); _this3.pixi.ticker.maxFPS = 30; _this3.pixi.ticker.add(function () { var now = Date.now(); var deltaTime = now - _this3.lastUpdateTime; if (_this3.scene) { _this3.scene.update(deltaTime); } _this3.lastUpdateTime = now; }); _this3.$canvas.addEventListener('pointerdown', function (e) { var appBound = _this3.$main.getBoundingClientRect(); var isPT = appBound.width < appBound.height; var mouseX, mouseY; mouseX = e.clientX - appBound.left; mouseY = e.clientY - appBound.top; mouseX /= _this3.scale; mouseY /= _this3.scale; var temp; if (isPT) { temp = mouseY; mouseY = _this3.appHeight - mouseX; mouseX = temp; } if (_this3.scene) _this3.scene.onPointerDown(new _Vec["default"](mouseX, mouseY)); }); _this3.$canvas.addEventListener('pointerup', function (e) { var appBound = _this3.$main.getBoundingClientRect(); var mouseX, mouseY; mouseX = e.clientX - appBound.left; mouseY = e.clientY - appBound.top; mouseX /= _this3.scale; mouseY /= _this3.scale; if (_this3.scene) _this3.scene.onPointerUp(new _Vec["default"](mouseX, mouseY)); }); }); }; FlavorAdventure.prototype.onPause = function () { if (this.scene) { this.scene.pause(); } }; FlavorAdventure.prototype.onResume = function () { if (this.scene) { this.scene.resume(); } }; FlavorAdventure.prototype.onStop = function () { if (this.scene) { this.scene.stop(); } }; var _default = exports["default"] = FlavorAdventure; /***/ }), /***/ 58594: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _AElement = _interopRequireDefault(__webpack_require__(94278)); var _AElementNS = _interopRequireDefault(__webpack_require__(34073)); var _DelaySignal = _interopRequireDefault(__webpack_require__(54676)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @name requestUpdateSize * @type {function} * @memberof AElement# */ /** * @name updateSize * @type {function} * @memberof AElement# */ /** * @name onresize * @type {function} * @memberof AElement# */ /** * @name requestRevokeResource * @type {function} * @memberof AElement# */ /** * * @constructor */ function ResizeSystem() { var _this = this; this.elts = []; this.cache = []; this.cacheOf = null; this.lastResizeTime = 0; this.pendingElts = {}; window.addEventListener('resize', this.update.bind(this)); this['goDown' + 'AndCache'] = this.goDownAndCache.bind(this); this['notify' + 'ToElt'] = this.notifyToElt.bind(this); var _setup = function setup() { _this.domSignal = new _DelaySignal["default"](); _this.domSignal.on('request_update_signal', _this.update.bind(_this)); _this.domSignal.on('request_update_pending_signal', _this.updatePending.bind(_this)); window.removeEventListener("load", _setup); }; if (document.body) { _setup(); } else { window.addEventListener("load", _setup); } } /*** * * @param {AElement | AElementNS} elt */ ResizeSystem.prototype.goDownAndCache = function (elt) { if (this.notifyToElt(elt)) this.cache.push(elt); if (elt.childNodes) { Array.prototype.forEach.call(elt.childNodes, this.goDownAndCache); } }; ResizeSystem.prototype.notifyToElt = function (elt) { try { if (typeof elt.requestUpdateSize == 'function') { elt.requestUpdateSize(); return true; } else if (typeof elt.updateSize == 'function') { elt.updateSize(); return true; } else if (typeof elt.onresize == 'function') { elt.onresize(); return true; } } catch (err) { console.error(err); } }; ResizeSystem.prototype.update = function () { var now = Date.now(); if (now - 100 > this.lastResizeTime) { this.removeTrash(); this.cache = undefined; } this.lastResizeTime = now; if (this.cacheOf !== null) { this.cache = undefined; this.cacheOf = null; } if (this.cache === undefined) { this.cache = []; this.elts.forEach(this.goDownAndCache); } else { this.cache.forEach(this.notifyToElt); } }; ResizeSystem.prototype.requestUpdateSignal = function () { if (!this.domSignal) return; this.domSignal.emit('request_update_signal'); }; ResizeSystem.prototype.removeTrash = function () { var oldArr = this.elts; var newArr = []; var elt; var n = oldArr.length; for (var i = 0; i < n; ++i) { elt = oldArr[i]; if (_AElement["default"].prototype.isDescendantOf.call(elt, document.body)) { newArr.push(elt); } else if (typeof elt.requestRevokeResource === "function") { elt.requestRevokeResource(); } } this.elts = newArr; }; /*** * * @param {AElement| AElementNS | Node} fromElt * @param {boolean=} toRoot * @returns {boolean} */ ResizeSystem.prototype.updateUp = function (fromElt, toRoot) { var found = false; while (fromElt && (!found || toRoot)) { found = this.notifyToElt(fromElt); fromElt = fromElt.parentElement; } return found; }; ResizeSystem.prototype.updatePending = function () { var o = this.pendingElts; this.pendingElts = {}; for (var key in o) { this.notifyToElt(o[key]); } }; /*** * * @param {AElement| AElementNS | Node} fromElt * @param {boolean=} toRoot * @returns {boolean} */ ResizeSystem.prototype.requestUpdateUpSignal = function (fromElt, toRoot) { if (!this.domSignal) return; var elts = []; var found = false; while (fromElt && (!found || toRoot)) { if (typeof fromElt.requestUpdateSize == 'function' || typeof fromElt.updateSize == 'function' || typeof fromElt.onresize == 'function') { elts.push(fromElt); found = true; } fromElt = fromElt.parentElement; } var pendingElts = this.pendingElts; elts.forEach(function (elt) { if (!elt.__resize_ident__) elt.__resize_ident__ = Date.now() + '_' + Math.random(); if (!pendingElts[elt.__resize_ident__]) pendingElts[elt.__resize_ident__] = elt; }); this.domSignal.emit('request_update_pending_signal'); return found; }; /*** * * @param {AElement| AElementNS | Node} fromElt * @returns {boolean} */ ResizeSystem.prototype.updateDown = function (fromElt) { var now = Date.now(); if (now - 100 > this.lastResizeTime) { this.cache = undefined; } this.lastResizeTime = now; if (this.cacheOf !== fromElt) { this.cache = undefined; this.cacheOf = fromElt; } if (this.cache === undefined) { this.cache = []; this.goDownAndCache(fromElt); } else { this.cache.forEach(this.notifyToElt); } }; /*** * * @param {AElement| AElementNS | Node} elt * @return {boolean} */ ResizeSystem.prototype.add = function (elt) { for (var i = 0; i < this.elts.length; ++i) if (_AElement["default"].prototype.isDescendantOf.call(elt, this.elts[i])) { return false; } this.elts = this.elts.filter(function (e) { return !_AElement["default"].prototype.isDescendantOf.call(e, elt); }); this.removeTrash(); this.cache = undefined; this.elts.push(elt); return true; }; var _default = exports["default"] = new ResizeSystem(); /***/ }), /***/ 58669: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var accessibilityTarget = { /** * Flag for if the object is accessible. If true AccessibilityManager will overlay a * shadow div with attributes set * @member {boolean} * @memberof scene.Container# */ accessible: false, /** * Sets the title attribute of the shadow div * If accessibleTitle AND accessibleHint has not been this will default to 'container [tabIndex]' * @member {string} * @memberof scene.Container# */ accessibleTitle: null, /** * Sets the aria-label attribute of the shadow div * @member {string} * @memberof scene.Container# */ accessibleHint: null, /** * @member {number} * @memberof scene.Container# * @todo Needs docs. */ tabIndex: 0, /** * @member {boolean} * @memberof scene.Container# * @private */ _accessibleActive: false, /** * @memberof scene.Container# * @private */ _accessibleDiv: null, /** * Specify the type of div the accessible layer is. Screen readers treat the element differently * depending on this type. Defaults to button. * @member {string} * @memberof scene.Container# * @default 'button' */ accessibleType: "button", /** * Sets the text content of the shadow div * @member {string} * @memberof scene.Container# */ accessibleText: null, /** * Specify the pointer-events the accessible div will use * Defaults to auto. * @type {PointerEvents} * @memberof scene.Container# * @default 'auto' */ accessiblePointerEvents: "auto", /** * Setting to false will prevent any children inside this container to * be accessible. Defaults to true. * @member {boolean} * @memberof scene.Container# * @default true */ accessibleChildren: true, /** * @member {number} * @memberof scene.Container# * @private */ _renderId: -1 }; exports.accessibilityTarget = accessibilityTarget; /***/ }), /***/ 58815: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); "use strict"; var GpuDeviceSystem = /*#__PURE__*/function () { /** * @param {WebGPURenderer} renderer - The renderer this System works for. */ function GpuDeviceSystem(renderer) { _classCallCheck(this, GpuDeviceSystem); this._renderer = renderer; } return _createClass(GpuDeviceSystem, [{ key: "init", value: function () { var _init = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) { var _this = this; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!this._initPromise) { _context.n = 1; break; } return _context.a(2, this._initPromise); case 1: this._initPromise = this._createDeviceAndAdaptor(options).then(function (gpu) { _this.gpu = gpu; _this._renderer.runners.contextChange.emit(_this.gpu); }); return _context.a(2, this._initPromise); } }, _callee, this); })); function init(_x) { return _init.apply(this, arguments); } return init; }() /** * Handle the context change event * @param gpu */ }, { key: "contextChange", value: function contextChange(gpu) { this._renderer.gpu = gpu; } /** * Helper class to create a WebGL Context * @param {object} options - An options object that gets passed in to the canvas element containing the * context attributes * @see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext * @returns {WebGLRenderingContext} the WebGL context */ }, { key: "_createDeviceAndAdaptor", value: (function () { var _createDeviceAndAdaptor2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) { var adapter$1, requiredFeatures, device; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: _context2.n = 1; return adapter.DOMAdapter.get().getNavigator().gpu.requestAdapter({ powerPreference: options.powerPreference, forceFallbackAdapter: options.forceFallbackAdapter }); case 1: adapter$1 = _context2.v; requiredFeatures = ["texture-compression-bc", "texture-compression-astc", "texture-compression-etc2"].filter(function (feature) { return adapter$1.features.has(feature); }); _context2.n = 2; return adapter$1.requestDevice({ requiredFeatures: requiredFeatures }); case 2: device = _context2.v; return _context2.a(2, { adapter: adapter$1, device: device }); } }, _callee2); })); function _createDeviceAndAdaptor(_x2) { return _createDeviceAndAdaptor2.apply(this, arguments); } return _createDeviceAndAdaptor; }()) }, { key: "destroy", value: function destroy() { this.gpu = null; this._renderer = null; } }]); }(); /** @ignore */ GpuDeviceSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "device" }; /** The default options for the GpuDeviceSystem. */ GpuDeviceSystem.defaultOptions = { /** * {@link WebGPUOptions.powerPreference} * @default default */ powerPreference: void 0, /** * Force the use of the fallback adapter * @default false */ forceFallbackAdapter: false }; exports.GpuDeviceSystem = GpuDeviceSystem; /***/ }), /***/ 58840: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function generateLayout(maxTextures) { var layout = {}; var bindIndex = 0; for (var i = 0; i < maxTextures; i++) { layout["textureSource".concat(i + 1)] = bindIndex++; layout["textureSampler".concat(i + 1)] = bindIndex++; } return layout; } exports.generateLayout = generateLayout; /***/ }), /***/ 59061: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } var GlBuffer = /*#__PURE__*/_createClass(function GlBuffer(buffer, type) { _classCallCheck(this, GlBuffer); this._lastBindBaseLocation = -1; this._lastBindCallId = -1; this.buffer = buffer || null; this.updateID = -1; this.byteLength = -1; this.type = type; }); exports.GlBuffer = GlBuffer; /***/ }), /***/ 59158: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Color = __webpack_require__(98828); var autoDetectEnvironment = __webpack_require__(48444); var Container = __webpack_require__(47719); var unsafeEvalSupported = __webpack_require__(70688); var deprecation = __webpack_require__(11225); __webpack_require__(15464); var _const = __webpack_require__(63548); var SystemRunner = __webpack_require__(70652); var EventEmitter = __webpack_require__(19497); "use strict"; var defaultRunners = ["init", "destroy", "contextChange", "resolutionChange", "resetState", "renderEnd", "renderStart", "render", "update", "postrender", "prerender"]; var _AbstractRenderer = /*#__PURE__*/function (_EventEmitter) { /** * Set up a system with a collection of SystemClasses and runners. * Systems are attached dynamically to this class when added. * @param config - the config for the system manager */ function _AbstractRenderer(config) { var _this$config$runners, _this2; var _this; _classCallCheck(this, _AbstractRenderer); _this = _callSuper(this, _AbstractRenderer); _this.runners = /* @__PURE__ */Object.create(null); _this.renderPipes = /* @__PURE__ */Object.create(null); _this._initOptions = {}; _this._systemsHash = /* @__PURE__ */Object.create(null); _this.type = config.type; _this.name = config.name; _this.config = config; var combinedRunners = [].concat(defaultRunners, _toConsumableArray((_this$config$runners = _this.config.runners) !== null && _this$config$runners !== void 0 ? _this$config$runners : [])); (_this2 = _this)._addRunners.apply(_this2, _toConsumableArray(combinedRunners)); _this._unsafeEvalCheck(); return _this; } /** * Initialize the renderer. * @param options - The options to use to create the renderer. */ _inherits(_AbstractRenderer, _EventEmitter); return _createClass(_AbstractRenderer, [{ key: "init", value: (function () { var _init = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var options, skip, systemName, system, defaultSystemOptions, i, _args = arguments; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; skip = options.skipExtensionImports === true ? true : options.manageImports === false; _context.n = 1; return autoDetectEnvironment.loadEnvironmentExtensions(skip); case 1: this._addSystems(this.config.systems); this._addPipes(this.config.renderPipes, this.config.renderPipeAdaptors); for (systemName in this._systemsHash) { system = this._systemsHash[systemName]; defaultSystemOptions = system.constructor.defaultOptions; options = _objectSpread(_objectSpread({}, defaultSystemOptions), options); } options = _objectSpread(_objectSpread({}, _AbstractRenderer.defaultOptions), options); this._roundPixels = options.roundPixels ? 1 : 0; i = 0; case 2: if (!(i < this.runners.init.items.length)) { _context.n = 4; break; } _context.n = 3; return this.runners.init.items[i].init(options); case 3: i++; _context.n = 2; break; case 4: this._initOptions = options; case 5: return _context.a(2); } }, _callee, this); })); function init() { return _init.apply(this, arguments); } return init; }()) }, { key: "render", value: function render(args, deprecated) { var options = args; if (options instanceof Container.Container) { options = { container: options }; if (deprecated) { deprecation.deprecation(deprecation.v8_0_0, "passing a second argument is deprecated, please use render options instead"); options.target = deprecated.renderTexture; } } options.target || (options.target = this.view.renderTarget); if (options.target === this.view.renderTarget) { var _options$clearColor, _options$clear; this._lastObjectRendered = options.container; (_options$clearColor = options.clearColor) !== null && _options$clearColor !== void 0 ? _options$clearColor : options.clearColor = this.background.colorRgba; (_options$clear = options.clear) !== null && _options$clear !== void 0 ? _options$clear : options.clear = this.background.clearBeforeRender; } if (options.clearColor) { var isRGBAArray = Array.isArray(options.clearColor) && options.clearColor.length === 4; options.clearColor = isRGBAArray ? options.clearColor : Color.Color.shared.setValue(options.clearColor).toArray(); } if (!options.transform) { options.container.updateLocalTransform(); options.transform = options.container.localTransform; } options.container.enableRenderGroup(); this.runners.prerender.emit(options); this.runners.renderStart.emit(options); this.runners.render.emit(options); this.runners.renderEnd.emit(options); this.runners.postrender.emit(options); } /** * Resizes the WebGL view to the specified width and height. * @param desiredScreenWidth - The desired width of the screen. * @param desiredScreenHeight - The desired height of the screen. * @param resolution - The resolution / device pixel ratio of the renderer. */ }, { key: "resize", value: function resize(desiredScreenWidth, desiredScreenHeight, resolution) { var previousResolution = this.view.resolution; this.view.resize(desiredScreenWidth, desiredScreenHeight, resolution); this.emit("resize", this.view.screen.width, this.view.screen.height, this.view.resolution); if (resolution !== void 0 && resolution !== previousResolution) { this.runners.resolutionChange.emit(resolution); } } }, { key: "clear", value: function clear() { var _options$clear2; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var renderer = this; options.target || (options.target = renderer.renderTarget.renderTarget); options.clearColor || (options.clearColor = this.background.colorRgba); (_options$clear2 = options.clear) !== null && _options$clear2 !== void 0 ? _options$clear2 : options.clear = _const.CLEAR.ALL; var clear = options.clear, clearColor = options.clearColor, target = options.target; Color.Color.shared.setValue(clearColor !== null && clearColor !== void 0 ? clearColor : this.background.colorRgba); renderer.renderTarget.clear(target, clear, Color.Color.shared.toArray()); } /** The resolution / device pixel ratio of the renderer. */ }, { key: "resolution", get: function get() { return this.view.resolution; }, set: function set(value) { this.view.resolution = value; this.runners.resolutionChange.emit(value); } /** * Same as view.width, actual number of pixels in the canvas by horizontal. * @member {number} * @readonly * @default 800 */ }, { key: "width", get: function get() { return this.view.texture.frame.width; } /** * Same as view.height, actual number of pixels in the canvas by vertical. * @default 600 */ }, { key: "height", get: function get() { return this.view.texture.frame.height; } // NOTE: this was `view` in v7 /** * The canvas element that everything is drawn to. * @type {environment.ICanvas} */ }, { key: "canvas", get: function get() { return this.view.canvas; } /** * the last object rendered by the renderer. Useful for other plugins like interaction managers * @readonly */ }, { key: "lastObjectRendered", get: function get() { return this._lastObjectRendered; } /** * Flag if we are rendering to the screen vs renderTexture * @readonly * @default true */ }, { key: "renderingToScreen", get: function get() { var renderer = this; return renderer.renderTarget.renderingToScreen; } /** * Measurements of the screen. (0, 0, screenWidth, screenHeight). * * Its safe to use as filterArea or hitArea for the whole stage. */ }, { key: "screen", get: function get() { return this.view.screen; } /** * Create a bunch of runners based of a collection of ids * @param runnerIds - the runner ids to add */ }, { key: "_addRunners", value: function _addRunners() { var _this3 = this; for (var _len = arguments.length, runnerIds = new Array(_len), _key = 0; _key < _len; _key++) { runnerIds[_key] = arguments[_key]; } runnerIds.forEach(function (runnerId) { _this3.runners[runnerId] = new SystemRunner.SystemRunner(runnerId); }); } }, { key: "_addSystems", value: function _addSystems(systems) { var i; for (i in systems) { var val = systems[i]; this._addSystem(val.value, val.name); } } /** * Add a new system to the renderer. * @param ClassRef - Class reference * @param name - Property name for system, if not specified * will use a static `name` property on the class itself. This * name will be assigned as s property on the Renderer so make * sure it doesn't collide with properties on Renderer. * @returns Return instance of renderer */ }, { key: "_addSystem", value: function _addSystem(ClassRef, name) { var system = new ClassRef(this); if (this[name]) { throw new Error("Whoops! The name \"".concat(name, "\" is already in use")); } this[name] = system; this._systemsHash[name] = system; for (var i in this.runners) { this.runners[i].add(system); } return this; } }, { key: "_addPipes", value: function _addPipes(pipes, pipeAdaptors) { var _this4 = this; var adaptors = pipeAdaptors.reduce(function (acc, adaptor) { acc[adaptor.name] = adaptor.value; return acc; }, {}); pipes.forEach(function (pipe) { var PipeClass = pipe.value; var name = pipe.name; var Adaptor = adaptors[name]; _this4.renderPipes[name] = new PipeClass(_this4, Adaptor ? new Adaptor() : null); }); } }, { key: "destroy", value: function destroy() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this.runners.destroy.items.reverse(); this.runners.destroy.emit(options); Object.values(this.runners).forEach(function (runner) { runner.destroy(); }); this._systemsHash = null; this.renderPipes = null; } /** * Generate a texture from a container. * @param options - options or container target to use when generating the texture * @returns a texture */ }, { key: "generateTexture", value: function generateTexture(options) { return this.textureGenerator.generateTexture(options); } /** * Whether the renderer will round coordinates to whole pixels when rendering. * Can be overridden on a per scene item basis. */ }, { key: "roundPixels", get: function get() { return !!this._roundPixels; } /** * Overridable function by `pixi.js/unsafe-eval` to silence * throwing an error if platform doesn't support unsafe-evals. * @private * @ignore */ }, { key: "_unsafeEvalCheck", value: function _unsafeEvalCheck() { if (!unsafeEvalSupported.unsafeEvalSupported()) { throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support."); } } /** * Resets the rendering state of the renderer. * This is useful when you want to use the WebGL context directly and need to ensure PixiJS's internal state * stays synchronized. When modifying the WebGL context state externally, calling this method before the next Pixi * render will reset all internal caches and ensure it executes correctly. * * This is particularly useful when combining PixiJS with other rendering engines like Three.js: * ```js * // Reset Three.js state * threeRenderer.resetState(); * * // Render a Three.js scene * threeRenderer.render(threeScene, threeCamera); * * // Reset PixiJS state since Three.js modified the WebGL context * pixiRenderer.resetState(); * * // Now render Pixi content * pixiRenderer.render(pixiScene); * ``` */ }, { key: "resetState", value: function resetState() { this.runners.resetState.emit(); } }]); }(EventEmitter); /** The default options for the renderer. */ _AbstractRenderer.defaultOptions = { /** * Default resolution / device pixel ratio of the renderer. * @default 1 */ resolution: 1, /** * Should the `failIfMajorPerformanceCaveat` flag be enabled as a context option used in the `isWebGLSupported` * function. If set to true, a WebGL renderer can fail to be created if the browser thinks there could be * performance issues when using WebGL. * * In PixiJS v6 this has changed from true to false by default, to allow WebGL to work in as many * scenarios as possible. However, some users may have a poor experience, for example, if a user has a gpu or * driver version blacklisted by the * browser. * * If your application requires high performance rendering, you may wish to set this to false. * We recommend one of two options if you decide to set this flag to false: * * 1: Use the Canvas renderer as a fallback in case high performance WebGL is * not supported. * * 2: Call `isWebGLSupported` (which if found in the utils package) in your code before attempting to create a * PixiJS renderer, and show an error message to the user if the function returns false, explaining that their * device & browser combination does not support high performance WebGL. * This is a much better strategy than trying to create a PixiJS renderer and finding it then fails. * @default false */ failIfMajorPerformanceCaveat: false, /** * Should round pixels be forced when rendering? * @default false */ roundPixels: false }; var AbstractRenderer = _AbstractRenderer; exports.AbstractRenderer = AbstractRenderer; /***/ }), /***/ 59230: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var path = __webpack_require__(30710); "use strict"; function checkExtension(url, extension) { var tempURL = url.split("?")[0]; var ext = path.path.extname(tempURL).toLowerCase(); if (Array.isArray(extension)) { return extension.includes(ext); } return ext === extension; } exports.checkExtension = checkExtension; /***/ }), /***/ 59244: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var Color = __webpack_require__(98828); var Matrix = __webpack_require__(20764); var Point = __webpack_require__(75544); var Texture = __webpack_require__(73782); var uid = __webpack_require__(90844); var deprecation = __webpack_require__(11225); var Bounds = __webpack_require__(76631); var GraphicsPath = __webpack_require__(91058); var SVGParser = __webpack_require__(74704); var convertFillInputToFillStyle = __webpack_require__(88129); "use strict"; var tmpPoint = new Point.Point(); var tempMatrix = new Matrix.Matrix(); var _GraphicsContext = /*#__PURE__*/function (_EventEmitter) { function _GraphicsContext() { var _this; _classCallCheck(this, _GraphicsContext); _this = _callSuper(this, _GraphicsContext, arguments); /** unique id for this graphics context */ _this.uid = uid.uid("graphicsContext"); _this.dirty = true; _this.batchMode = "auto"; _this.instructions = []; _this._activePath = new GraphicsPath.GraphicsPath(); _this._transform = new Matrix.Matrix(); _this._fillStyle = _objectSpread({}, _GraphicsContext.defaultFillStyle); _this._strokeStyle = _objectSpread({}, _GraphicsContext.defaultStrokeStyle); _this._stateStack = []; _this._tick = 0; _this._bounds = new Bounds.Bounds(); _this._boundsDirty = true; return _this; } /** * Creates a new GraphicsContext object that is a clone of this instance, copying all properties, * including the current drawing state, transformations, styles, and instructions. * @returns A new GraphicsContext instance with the same properties and state as this one. */ _inherits(_GraphicsContext, _EventEmitter); return _createClass(_GraphicsContext, [{ key: "clone", value: function clone() { var clone = new _GraphicsContext(); clone.batchMode = this.batchMode; clone.instructions = this.instructions.slice(); clone._activePath = this._activePath.clone(); clone._transform = this._transform.clone(); clone._fillStyle = _objectSpread({}, this._fillStyle); clone._strokeStyle = _objectSpread({}, this._strokeStyle); clone._stateStack = this._stateStack.slice(); clone._bounds = this._bounds.clone(); clone._boundsDirty = true; return clone; } /** * The current fill style of the graphics context. This can be a color, gradient, pattern, or a more complex style defined by a FillStyle object. */ }, { key: "fillStyle", get: function get() { return this._fillStyle; }, set: function set(value) { this._fillStyle = convertFillInputToFillStyle.toFillStyle(value, _GraphicsContext.defaultFillStyle); } /** * The current stroke style of the graphics context. Similar to fill styles, stroke styles can encompass colors, gradients, patterns, or more detailed configurations via a StrokeStyle object. */ }, { key: "strokeStyle", get: function get() { return this._strokeStyle; }, set: function set(value) { this._strokeStyle = convertFillInputToFillStyle.toStrokeStyle(value, _GraphicsContext.defaultStrokeStyle); } /** * Sets the current fill style of the graphics context. The fill style can be a color, gradient, * pattern, or a more complex style defined by a FillStyle object. * @param style - The fill style to apply. This can be a simple color, a gradient or pattern object, * or a FillStyle or ConvertedFillStyle object. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "setFillStyle", value: function setFillStyle(style) { this._fillStyle = convertFillInputToFillStyle.toFillStyle(style, _GraphicsContext.defaultFillStyle); return this; } /** * Sets the current stroke style of the graphics context. Similar to fill styles, stroke styles can * encompass colors, gradients, patterns, or more detailed configurations via a StrokeStyle object. * @param style - The stroke style to apply. Can be defined as a color, a gradient or pattern, * or a StrokeStyle or ConvertedStrokeStyle object. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "setStrokeStyle", value: function setStrokeStyle(style) { this._strokeStyle = convertFillInputToFillStyle.toFillStyle(style, _GraphicsContext.defaultStrokeStyle); return this; } }, { key: "texture", value: function texture(_texture, tint, dx, dy, dw, dh) { this.instructions.push({ action: "texture", data: { image: _texture, dx: dx || 0, dy: dy || 0, dw: dw || _texture.frame.width, dh: dh || _texture.frame.height, transform: this._transform.clone(), alpha: this._fillStyle.alpha, style: tint ? Color.Color.shared.setValue(tint).toNumber() : 16777215 } }); this.onUpdate(); return this; } /** * Resets the current path. Any previous path and its commands are discarded and a new path is * started. This is typically called before beginning a new shape or series of drawing commands. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "beginPath", value: function beginPath() { this._activePath = new GraphicsPath.GraphicsPath(); return this; } }, { key: "fill", value: function fill(style, alpha) { var path; var lastInstruction = this.instructions[this.instructions.length - 1]; if (this._tick === 0 && lastInstruction && lastInstruction.action === "stroke") { path = lastInstruction.data.path; } else { path = this._activePath.clone(); } if (!path) return this; if (style != null) { if (alpha !== void 0 && typeof style === "number") { deprecation.deprecation(deprecation.v8_0_0, "GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"); style = { color: style, alpha: alpha }; } this._fillStyle = convertFillInputToFillStyle.toFillStyle(style, _GraphicsContext.defaultFillStyle); } this.instructions.push({ action: "fill", // TODO copy fill style! data: { style: this.fillStyle, path: path } }); this.onUpdate(); this._initNextPathLocation(); this._tick = 0; return this; } }, { key: "_initNextPathLocation", value: function _initNextPathLocation() { var _this$_activePath$get = this._activePath.getLastPoint(Point.Point.shared), x = _this$_activePath$get.x, y = _this$_activePath$get.y; this._activePath.clear(); this._activePath.moveTo(x, y); } /** * Strokes the current path with the current stroke style. This method can take an optional * FillInput parameter to define the stroke's appearance, including its color, width, and other properties. * @param style - (Optional) The stroke style to apply. Can be defined as a simple color or a more complex style object. If omitted, uses the current stroke style. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "stroke", value: function stroke(style) { var path; var lastInstruction = this.instructions[this.instructions.length - 1]; if (this._tick === 0 && lastInstruction && lastInstruction.action === "fill") { path = lastInstruction.data.path; } else { path = this._activePath.clone(); } if (!path) return this; if (style != null) { this._strokeStyle = convertFillInputToFillStyle.toStrokeStyle(style, _GraphicsContext.defaultStrokeStyle); } this.instructions.push({ action: "stroke", // TODO copy fill style! data: { style: this.strokeStyle, path: path } }); this.onUpdate(); this._initNextPathLocation(); this._tick = 0; return this; } /** * Applies a cutout to the last drawn shape. This is used to create holes or complex shapes by * subtracting a path from the previously drawn path. If a hole is not completely in a shape, it will * fail to cut correctly! * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "cut", value: function cut() { for (var i = 0; i < 2; i++) { var lastInstruction = this.instructions[this.instructions.length - 1 - i]; var holePath = this._activePath.clone(); if (lastInstruction) { if (lastInstruction.action === "stroke" || lastInstruction.action === "fill") { if (lastInstruction.data.hole) { lastInstruction.data.hole.addPath(holePath); } else { lastInstruction.data.hole = holePath; break; } } } } this._initNextPathLocation(); return this; } /** * Adds an arc to the current path, which is centered at (x, y) with the specified radius, * starting and ending angles, and direction. * @param x - The x-coordinate of the arc's center. * @param y - The y-coordinate of the arc's center. * @param radius - The arc's radius. * @param startAngle - The starting angle, in radians. * @param endAngle - The ending angle, in radians. * @param counterclockwise - (Optional) Specifies whether the arc is drawn counterclockwise (true) or clockwise (false). Defaults to false. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "arc", value: function arc(x, y, radius, startAngle, endAngle, counterclockwise) { this._tick++; var t = this._transform; this._activePath.arc(t.a * x + t.c * y + t.tx, t.b * x + t.d * y + t.ty, radius, startAngle, endAngle, counterclockwise); return this; } /** * Adds an arc to the current path with the given control points and radius, connected to the previous point * by a straight line if necessary. * @param x1 - The x-coordinate of the first control point. * @param y1 - The y-coordinate of the first control point. * @param x2 - The x-coordinate of the second control point. * @param y2 - The y-coordinate of the second control point. * @param radius - The arc's radius. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "arcTo", value: function arcTo(x1, y1, x2, y2, radius) { this._tick++; var t = this._transform; this._activePath.arcTo(t.a * x1 + t.c * y1 + t.tx, t.b * x1 + t.d * y1 + t.ty, t.a * x2 + t.c * y2 + t.tx, t.b * x2 + t.d * y2 + t.ty, radius); return this; } /** * Adds an SVG-style arc to the path, allowing for elliptical arcs based on the SVG spec. * @param rx - The x-radius of the ellipse. * @param ry - The y-radius of the ellipse. * @param xAxisRotation - The rotation of the ellipse's x-axis relative * to the x-axis of the coordinate system, in degrees. * @param largeArcFlag - Determines if the arc should be greater than or less than 180 degrees. * @param sweepFlag - Determines if the arc should be swept in a positive angle direction. * @param x - The x-coordinate of the arc's end point. * @param y - The y-coordinate of the arc's end point. * @returns The instance of the current object for chaining. */ }, { key: "arcToSvg", value: function arcToSvg(rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y) { this._tick++; var t = this._transform; this._activePath.arcToSvg(rx, ry, xAxisRotation, // should we rotate this with transform?? largeArcFlag, sweepFlag, t.a * x + t.c * y + t.tx, t.b * x + t.d * y + t.ty); return this; } /** * Adds a cubic Bezier curve to the path. * It requires three points: the first two are control points and the third one is the end point. * The starting point is the last point in the current path. * @param cp1x - The x-coordinate of the first control point. * @param cp1y - The y-coordinate of the first control point. * @param cp2x - The x-coordinate of the second control point. * @param cp2y - The y-coordinate of the second control point. * @param x - The x-coordinate of the end point. * @param y - The y-coordinate of the end point. * @param smoothness - Optional parameter to adjust the smoothness of the curve. * @returns The instance of the current object for chaining. */ }, { key: "bezierCurveTo", value: function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) { this._tick++; var t = this._transform; this._activePath.bezierCurveTo(t.a * cp1x + t.c * cp1y + t.tx, t.b * cp1x + t.d * cp1y + t.ty, t.a * cp2x + t.c * cp2y + t.tx, t.b * cp2x + t.d * cp2y + t.ty, t.a * x + t.c * y + t.tx, t.b * x + t.d * y + t.ty, smoothness); return this; } /** * Closes the current path by drawing a straight line back to the start. * If the shape is already closed or there are no points in the path, this method does nothing. * @returns The instance of the current object for chaining. */ }, { key: "closePath", value: function closePath() { var _this$_activePath; this._tick++; (_this$_activePath = this._activePath) === null || _this$_activePath === void 0 || _this$_activePath.closePath(); return this; } /** * Draws an ellipse at the specified location and with the given x and y radii. * An optional transformation can be applied, allowing for rotation, scaling, and translation. * @param x - The x-coordinate of the center of the ellipse. * @param y - The y-coordinate of the center of the ellipse. * @param radiusX - The horizontal radius of the ellipse. * @param radiusY - The vertical radius of the ellipse. * @returns The instance of the current object for chaining. */ }, { key: "ellipse", value: function ellipse(x, y, radiusX, radiusY) { this._tick++; this._activePath.ellipse(x, y, radiusX, radiusY, this._transform.clone()); return this; } /** * Draws a circle shape. This method adds a new circle path to the current drawing. * @param x - The x-coordinate of the center of the circle. * @param y - The y-coordinate of the center of the circle. * @param radius - The radius of the circle. * @returns The instance of the current object for chaining. */ }, { key: "circle", value: function circle(x, y, radius) { this._tick++; this._activePath.circle(x, y, radius, this._transform.clone()); return this; } /** * Adds another `GraphicsPath` to this path, optionally applying a transformation. * @param path - The `GraphicsPath` to add. * @returns The instance of the current object for chaining. */ }, { key: "path", value: function path(_path) { this._tick++; this._activePath.addPath(_path, this._transform.clone()); return this; } /** * Connects the current point to a new point with a straight line. This method updates the current path. * @param x - The x-coordinate of the new point to connect to. * @param y - The y-coordinate of the new point to connect to. * @returns The instance of the current object for chaining. */ }, { key: "lineTo", value: function lineTo(x, y) { this._tick++; var t = this._transform; this._activePath.lineTo(t.a * x + t.c * y + t.tx, t.b * x + t.d * y + t.ty); return this; } /** * Sets the starting point for a new sub-path. Any subsequent drawing commands are considered part of this path. * @param x - The x-coordinate for the starting point. * @param y - The y-coordinate for the starting point. * @returns The instance of the current object for chaining. */ }, { key: "moveTo", value: function moveTo(x, y) { this._tick++; var t = this._transform; var instructions = this._activePath.instructions; var transformedX = t.a * x + t.c * y + t.tx; var transformedY = t.b * x + t.d * y + t.ty; if (instructions.length === 1 && instructions[0].action === "moveTo") { instructions[0].data[0] = transformedX; instructions[0].data[1] = transformedY; return this; } this._activePath.moveTo(transformedX, transformedY); return this; } /** * Adds a quadratic curve to the path. It requires two points: the control point and the end point. * The starting point is the last point in the current path. * @param cpx - The x-coordinate of the control point. * @param cpy - The y-coordinate of the control point. * @param x - The x-coordinate of the end point. * @param y - The y-coordinate of the end point. * @param smoothness - Optional parameter to adjust the smoothness of the curve. * @returns The instance of the current object for chaining. */ }, { key: "quadraticCurveTo", value: function quadraticCurveTo(cpx, cpy, x, y, smoothness) { this._tick++; var t = this._transform; this._activePath.quadraticCurveTo(t.a * cpx + t.c * cpy + t.tx, t.b * cpx + t.d * cpy + t.ty, t.a * x + t.c * y + t.tx, t.b * x + t.d * y + t.ty, smoothness); return this; } /** * Draws a rectangle shape. This method adds a new rectangle path to the current drawing. * @param x - The x-coordinate of the top-left corner of the rectangle. * @param y - The y-coordinate of the top-left corner of the rectangle. * @param w - The width of the rectangle. * @param h - The height of the rectangle. * @returns The instance of the current object for chaining. */ }, { key: "rect", value: function rect(x, y, w, h) { this._tick++; this._activePath.rect(x, y, w, h, this._transform.clone()); return this; } /** * Draws a rectangle with rounded corners. * The corner radius can be specified to determine how rounded the corners should be. * An optional transformation can be applied, which allows for rotation, scaling, and translation of the rectangle. * @param x - The x-coordinate of the top-left corner of the rectangle. * @param y - The y-coordinate of the top-left corner of the rectangle. * @param w - The width of the rectangle. * @param h - The height of the rectangle. * @param radius - The radius of the rectangle's corners. If not specified, corners will be sharp. * @returns The instance of the current object for chaining. */ }, { key: "roundRect", value: function roundRect(x, y, w, h, radius) { this._tick++; this._activePath.roundRect(x, y, w, h, radius, this._transform.clone()); return this; } /** * Draws a polygon shape by specifying a sequence of points. This method allows for the creation of complex polygons, * which can be both open and closed. An optional transformation can be applied, enabling the polygon to be scaled, * rotated, or translated as needed. * @param points - An array of numbers, or an array of PointData objects eg [{x,y}, {x,y}, {x,y}] * representing the x and y coordinates, of the polygon's vertices, in sequence. * @param close - A boolean indicating whether to close the polygon path. True by default. */ }, { key: "poly", value: function poly(points, close) { this._tick++; this._activePath.poly(points, close, this._transform.clone()); return this; } /** * Draws a regular polygon with a specified number of sides. All sides and angles are equal. * @param x - The x-coordinate of the center of the polygon. * @param y - The y-coordinate of the center of the polygon. * @param radius - The radius of the circumscribed circle of the polygon. * @param sides - The number of sides of the polygon. Must be 3 or more. * @param rotation - The rotation angle of the polygon, in radians. Zero by default. * @param transform - An optional `Matrix` object to apply a transformation to the polygon. * @returns The instance of the current object for chaining. */ }, { key: "regularPoly", value: function regularPoly(x, y, radius, sides) { var rotation = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; var transform = arguments.length > 5 ? arguments[5] : undefined; this._tick++; this._activePath.regularPoly(x, y, radius, sides, rotation, transform); return this; } /** * Draws a polygon with rounded corners. * Similar to `regularPoly` but with the ability to round the corners of the polygon. * @param x - The x-coordinate of the center of the polygon. * @param y - The y-coordinate of the center of the polygon. * @param radius - The radius of the circumscribed circle of the polygon. * @param sides - The number of sides of the polygon. Must be 3 or more. * @param corner - The radius of the rounding of the corners. * @param rotation - The rotation angle of the polygon, in radians. Zero by default. * @returns The instance of the current object for chaining. */ }, { key: "roundPoly", value: function roundPoly(x, y, radius, sides, corner, rotation) { this._tick++; this._activePath.roundPoly(x, y, radius, sides, corner, rotation); return this; } /** * Draws a shape with rounded corners. This function supports custom radius for each corner of the shape. * Optionally, corners can be rounded using a quadratic curve instead of an arc, providing a different aesthetic. * @param points - An array of `RoundedPoint` representing the corners of the shape to draw. * A minimum of 3 points is required. * @param radius - The default radius for the corners. * This radius is applied to all corners unless overridden in `points`. * @param useQuadratic - If set to true, rounded corners are drawn using a quadraticCurve * method instead of an arc method. Defaults to false. * @param smoothness - Specifies the smoothness of the curve when `useQuadratic` is true. * Higher values make the curve smoother. * @returns The instance of the current object for chaining. */ }, { key: "roundShape", value: function roundShape(points, radius, useQuadratic, smoothness) { this._tick++; this._activePath.roundShape(points, radius, useQuadratic, smoothness); return this; } /** * Draw Rectangle with fillet corners. This is much like rounded rectangle * however it support negative numbers as well for the corner radius. * @param x - Upper left corner of rect * @param y - Upper right corner of rect * @param width - Width of rect * @param height - Height of rect * @param fillet - accept negative or positive values */ }, { key: "filletRect", value: function filletRect(x, y, width, height, fillet) { this._tick++; this._activePath.filletRect(x, y, width, height, fillet); return this; } /** * Draw Rectangle with chamfer corners. These are angled corners. * @param x - Upper left corner of rect * @param y - Upper right corner of rect * @param width - Width of rect * @param height - Height of rect * @param chamfer - non-zero real number, size of corner cutout * @param transform */ }, { key: "chamferRect", value: function chamferRect(x, y, width, height, chamfer, transform) { this._tick++; this._activePath.chamferRect(x, y, width, height, chamfer, transform); return this; } /** * Draws a star shape centered at a specified location. This method allows for the creation * of stars with a variable number of points, outer radius, optional inner radius, and rotation. * The star is drawn as a closed polygon with alternating outer and inner vertices to create the star's points. * An optional transformation can be applied to scale, rotate, or translate the star as needed. * @param x - The x-coordinate of the center of the star. * @param y - The y-coordinate of the center of the star. * @param points - The number of points of the star. * @param radius - The outer radius of the star (distance from the center to the outer points). * @param innerRadius - Optional. The inner radius of the star * (distance from the center to the inner points between the outer points). * If not provided, defaults to half of the `radius`. * @param rotation - Optional. The rotation of the star in radians, where 0 is aligned with the y-axis. * Defaults to 0, meaning one point is directly upward. * @returns The instance of the current object for chaining further drawing commands. */ }, { key: "star", value: function star(x, y, points, radius) { var innerRadius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; var rotation = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; this._tick++; this._activePath.star(x, y, points, radius, innerRadius, rotation, this._transform.clone()); return this; } /** * Parses and renders an SVG string into the graphics context. This allows for complex shapes and paths * defined in SVG format to be drawn within the graphics context. * @param svg - The SVG string to be parsed and rendered. */ }, { key: "svg", value: function svg(_svg) { this._tick++; SVGParser.SVGParser(_svg, this); return this; } /** * Restores the most recently saved graphics state by popping the top of the graphics state stack. * This includes transformations, fill styles, and stroke styles. */ }, { key: "restore", value: function restore() { var state = this._stateStack.pop(); if (state) { this._transform = state.transform; this._fillStyle = state.fillStyle; this._strokeStyle = state.strokeStyle; } return this; } /** Saves the current graphics state, including transformations, fill styles, and stroke styles, onto a stack. */ }, { key: "save", value: function save() { this._stateStack.push({ transform: this._transform.clone(), fillStyle: _objectSpread({}, this._fillStyle), strokeStyle: _objectSpread({}, this._strokeStyle) }); return this; } /** * Returns the current transformation matrix of the graphics context. * @returns The current transformation matrix. */ }, { key: "getTransform", value: function getTransform() { return this._transform; } /** * Resets the current transformation matrix to the identity matrix, effectively removing any transformations (rotation, scaling, translation) previously applied. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "resetTransform", value: function resetTransform() { this._transform.identity(); return this; } /** * Applies a rotation transformation to the graphics context around the current origin. * @param angle - The angle of rotation in radians. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "rotate", value: function rotate(angle) { this._transform.rotate(angle); return this; } /** * Applies a scaling transformation to the graphics context, scaling drawings by x horizontally and by y vertically. * @param x - The scale factor in the horizontal direction. * @param y - (Optional) The scale factor in the vertical direction. If not specified, the x value is used for both directions. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "scale", value: function scale(x) { var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; this._transform.scale(x, y); return this; } }, { key: "setTransform", value: function setTransform(a, b, c, d, dx, dy) { if (a instanceof Matrix.Matrix) { this._transform.set(a.a, a.b, a.c, a.d, a.tx, a.ty); return this; } this._transform.set(a, b, c, d, dx, dy); return this; } }, { key: "transform", value: function transform(a, b, c, d, dx, dy) { if (a instanceof Matrix.Matrix) { this._transform.append(a); return this; } tempMatrix.set(a, b, c, d, dx, dy); this._transform.append(tempMatrix); return this; } /** * Applies a translation transformation to the graphics context, moving the origin by the specified amounts. * @param x - The amount to translate in the horizontal direction. * @param y - (Optional) The amount to translate in the vertical direction. If not specified, the x value is used for both directions. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "translate", value: function translate(x) { var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; this._transform.translate(x, y); return this; } /** * Clears all drawing commands from the graphics context, effectively resetting it. This includes clearing the path, * and optionally resetting transformations to the identity matrix. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "clear", value: function clear() { this._activePath.clear(); this.instructions.length = 0; this.resetTransform(); this.onUpdate(); return this; } }, { key: "onUpdate", value: function onUpdate() { if (this.dirty) return; this.emit("update", this, 16); this.dirty = true; this._boundsDirty = true; } /** The bounds of the graphic shape. */ }, { key: "bounds", get: function get() { if (!this._boundsDirty) return this._bounds; var bounds = this._bounds; bounds.clear(); for (var i = 0; i < this.instructions.length; i++) { var instruction = this.instructions[i]; var action = instruction.action; if (action === "fill") { var data = instruction.data; bounds.addBounds(data.path.bounds); } else if (action === "texture") { var _data = instruction.data; bounds.addFrame(_data.dx, _data.dy, _data.dx + _data.dw, _data.dy + _data.dh, _data.transform); } if (action === "stroke") { var _data2 = instruction.data; var alignment = _data2.style.alignment; var outerPadding = _data2.style.width * (1 - alignment); var _bounds = _data2.path.bounds; bounds.addFrame(_bounds.minX - outerPadding, _bounds.minY - outerPadding, _bounds.maxX + outerPadding, _bounds.maxY + outerPadding); } } return bounds; } /** * Check to see if a point is contained within this geometry. * @param point - Point to check if it's contained. * @returns {boolean} `true` if the point is contained within geometry. */ }, { key: "containsPoint", value: function containsPoint(point) { if (!this.bounds.containsPoint(point.x, point.y)) return false; var instructions = this.instructions; var hasHit = false; for (var k = 0; k < instructions.length; k++) { var instruction = instructions[k]; var data = instruction.data; var path = data.path; if (!instruction.action || !path) continue; var style = data.style; var shapes = path.shapePath.shapePrimitives; for (var i = 0; i < shapes.length; i++) { var shape = shapes[i].shape; if (!style || !shape) continue; var transform = shapes[i].transform; var transformedPoint = transform ? transform.applyInverse(point, tmpPoint) : point; if (instruction.action === "fill") { hasHit = shape.contains(transformedPoint.x, transformedPoint.y); } else { var strokeStyle = style; hasHit = shape.strokeContains(transformedPoint.x, transformedPoint.y, strokeStyle.width, strokeStyle.alignment); } var holes = data.hole; if (holes) { var _holes$shapePath; var holeShapes = (_holes$shapePath = holes.shapePath) === null || _holes$shapePath === void 0 ? void 0 : _holes$shapePath.shapePrimitives; if (holeShapes) { for (var j = 0; j < holeShapes.length; j++) { if (holeShapes[j].shape.contains(transformedPoint.x, transformedPoint.y)) { hasHit = false; } } } } if (hasHit) { return true; } } } return hasHit; } /** * Destroys the GraphicsData object. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the current texture of the fill/stroke style? * @param {boolean} [options.textureSource=false] - Should it destroy the texture source of the fill/stroke style? */ }, { key: "destroy", value: function destroy() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this._stateStack.length = 0; this._transform = null; this.emit("destroy", this); this.removeAllListeners(); var destroyTexture = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.texture; if (destroyTexture) { var destroyTextureSource = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.textureSource; if (this._fillStyle.texture) { this._fillStyle.texture.destroy(destroyTextureSource); } if (this._strokeStyle.texture) { this._strokeStyle.texture.destroy(destroyTextureSource); } } this._fillStyle = null; this._strokeStyle = null; this.instructions = null; this._activePath = null; this._bounds = null; this._stateStack = null; this.customShader = null; this._transform = null; } }]); }(EventEmitter); /** The default fill style to use when none is provided. */ _GraphicsContext.defaultFillStyle = { /** The color to use for the fill. */ color: 16777215, /** The alpha value to use for the fill. */ alpha: 1, /** The texture to use for the fill. */ texture: Texture.Texture.WHITE, /** The matrix to apply. */ matrix: null, /** The fill pattern to use. */ fill: null, /** Whether coordinates are 'global' or 'local' */ textureSpace: "local" }; /** The default stroke style to use when none is provided. */ _GraphicsContext.defaultStrokeStyle = { /** The width of the stroke. */ width: 1, /** The color to use for the stroke. */ color: 16777215, /** The alpha value to use for the stroke. */ alpha: 1, /** The alignment of the stroke. */ alignment: 0.5, /** The miter limit to use. */ miterLimit: 10, /** The line cap style to use. */ cap: "butt", /** The line join style to use. */ join: "miter", /** The texture to use for the fill. */ texture: Texture.Texture.WHITE, /** The matrix to apply. */ matrix: null, /** The fill pattern to use. */ fill: null, /** Whether coordinates are 'global' or 'local' */ textureSpace: "local", /** If the stroke is a pixel line. */ pixelLine: false }; var GraphicsContext = _GraphicsContext; exports.GraphicsContext = GraphicsContext; /***/ }), /***/ 59249: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var GAUSSIAN_VALUES = { 5: [0.153388, 0.221461, 0.250301], 7: [0.071303, 0.131514, 0.189879, 0.214607], 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236], 11: [93e-4, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596], 13: [2406e-6, 9255e-6, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641], 15: [489e-6, 2403e-6, 9246e-6, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448] }; exports.GAUSSIAN_VALUES = GAUSSIAN_VALUES; /***/ }), /***/ 59471: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var GpuEncoderSystem = /*#__PURE__*/function () { function GpuEncoderSystem(renderer) { _classCallCheck(this, GpuEncoderSystem); this._boundBindGroup = /* @__PURE__ */Object.create(null); this._boundVertexBuffer = /* @__PURE__ */Object.create(null); this._renderer = renderer; } return _createClass(GpuEncoderSystem, [{ key: "renderStart", value: function renderStart() { var _this = this; this.commandFinished = new Promise(function (resolve) { _this._resolveCommandFinished = resolve; }); this.commandEncoder = this._renderer.gpu.device.createCommandEncoder(); } }, { key: "beginRenderPass", value: function beginRenderPass(gpuRenderTarget) { this.endRenderPass(); this._clearCache(); this.renderPassEncoder = this.commandEncoder.beginRenderPass(gpuRenderTarget.descriptor); } }, { key: "endRenderPass", value: function endRenderPass() { if (this.renderPassEncoder) { this.renderPassEncoder.end(); } this.renderPassEncoder = null; } }, { key: "setViewport", value: function setViewport(viewport) { this.renderPassEncoder.setViewport(viewport.x, viewport.y, viewport.width, viewport.height, 0, 1); } }, { key: "setPipelineFromGeometryProgramAndState", value: function setPipelineFromGeometryProgramAndState(geometry, program, state, topology) { var pipeline = this._renderer.pipeline.getPipeline(geometry, program, state, topology); this.setPipeline(pipeline); } }, { key: "setPipeline", value: function setPipeline(pipeline) { if (this._boundPipeline === pipeline) return; this._boundPipeline = pipeline; this.renderPassEncoder.setPipeline(pipeline); } }, { key: "_setVertexBuffer", value: function _setVertexBuffer(index, buffer) { if (this._boundVertexBuffer[index] === buffer) return; this._boundVertexBuffer[index] = buffer; this.renderPassEncoder.setVertexBuffer(index, this._renderer.buffer.updateBuffer(buffer)); } }, { key: "_setIndexBuffer", value: function _setIndexBuffer(buffer) { if (this._boundIndexBuffer === buffer) return; this._boundIndexBuffer = buffer; var indexFormat = buffer.data.BYTES_PER_ELEMENT === 2 ? "uint16" : "uint32"; this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(buffer), indexFormat); } }, { key: "resetBindGroup", value: function resetBindGroup(index) { this._boundBindGroup[index] = null; } }, { key: "setBindGroup", value: function setBindGroup(index, bindGroup, program) { if (this._boundBindGroup[index] === bindGroup) return; this._boundBindGroup[index] = bindGroup; bindGroup._touch(this._renderer.textureGC.count); var gpuBindGroup = this._renderer.bindGroup.getBindGroup(bindGroup, program, index); this.renderPassEncoder.setBindGroup(index, gpuBindGroup); } }, { key: "setGeometry", value: function setGeometry(geometry, program) { var buffersToBind = this._renderer.pipeline.getBufferNamesToBind(geometry, program); for (var i in buffersToBind) { this._setVertexBuffer(i, geometry.attributes[buffersToBind[i]].buffer); } if (geometry.indexBuffer) { this._setIndexBuffer(geometry.indexBuffer); } } }, { key: "_setShaderBindGroups", value: function _setShaderBindGroups(shader, skipSync) { for (var i in shader.groups) { var bindGroup = shader.groups[i]; if (!skipSync) { this._syncBindGroup(bindGroup); } this.setBindGroup(i, bindGroup, shader.gpuProgram); } } }, { key: "_syncBindGroup", value: function _syncBindGroup(bindGroup) { for (var j in bindGroup.resources) { var resource = bindGroup.resources[j]; if (resource.isUniformGroup) { this._renderer.ubo.updateUniformGroup(resource); } } } }, { key: "draw", value: function draw(options) { var geometry = options.geometry, shader = options.shader, state = options.state, topology = options.topology, size = options.size, start = options.start, instanceCount = options.instanceCount, skipSync = options.skipSync; this.setPipelineFromGeometryProgramAndState(geometry, shader.gpuProgram, state, topology); this.setGeometry(geometry, shader.gpuProgram); this._setShaderBindGroups(shader, skipSync); if (geometry.indexBuffer) { this.renderPassEncoder.drawIndexed(size || geometry.indexBuffer.data.length, instanceCount !== null && instanceCount !== void 0 ? instanceCount : geometry.instanceCount, start || 0); } else { this.renderPassEncoder.draw(size || geometry.getSize(), instanceCount !== null && instanceCount !== void 0 ? instanceCount : geometry.instanceCount, start || 0); } } }, { key: "finishRenderPass", value: function finishRenderPass() { if (this.renderPassEncoder) { this.renderPassEncoder.end(); this.renderPassEncoder = null; } } }, { key: "postrender", value: function postrender() { this.finishRenderPass(); this._gpu.device.queue.submit([this.commandEncoder.finish()]); this._resolveCommandFinished(); this.commandEncoder = null; } // restores a render pass if finishRenderPass was called // not optimised as really used for debugging! // used when we want to stop drawing and log a texture.. }, { key: "restoreRenderPass", value: function restoreRenderPass() { var descriptor = this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget, false, [0, 0, 0, 1]); this.renderPassEncoder = this.commandEncoder.beginRenderPass(descriptor); var boundPipeline = this._boundPipeline; var boundVertexBuffer = _objectSpread({}, this._boundVertexBuffer); var boundIndexBuffer = this._boundIndexBuffer; var boundBindGroup = _objectSpread({}, this._boundBindGroup); this._clearCache(); var viewport = this._renderer.renderTarget.viewport; this.renderPassEncoder.setViewport(viewport.x, viewport.y, viewport.width, viewport.height, 0, 1); this.setPipeline(boundPipeline); for (var i in boundVertexBuffer) { this._setVertexBuffer(i, boundVertexBuffer[i]); } for (var _i in boundBindGroup) { this.setBindGroup(_i, boundBindGroup[_i], null); } this._setIndexBuffer(boundIndexBuffer); } }, { key: "_clearCache", value: function _clearCache() { for (var i = 0; i < 16; i++) { this._boundBindGroup[i] = null; this._boundVertexBuffer[i] = null; } this._boundIndexBuffer = null; this._boundPipeline = null; } }, { key: "destroy", value: function destroy() { this._renderer = null; this._gpu = null; this._boundBindGroup = null; this._boundVertexBuffer = null; this._boundIndexBuffer = null; this._boundPipeline = null; } }, { key: "contextChange", value: function contextChange(gpu) { this._gpu = gpu; } }]); }(); /** @ignore */ GpuEncoderSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "encoder", priority: 1 }; exports.GpuEncoderSystem = GpuEncoderSystem; /***/ }), /***/ 59520: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var glFormatToGPUFormatMap = { 6408: "rgba8unorm", 32856: "bgra8unorm", // 32857: "rgb10a2unorm", 33189: "depth16unorm", 33190: "depth24plus", 33321: "r8unorm", 33323: "rg8unorm", 33325: "r16float", 33326: "r32float", 33327: "rg16float", 33328: "rg32float", 33329: "r8sint", 33330: "r8uint", 33331: "r16sint", 33332: "r16uint", 33333: "r32sint", 33334: "r32uint", 33335: "rg8sint", 33336: "rg8uint", 33337: "rg16sint", 33338: "rg16uint", 33339: "rg32sint", 33340: "rg32uint", 33778: "bc2-rgba-unorm", 33779: "bc3-rgba-unorm", 34836: "rgba32float", 34842: "rgba16float", 35056: "depth24plus-stencil8", 35898: "rg11b10ufloat", 35901: "rgb9e5ufloat", 35907: "rgba8unorm-srgb", // bgra8unorm-srgb 36012: "depth32float", 36013: "depth32float-stencil8", 36168: "stencil8", 36208: "rgba32uint", 36214: "rgba16uint", 36220: "rgba8uint", 36226: "rgba32sint", 36232: "rgba16sint", 36238: "rgba8sint", 36492: "bc7-rgba-unorm", 36756: "r8snorm", 36757: "rg8snorm", 36759: "rgba8snorm", 37496: "etc2-rgba8unorm", 37808: "astc-4x4-unorm" }; function glFormatToGPUFormat(glInternalFormat) { var format = glFormatToGPUFormatMap[glInternalFormat]; if (format) { return format; } throw new Error("Unsupported glInternalFormat: ".concat(glInternalFormat)); } exports.glFormatToGPUFormat = glFormatToGPUFormat; /***/ }), /***/ 59668: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var adapter = __webpack_require__(72450); var _const = __webpack_require__(22718); "use strict"; var saidHello = false; function sayHello(type) { if (saidHello) { return; } if (adapter.DOMAdapter.get().getNavigator().userAgent.toLowerCase().indexOf("chrome") > -1) { var _globalThis$console; var args = ["%c %c %c %c %c PixiJS %c v".concat(_const.VERSION, " (").concat(type, ") http://www.pixijs.com/\n\n"), "background: #E72264; padding:5px 0;", "background: #6CA2EA; padding:5px 0;", "background: #B5D33D; padding:5px 0;", "background: #FED23F; padding:5px 0;", "color: #FFFFFF; background: #E72264; padding:5px 0;", "color: #E72264; background: #FFFFFF; padding:5px 0;"]; (_globalThis$console = globalThis.console).log.apply(_globalThis$console, args); } else if (globalThis.console) { globalThis.console.log("PixiJS ".concat(_const.VERSION, " - ").concat(type, " - http://www.pixijs.com/")); } saidHello = true; } exports.sayHello = sayHello; /***/ }), /***/ 59832: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var uid = __webpack_require__(90844); var _const = __webpack_require__(33843); "use strict"; var Buffer = /*#__PURE__*/function (_EventEmitter) { /** * Creates a new Buffer with the given options * @param options - the options for the buffer */ function Buffer(options) { var _data; var _this; _classCallCheck(this, Buffer); var data = options.data, size = options.size; var usage = options.usage, label = options.label, shrinkToFit = options.shrinkToFit; _this = _callSuper(this, Buffer); /** * emits when the underlying buffer has changed shape (i.e. resized) * letting the renderer know that it needs to discard the old buffer on the GPU and create a new one * @event change */ /** * emits when the underlying buffer data has been updated. letting the renderer know * that it needs to update the buffer on the GPU * @event update */ /** * emits when the buffer is destroyed. letting the renderer know that it needs to destroy the buffer on the GPU * @event destroy */ /** a unique id for this uniform group used through the renderer */ _this.uid = uid.uid("buffer"); /** * a resource type, used to identify how to handle it when its in a bind group / shader resource * @internal * @ignore */ _this._resourceType = "buffer"; /** * the resource id used internally by the renderer to build bind group keys * @internal * @ignore */ _this._resourceId = uid.uid("resource"); /** * used internally to know if a uniform group was used in the last render pass * @internal * @ignore */ _this._touched = 0; /** * @internal * @ignore */ _this._updateID = 1; _this._dataInt32 = null; /** * should the GPU buffer be shrunk when the data becomes smaller? * changing this will cause the buffer to be destroyed and a new one created on the GPU * this can be expensive, especially if the buffer is already big enough! * setting this to false will prevent the buffer from being shrunk. This will yield better performance * if you are constantly setting data that is changing size often. * @default true */ _this.shrinkToFit = true; /** * Has the buffer been destroyed? * @readonly */ _this.destroyed = false; if (data instanceof Array) { data = new Float32Array(data); } _this._data = data; size !== null && size !== void 0 ? size : size = (_data = data) === null || _data === void 0 ? void 0 : _data.byteLength; var mappedAtCreation = !!data; _this.descriptor = { size: size, usage: usage, mappedAtCreation: mappedAtCreation, label: label }; _this.shrinkToFit = shrinkToFit !== null && shrinkToFit !== void 0 ? shrinkToFit : true; return _this; } /** the data in the buffer */ _inherits(Buffer, _EventEmitter); return _createClass(Buffer, [{ key: "data", get: function get() { return this._data; }, set: function set(value) { this.setDataWithSize(value, value.length, true); } }, { key: "dataInt32", get: function get() { if (!this._dataInt32) { this._dataInt32 = new Int32Array(this.data.buffer); } return this._dataInt32; } /** whether the buffer is static or not */ }, { key: "static", get: function get() { return !!(this.descriptor.usage & _const.BufferUsage.STATIC); }, set: function set(value) { if (value) { this.descriptor.usage |= _const.BufferUsage.STATIC; } else { this.descriptor.usage &= ~_const.BufferUsage.STATIC; } } /** * Sets the data in the buffer to the given value. This will immediately update the buffer on the GPU. * If you only want to update a subset of the buffer, you can pass in the size of the data. * @param value - the data to set * @param size - the size of the data in bytes * @param syncGPU - should the buffer be updated on the GPU immediately? */ }, { key: "setDataWithSize", value: function setDataWithSize(value, size, syncGPU) { this._updateID++; this._updateSize = size * value.BYTES_PER_ELEMENT; if (this._data === value) { if (syncGPU) this.emit("update", this); return; } var oldData = this._data; this._data = value; this._dataInt32 = null; if (!oldData || oldData.length !== value.length) { if (!this.shrinkToFit && oldData && value.byteLength < oldData.byteLength) { if (syncGPU) this.emit("update", this); } else { this.descriptor.size = value.byteLength; this._resourceId = uid.uid("resource"); this.emit("change", this); } return; } if (syncGPU) this.emit("update", this); } /** * updates the buffer on the GPU to reflect the data in the buffer. * By default it will update the entire buffer. If you only want to update a subset of the buffer, * you can pass in the size of the buffer to update. * @param sizeInBytes - the new size of the buffer in bytes */ }, { key: "update", value: function update(sizeInBytes) { this._updateSize = sizeInBytes !== null && sizeInBytes !== void 0 ? sizeInBytes : this._updateSize; this._updateID++; this.emit("update", this); } /** Destroys the buffer */ }, { key: "destroy", value: function destroy() { this.destroyed = true; this.emit("destroy", this); this.emit("change", this); this._data = null; this.descriptor = null; this.removeAllListeners(); } }]); }(EventEmitter); exports.Buffer = Buffer; /***/ }), /***/ 60215: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var LinearLightBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function LinearLightBlend() { _classCallCheck(this, LinearLightBlend); return _callSuper(this, LinearLightBlend, [{ gl: { functions: "\n float linearBurn(float base, float blend) {\n return max(0.0, base + blend - 1.0);\n }\n\n float linearDodge(float base, float blend) {\n return min(1.0, base + blend);\n }\n\n float linearLight(float base, float blend) {\n return (blend <= 0.5) ? linearBurn(base,2.0*blend) : linearBurn(base,2.0*(blend-0.5));\n }\n\n vec3 blendLinearLight(vec3 base, vec3 blend, float opacity) {\n vec3 blended = vec3(\n linearLight(base.r, blend.r),\n linearLight(base.g, blend.g),\n linearLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendLinearLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn linearBurn(base: f32, blend: f32) -> f32\n {\n return max(0.0, base + blend - 1.0);\n }\n\n fn linearDodge(base: f32, blend: f32) -> f32\n {\n return min(1.0, base + blend);\n }\n\n fn linearLight(base: f32, blend: f32) -> f32\n {\n return select(linearBurn(base,2.0*(blend-0.5)), linearBurn(base,2.0*blend), blend <= 0.5);\n }\n\n fn blendLinearLightOpacity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n linearLight(base.r, blend.r),\n linearLight(base.g, blend.g),\n linearLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(LinearLightBlend, _BlendModeFilter$Blen); return _createClass(LinearLightBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ LinearLightBlend.extension = { name: "linear-light", type: Extensions.ExtensionType.BlendMode }; exports.LinearLightBlend = LinearLightBlend; /***/ }), /***/ 60237: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var buildUvs = __webpack_require__(36262); var transformVertices = __webpack_require__(25835); var MeshGeometry = __webpack_require__(56451); var buildCircle = __webpack_require__(94641); var buildPolygon = __webpack_require__(18591); var buildRectangle = __webpack_require__(92828); var buildTriangle = __webpack_require__(96465); var GraphicsPath = __webpack_require__(91058); "use strict"; var buildMap = { rectangle: buildRectangle.buildRectangle, polygon: buildPolygon.buildPolygon, triangle: buildTriangle.buildTriangle, circle: buildCircle.buildCircle, ellipse: buildCircle.buildCircle, roundedRectangle: buildCircle.buildCircle }; function buildGeometryFromPath(options) { if (options instanceof GraphicsPath.GraphicsPath) { options = { path: options, textureMatrix: null, out: null }; } var vertices = []; var uvs = []; var indices = []; var shapePath = options.path.shapePath; var textureMatrix = options.textureMatrix; shapePath.shapePrimitives.forEach(function (_ref) { var shape = _ref.shape, matrix = _ref.transform; var indexOffset = indices.length; var vertOffset = vertices.length / 2; var points = []; var build = buildMap[shape.type]; build.build(shape, points); if (matrix) { transformVertices.transformVertices(points, matrix); } build.triangulate(points, vertices, 2, vertOffset, indices, indexOffset); var uvsOffset = uvs.length / 2; if (textureMatrix) { if (matrix) { textureMatrix.append(matrix.clone().invert()); } buildUvs.buildUvs(vertices, 2, vertOffset, uvs, uvsOffset, 2, vertices.length / 2 - vertOffset, textureMatrix); } else { buildUvs.buildSimpleUvs(uvs, uvsOffset, 2, vertices.length / 2 - vertOffset); } }); var out = options.out; if (out) { out.positions = new Float32Array(vertices); out.uvs = new Float32Array(uvs); out.indices = new Uint32Array(indices); return out; } var geometry = new MeshGeometry.MeshGeometry({ positions: new Float32Array(vertices), uvs: new Float32Array(uvs), indices: new Uint32Array(indices) }); return geometry; } exports.buildGeometryFromPath = buildGeometryFromPath; /***/ }), /***/ 60375: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["alpha"]; function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var UniformGroup = __webpack_require__(34400); var Filter = __webpack_require__(92393); var defaultFilter = __webpack_require__(78440); var alpha$1 = __webpack_require__(61507); var alpha = __webpack_require__(25082); "use strict"; var _AlphaFilter = /*#__PURE__*/function (_Filter$Filter) { function _AlphaFilter(options) { _classCallCheck(this, _AlphaFilter); options = _objectSpread(_objectSpread({}, _AlphaFilter.defaultOptions), options); var gpuProgram = GpuProgram.GpuProgram.from({ vertex: { source: alpha["default"], entryPoint: "mainVertex" }, fragment: { source: alpha["default"], entryPoint: "mainFragment" } }); var glProgram = GlProgram.GlProgram.from({ vertex: defaultFilter["default"], fragment: alpha$1["default"], name: "alpha-filter" }); var _options = options, alpha$2 = _options.alpha, rest = _objectWithoutProperties(_options, _excluded); var alphaUniforms = new UniformGroup.UniformGroup({ uAlpha: { value: alpha$2, type: "f32" } }); return _callSuper(this, _AlphaFilter, [_objectSpread(_objectSpread({}, rest), {}, { gpuProgram: gpuProgram, glProgram: glProgram, resources: { alphaUniforms: alphaUniforms } })]); } /** * Coefficient for alpha multiplication * @default 1 */ _inherits(_AlphaFilter, _Filter$Filter); return _createClass(_AlphaFilter, [{ key: "alpha", get: function get() { return this.resources.alphaUniforms.uniforms.uAlpha; }, set: function set(value) { this.resources.alphaUniforms.uniforms.uAlpha = value; } }]); }(Filter.Filter); /** Default filter options */ _AlphaFilter.defaultOptions = { /** Amount of alpha from 0 to 1, where 0 is transparent */ alpha: 1 }; var AlphaFilter = _AlphaFilter; exports.AlphaFilter = AlphaFilter; /***/ }), /***/ 60516: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function setPositions(tilingSprite, positions) { var anchorX = tilingSprite.anchor.x; var anchorY = tilingSprite.anchor.y; positions[0] = -anchorX * tilingSprite.width; positions[1] = -anchorY * tilingSprite.height; positions[2] = (1 - anchorX) * tilingSprite.width; positions[3] = -anchorY * tilingSprite.height; positions[4] = (1 - anchorX) * tilingSprite.width; positions[5] = (1 - anchorY) * tilingSprite.height; positions[6] = -anchorX * tilingSprite.width; positions[7] = (1 - anchorY) * tilingSprite.height; } exports.setPositions = setPositions; /***/ }), /***/ 60517: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _Context = _interopRequireDefault(__webpack_require__(71085)); var _ContextManager = _interopRequireDefault(__webpack_require__(52962)); var _OOP = _interopRequireDefault(__webpack_require__(64181)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /*** * @extends Context * @constructor */ function GrandContext() { _Context["default"].call(this); this.ctxMng = new _ContextManager["default"](); } _OOP["default"].mixClass(GrandContext, _Context["default"]); var _default = exports["default"] = GrandContext; /***/ }), /***/ 60583: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _excluded = ["width", "height", "anchor", "leftWidth", "rightWidth", "topHeight", "bottomHeight", "texture", "roundPixels"]; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Texture = __webpack_require__(73782); var deprecation = __webpack_require__(11225); var ViewContainer = __webpack_require__(23804); var NineSliceGeometry = __webpack_require__(31598); var ObservablePoint = __webpack_require__(14823); "use strict"; var _NineSliceSprite = /*#__PURE__*/function (_ViewContainer$ViewCo) { /** * @param {scene.NineSliceSpriteOptions|Texture} options - Options to use * @param options.texture - The texture to use on the NineSliceSprite. * @param options.leftWidth - Width of the left vertical bar (A) * @param options.topHeight - Height of the top horizontal bar (C) * @param options.rightWidth - Width of the right vertical bar (B) * @param options.bottomHeight - Height of the bottom horizontal bar (D) * @param options.width - Width of the NineSliceSprite, * setting this will actually modify the vertices and not the UV's of this plane. * @param options.height - Height of the NineSliceSprite, * setting this will actually modify the vertices and not UV's of this plane. */ function _NineSliceSprite(options) { var _ref, _texture$defaultBorde, _ref2, _texture$defaultBorde2, _ref3, _texture$defaultBorde3, _ref4, _texture$defaultBorde4, _ref5, _ref6; var _this; _classCallCheck(this, _NineSliceSprite); if (options instanceof Texture.Texture) { options = { texture: options }; } var _options = options, width = _options.width, height = _options.height, anchor = _options.anchor, leftWidth = _options.leftWidth, rightWidth = _options.rightWidth, topHeight = _options.topHeight, bottomHeight = _options.bottomHeight, texture = _options.texture, roundPixels = _options.roundPixels, rest = _objectWithoutProperties(_options, _excluded); _this = _callSuper(this, _NineSliceSprite, [_objectSpread({ label: "NineSliceSprite" }, rest)]); _this.renderPipeId = "nineSliceSprite"; _this.batched = true; _this._leftWidth = (_ref = leftWidth !== null && leftWidth !== void 0 ? leftWidth : texture === null || texture === void 0 || (_texture$defaultBorde = texture.defaultBorders) === null || _texture$defaultBorde === void 0 ? void 0 : _texture$defaultBorde.left) !== null && _ref !== void 0 ? _ref : NineSliceGeometry.NineSliceGeometry.defaultOptions.leftWidth; _this._topHeight = (_ref2 = topHeight !== null && topHeight !== void 0 ? topHeight : texture === null || texture === void 0 || (_texture$defaultBorde2 = texture.defaultBorders) === null || _texture$defaultBorde2 === void 0 ? void 0 : _texture$defaultBorde2.top) !== null && _ref2 !== void 0 ? _ref2 : NineSliceGeometry.NineSliceGeometry.defaultOptions.topHeight; _this._rightWidth = (_ref3 = rightWidth !== null && rightWidth !== void 0 ? rightWidth : texture === null || texture === void 0 || (_texture$defaultBorde3 = texture.defaultBorders) === null || _texture$defaultBorde3 === void 0 ? void 0 : _texture$defaultBorde3.right) !== null && _ref3 !== void 0 ? _ref3 : NineSliceGeometry.NineSliceGeometry.defaultOptions.rightWidth; _this._bottomHeight = (_ref4 = bottomHeight !== null && bottomHeight !== void 0 ? bottomHeight : texture === null || texture === void 0 || (_texture$defaultBorde4 = texture.defaultBorders) === null || _texture$defaultBorde4 === void 0 ? void 0 : _texture$defaultBorde4.bottom) !== null && _ref4 !== void 0 ? _ref4 : NineSliceGeometry.NineSliceGeometry.defaultOptions.bottomHeight; _this._width = (_ref5 = width !== null && width !== void 0 ? width : texture.width) !== null && _ref5 !== void 0 ? _ref5 : NineSliceGeometry.NineSliceGeometry.defaultOptions.width; _this._height = (_ref6 = height !== null && height !== void 0 ? height : texture.height) !== null && _ref6 !== void 0 ? _ref6 : NineSliceGeometry.NineSliceGeometry.defaultOptions.height; _this.allowChildren = false; _this.texture = texture !== null && texture !== void 0 ? texture : _NineSliceSprite.defaultOptions.texture; _this.roundPixels = roundPixels !== null && roundPixels !== void 0 ? roundPixels : false; _this._anchor = new ObservablePoint.ObservablePoint({ _onUpdate: function _onUpdate() { _this.onViewUpdate(); } }); if (anchor) { _this.anchor = anchor; } else if (_this.texture.defaultAnchor) { _this.anchor = _this.texture.defaultAnchor; } return _this; } _inherits(_NineSliceSprite, _ViewContainer$ViewCo); return _createClass(_NineSliceSprite, [{ key: "anchor", get: function get() { return this._anchor; }, set: function set(value) { typeof value === "number" ? this._anchor.set(value) : this._anchor.copyFrom(value); } /** The width of the NineSliceSprite, setting this will actually modify the vertices and UV's of this plane. */ }, { key: "width", get: function get() { return this._width; }, set: function set(value) { this._width = value; this.onViewUpdate(); } /** The height of the NineSliceSprite, setting this will actually modify the vertices and UV's of this plane. */ }, { key: "height", get: function get() { return this._height; }, set: function set(value) { this._height = value; this.onViewUpdate(); } /** * Sets the size of the NiceSliceSprite to the specified width and height. * setting this will actually modify the vertices and UV's of this plane * This is faster than setting the width and height separately. * @param value - This can be either a number or a [Size]{@link Size} object. * @param height - The height to set. Defaults to the value of `width` if not provided. */ }, { key: "setSize", value: function setSize(value, height) { if (_typeof(value) === "object") { var _value$height; height = (_value$height = value.height) !== null && _value$height !== void 0 ? _value$height : value.width; value = value.width; } this._width = value; this._height = height !== null && height !== void 0 ? height : value; this.onViewUpdate(); } /** * Retrieves the size of the NineSliceSprite as a [Size]{@link Size} object. * This is faster than get the width and height separately. * @param out - Optional object to store the size in. * @returns - The size of the NineSliceSprite. */ }, { key: "getSize", value: function getSize(out) { out || (out = {}); out.width = this._width; out.height = this._height; return out; } /** The width of the left column (a) of the NineSliceSprite. */ }, { key: "leftWidth", get: function get() { return this._leftWidth; }, set: function set(value) { this._leftWidth = value; this.onViewUpdate(); } /** The width of the right column (b) of the NineSliceSprite. */ }, { key: "topHeight", get: function get() { return this._topHeight; }, set: function set(value) { this._topHeight = value; this.onViewUpdate(); } /** The width of the right column (b) of the NineSliceSprite. */ }, { key: "rightWidth", get: function get() { return this._rightWidth; }, set: function set(value) { this._rightWidth = value; this.onViewUpdate(); } /** The width of the right column (b) of the NineSliceSprite. */ }, { key: "bottomHeight", get: function get() { return this._bottomHeight; }, set: function set(value) { this._bottomHeight = value; this.onViewUpdate(); } /** The texture that the NineSliceSprite is using. */ }, { key: "texture", get: function get() { return this._texture; }, set: function set(value) { value || (value = Texture.Texture.EMPTY); var currentTexture = this._texture; if (currentTexture === value) return; if (currentTexture && currentTexture.dynamic) currentTexture.off("update", this.onViewUpdate, this); if (value.dynamic) value.on("update", this.onViewUpdate, this); this._texture = value; this.onViewUpdate(); } /** The original width of the texture */ }, { key: "originalWidth", get: function get() { return this._texture.width; } /** The original height of the texture */ }, { key: "originalHeight", get: function get() { return this._texture.height; } /** * Destroys this sprite renderable and optionally its texture. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the current texture of the renderable as well * @param {boolean} [options.textureSource=false] - Should it destroy the textureSource of the renderable as well */ }, { key: "destroy", value: function destroy(options) { _superPropGet(_NineSliceSprite, "destroy", this, 3)([options]); var destroyTexture = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.texture; if (destroyTexture) { var destroyTextureSource = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.textureSource; this._texture.destroy(destroyTextureSource); } this._texture = null; } /** * @private */ }, { key: "updateBounds", value: function updateBounds() { var bounds = this._bounds; var anchor = this._anchor; var width = this._width; var height = this._height; bounds.minX = -anchor._x * width; bounds.maxX = bounds.minX + width; bounds.minY = -anchor._y * height; bounds.maxY = bounds.minY + height; } }]); }(ViewContainer.ViewContainer); /** The default options, used to override the initial values of any options passed in the constructor. */ _NineSliceSprite.defaultOptions = { /** @default Texture.EMPTY */ texture: Texture.Texture.EMPTY }; var NineSliceSprite = _NineSliceSprite; var NineSlicePlane = /*#__PURE__*/function (_NineSliceSprite2) { function NineSlicePlane() { _classCallCheck(this, NineSlicePlane); var options = arguments.length <= 0 ? undefined : arguments[0]; if (options instanceof Texture.Texture) { deprecation.deprecation(deprecation.v8_0_0, "NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"); options = { texture: options, leftWidth: arguments.length <= 1 ? undefined : arguments[1], topHeight: arguments.length <= 2 ? undefined : arguments[2], rightWidth: arguments.length <= 3 ? undefined : arguments[3], bottomHeight: arguments.length <= 4 ? undefined : arguments[4] }; } deprecation.deprecation(deprecation.v8_0_0, "NineSlicePlane is deprecated. Use NineSliceSprite instead."); return _callSuper(this, NineSlicePlane, [options]); } _inherits(NineSlicePlane, _NineSliceSprite2); return _createClass(NineSlicePlane); }(NineSliceSprite); exports.NineSlicePlane = NineSlicePlane; exports.NineSliceSprite = NineSliceSprite; /***/ }), /***/ 60595: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var GlParticleContainerPipe = __webpack_require__(61647); var GpuParticleContainerPipe = __webpack_require__(41412); "use strict"; Extensions.extensions.add(GlParticleContainerPipe.GlParticleContainerPipe); Extensions.extensions.add(GpuParticleContainerPipe.GpuParticleContainerPipe); /***/ }), /***/ 60607: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; function JSPath(props) { this.path = props.path; } /** * * @param {Element} element * @returns {Boolean} */ JSPath.prototype.match = function (element, query) { if (query.id) { if (!element.getAttribute || element.getAttribute('id') != query.id) return false; } if (query.tagName) { var matchTag = false; if (element._azar_extendTags && element._azar_extendTags[query.tagName]) matchTag = true; matchTag = matchTag || (element.tagName || '').toUpperCase() == query.tagName.toUpperCase(); if (!matchTag) return false; } if (query.classList) for (var i = 0; i < query.classList.length; ++i) { if (!element.classList || !element.classList.contains(query.classList[i])) return false; } if (query.attributes) { for (var key in query.attributes) { var value; if (element.attr) { value = element.attr(key); if (value != query.attributes[key]) return false; } else if (element.getAttribute) { value = element.getAttribute(key); if (value != query.attributes[key]) return false; } } } return true; }; /** * Warning : still fail in some testcase */ JSPath.prototype.findFirst = function (root, onFound) { var queue = [{ e: root, i: 0 }]; var current; while (queue.length > 0) { current = queue.shift(); var isMathed = false; var currentElt = current.e; var currentI = current.i; if (this.match(currentElt, this.path[currentI])) { if (this.path[currentI].childCombinate) { var trackI = currentI; var trackElement = currentElt; var isTrackMatch = true; while (isTrackMatch && trackI > 0 && this.path[trackI].childCombinate) { if (!trackElement.parentNode || !this.match(trackElement.parentNode, this.path[trackI - 1])) { isTrackMatch = false; } else { trackElement = trackElement.parentNode; trackI--; } } if (isTrackMatch) isMathed = true; } else { isMathed = true; } } if (isMathed && currentI + 1 == this.path.length) { if (!onFound || onFound && onFound(currentElt)) return currentElt; } if (currentElt.childNodes) { var l = currentElt.childNodes.length; for (var i = 0; i < l; ++i) { if (currentElt.childNodes[i].tagName) queue.push({ e: currentElt.childNodes[i], i: currentI + (isMathed && currentI + 1 < this.path.length ? 1 : 0) }); } } } return undefined; }; JSPath.prototype.findAll = function (root, onFound) { var res = []; var queue = [{ e: root, i: 0 }]; var current; while (queue.length > 0) { current = queue.shift(); var isMathed = false; var currentElt = current.e; var currentI = current.i; if (this.match(currentElt, this.path[currentI])) { if (this.path[currentI].childCombinate) { var trackI = currentI; var trackElement = currentElt; var isTrackMatch = true; while (isTrackMatch && trackI > 0 && this.path[trackI].childCombinate) { if (!trackElement.parentNode || !this.match(trackElement.parentNode, this.path[trackI - 1])) { isTrackMatch = false; } else { trackElement = trackElement.parentNode; trackI--; } } if (isTrackMatch) isMathed = true; } else { isMathed = true; } } if (isMathed && currentI + 1 == this.path.length) { if (!onFound || onFound && onFound(currentElt)) res.push(currentElt); } if (currentElt.childNodes) { var l = currentElt.childNodes.length; for (var i = 0; i < l; ++i) { if (currentElt.childNodes[i].tagName) queue.push({ e: currentElt.childNodes[i], i: currentI + (isMathed && currentI + 1 < this.path.length ? 1 : 0) }); } } } return res; }; var identRegex = /[a-zA-Z0-9\-_]+/; var stringRegex = /"(([^"\\]*|(\\.))*)"/; var classRegex = new RegExp('\\.' + identRegex.source); var idRegex = new RegExp('#' + identRegex.source); var booleanRegex = /true|false/; var valueRegex = new RegExp(stringRegex.source + '|' + booleanRegex.source); var attributeRegex = new RegExp('\\[\\s*(' + identRegex.source + ')\\s*(=\\s*(' + valueRegex.source + '))\\]'); var queryRegex = new RegExp(['(', identRegex.source, '|', attributeRegex.source, '|', classRegex.source, '|', idRegex.source, ')+'].join('')); JSPath.__tagRegex = new RegExp(queryRegex.source + '|\\>', 'g'); JSPath.__tagNameRegex = new RegExp('^' + identRegex.source, 'i'); JSPath.__classRegex = new RegExp(classRegex.source, 'g'); JSPath.__idRegex = new RegExp(idRegex.source, 'i'); JSPath.__attrRegex = new RegExp(attributeRegex.source, 'g'); JSPath.parseQuery = function (s) { var tag = {}; s = s.replace(JSPath.__attrRegex, function (full, name, assign, jsonTextValue) { tag.attributes = tag.attributes || {}; if (assign) { tag.attributes[name] = JSON.parse(jsonTextValue); } else tag.attributes[name] = true; return ''; }); var classList = s.match(this.__classRegex); var idList = s.match(this.__idRegex); var tagList = s.match(this.__tagNameRegex); if (idList && idList.length > 0) { tag.id = idList[0].substring(1); } if (tagList && tagList.length > 0) { tag.tagName = tagList[0].trim(); } if (classList && classList.length > 0) { tag.classList = classList.map(function (s) { return s.substring(1); }); } return tag; }; /** * @param {String} text * @returns {JSPath} */ JSPath.compileJSPath = function (text) { var tagTexts = text.match(this.__tagRegex) || ['']; var path = []; var childCombinate = false; for (var i = 0; i < tagTexts.length; ++i) { var s = tagTexts[i]; if (s == '>') { childCombinate = true; } else { var tag = this.parseQuery(s); tag.childCombinate = childCombinate; path.push(tag); childCombinate = false; } } return new JSPath({ path: path }); }; var _default = exports["default"] = JSPath; /***/ }), /***/ 60931: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["geometry", "shader", "texture", "roundPixels", "state"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var pointInTriangle = __webpack_require__(89675); var Geometry = __webpack_require__(18964); var State = __webpack_require__(84938); var Texture = __webpack_require__(73782); var deprecation = __webpack_require__(11225); var ViewContainer = __webpack_require__(23804); var MeshGeometry = __webpack_require__(56451); "use strict"; var Mesh = /*#__PURE__*/function (_ViewContainer$ViewCo) { function Mesh() { var _ref; var _this; _classCallCheck(this, Mesh); var options = arguments.length <= 0 ? undefined : arguments[0]; if (options instanceof Geometry.Geometry) { deprecation.deprecation(deprecation.v8_0_0, "Mesh: use new Mesh({ geometry, shader }) instead"); options = { geometry: options, shader: arguments.length <= 1 ? undefined : arguments[1] }; if (arguments.length <= 3 ? undefined : arguments[3]) { deprecation.deprecation(deprecation.v8_0_0, "Mesh: drawMode argument has been removed, use geometry.topology instead"); options.geometry.topology = arguments.length <= 3 ? undefined : arguments[3]; } } var _options = options, geometry = _options.geometry, shader = _options.shader, texture = _options.texture, roundPixels = _options.roundPixels, state = _options.state, rest = _objectWithoutProperties(_options, _excluded); _this = _callSuper(this, Mesh, [_objectSpread({ label: "Mesh" }, rest)]); _this.renderPipeId = "mesh"; /** @ignore */ _this._shader = null; _this.allowChildren = false; _this.shader = shader !== null && shader !== void 0 ? shader : null; _this.texture = (_ref = texture !== null && texture !== void 0 ? texture : shader === null || shader === void 0 ? void 0 : shader.texture) !== null && _ref !== void 0 ? _ref : Texture.Texture.WHITE; _this.state = state !== null && state !== void 0 ? state : State.State.for2d(); _this._geometry = geometry; _this._geometry.on("update", _this.onViewUpdate, _this); _this.roundPixels = roundPixels !== null && roundPixels !== void 0 ? roundPixels : false; return _this; } /** Alias for {@link scene.Mesh#shader}. */ _inherits(Mesh, _ViewContainer$ViewCo); return _createClass(Mesh, [{ key: "material", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "mesh.material property has been removed, use mesh.shader instead"); return this._shader; } /** * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. * Can be shared between multiple Mesh objects. */ }, { key: "shader", get: function get() { return this._shader; } /** * Includes vertex positions, face indices, colors, UVs, and * custom attributes within buffers, reducing the cost of passing all * this data to the GPU. Can be shared between multiple Mesh objects. */, set: function set(value) { if (this._shader === value) return; this._shader = value; this.onViewUpdate(); } }, { key: "geometry", get: function get() { return this._geometry; } /** The texture that the Mesh uses. Null for non-MeshMaterial shaders */, set: function set(value) { var _this$_geometry; if (this._geometry === value) return; (_this$_geometry = this._geometry) === null || _this$_geometry === void 0 || _this$_geometry.off("update", this.onViewUpdate, this); value.on("update", this.onViewUpdate, this); this._geometry = value; this.onViewUpdate(); } }, { key: "texture", get: function get() { return this._texture; }, set: function set(value) { value || (value = Texture.Texture.EMPTY); var currentTexture = this._texture; if (currentTexture === value) return; if (currentTexture && currentTexture.dynamic) currentTexture.off("update", this.onViewUpdate, this); if (value.dynamic) value.on("update", this.onViewUpdate, this); if (this.shader) { this.shader.texture = value; } this._texture = value; this.onViewUpdate(); } }, { key: "batched", get: function get() { if (this._shader) return false; if ((this.state.data & 12) !== 0) return false; if (this._geometry instanceof MeshGeometry.MeshGeometry) { if (this._geometry.batchMode === "auto") { return this._geometry.positions.length / 2 <= 100; } return this._geometry.batchMode === "batch"; } return false; } /** * The local bounds of the mesh. * @type {rendering.Bounds} */ }, { key: "bounds", get: function get() { return this._geometry.bounds; } /** * Update local bounds of the mesh. * @private */ }, { key: "updateBounds", value: function updateBounds() { this._bounds = this._geometry.bounds; } /** * Checks if the object contains the given point. * @param point - The point to check */ }, { key: "containsPoint", value: function containsPoint(point) { var x = point.x, y = point.y; if (!this.bounds.containsPoint(x, y)) return false; var vertices = this.geometry.getBuffer("aPosition").data; var step = this.geometry.topology === "triangle-strip" ? 3 : 1; if (this.geometry.getIndex()) { var indices = this.geometry.getIndex().data; var len = indices.length; for (var i = 0; i + 2 < len; i += step) { var ind0 = indices[i] * 2; var ind1 = indices[i + 1] * 2; var ind2 = indices[i + 2] * 2; if (pointInTriangle.pointInTriangle(x, y, vertices[ind0], vertices[ind0 + 1], vertices[ind1], vertices[ind1 + 1], vertices[ind2], vertices[ind2 + 1])) { return true; } } } else { var _len = vertices.length / 2; for (var _i = 0; _i + 2 < _len; _i += step) { var _ind = _i * 2; var _ind2 = (_i + 1) * 2; var _ind3 = (_i + 2) * 2; if (pointInTriangle.pointInTriangle(x, y, vertices[_ind], vertices[_ind + 1], vertices[_ind2], vertices[_ind2 + 1], vertices[_ind3], vertices[_ind3 + 1])) { return true; } } } return false; } /** * Destroys this sprite renderable and optionally its texture. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the current texture of the renderable as well * @param {boolean} [options.textureSource=false] - Should it destroy the textureSource of the renderable as well */ }, { key: "destroy", value: function destroy(options) { var _this$_geometry2; _superPropGet(Mesh, "destroy", this, 3)([options]); var destroyTexture = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.texture; if (destroyTexture) { var destroyTextureSource = typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.textureSource; this._texture.destroy(destroyTextureSource); } (_this$_geometry2 = this._geometry) === null || _this$_geometry2 === void 0 || _this$_geometry2.off("update", this.onViewUpdate, this); this._texture = null; this._geometry = null; this._shader = null; } }]); }(ViewContainer.ViewContainer); exports.Mesh = Mesh; /***/ }), /***/ 61087: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var State = __webpack_require__(84938); var DefaultBatcher = __webpack_require__(91938); "use strict"; var _BatcherPipe = /*#__PURE__*/function () { function _BatcherPipe(renderer, adaptor) { var _this$_adaptor$init, _this$_adaptor; _classCallCheck(this, _BatcherPipe); this.state = State.State.for2d(); this._batchersByInstructionSet = /* @__PURE__ */Object.create(null); /** A record of all active batchers, keyed by their names */ this._activeBatches = /* @__PURE__ */Object.create(null); this.renderer = renderer; this._adaptor = adaptor; (_this$_adaptor$init = (_this$_adaptor = this._adaptor).init) === null || _this$_adaptor$init === void 0 || _this$_adaptor$init.call(_this$_adaptor, this); } return _createClass(_BatcherPipe, [{ key: "buildStart", value: function buildStart(instructionSet) { var batchers = this._batchersByInstructionSet[instructionSet.uid]; if (!batchers) { batchers = this._batchersByInstructionSet[instructionSet.uid] = /* @__PURE__ */Object.create(null); batchers["default"] || (batchers["default"] = new DefaultBatcher.DefaultBatcher()); } this._activeBatches = batchers; this._activeBatch = this._activeBatches["default"]; for (var i in this._activeBatches) { this._activeBatches[i].begin(); } } }, { key: "addToBatch", value: function addToBatch(batchableObject, instructionSet) { if (this._activeBatch.name !== batchableObject.batcherName) { this._activeBatch["break"](instructionSet); var batch = this._activeBatches[batchableObject.batcherName]; if (!batch) { batch = this._activeBatches[batchableObject.batcherName] = _BatcherPipe.getBatcher(batchableObject.batcherName); batch.begin(); } this._activeBatch = batch; } this._activeBatch.add(batchableObject); } }, { key: "break", value: function _break(instructionSet) { this._activeBatch["break"](instructionSet); } }, { key: "buildEnd", value: function buildEnd(instructionSet) { this._activeBatch["break"](instructionSet); var batches = this._activeBatches; for (var i in batches) { var batch = batches[i]; var geometry = batch.geometry; geometry.indexBuffer.setDataWithSize(batch.indexBuffer, batch.indexSize, true); geometry.buffers[0].setDataWithSize(batch.attributeBuffer.float32View, batch.attributeSize, false); } } }, { key: "upload", value: function upload(instructionSet) { var batchers = this._batchersByInstructionSet[instructionSet.uid]; for (var i in batchers) { var batcher = batchers[i]; var geometry = batcher.geometry; if (batcher.dirty) { batcher.dirty = false; geometry.buffers[0].update(batcher.attributeSize * 4); } } } }, { key: "execute", value: function execute(batch) { if (batch.action === "startBatch") { var batcher = batch.batcher; var geometry = batcher.geometry; var shader = batcher.shader; this._adaptor.start(this, geometry, shader); } this._adaptor.execute(this, batch); } }, { key: "destroy", value: function destroy() { this.state = null; this.renderer = null; this._adaptor = null; for (var i in this._activeBatches) { this._activeBatches[i].destroy(); } this._activeBatches = null; } }], [{ key: "getBatcher", value: function getBatcher(name) { return new this._availableBatchers[name](); } }]); }(); /** @ignore */ _BatcherPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "batch" }; _BatcherPipe._availableBatchers = /* @__PURE__ */Object.create(null); var BatcherPipe = _BatcherPipe; Extensions.extensions.handleByMap(Extensions.ExtensionType.Batcher, BatcherPipe._availableBatchers); Extensions.extensions.add(DefaultBatcher.DefaultBatcher); exports.BatcherPipe = BatcherPipe; /***/ }), /***/ 61136: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 61213: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 61284: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var UniformGroup = __webpack_require__(34400); var CanvasPool = __webpack_require__(88699); var BindGroup = __webpack_require__(85156); var gpuUploadBufferImageResource = __webpack_require__(52138); var gpuUploadCompressedTextureResource = __webpack_require__(92989); var gpuUploadImageSource = __webpack_require__(37493); var gpuUploadVideoSource = __webpack_require__(28595); var GpuMipmapGenerator = __webpack_require__(45413); "use strict"; var GpuTextureSystem = /*#__PURE__*/function () { function GpuTextureSystem(renderer) { _classCallCheck(this, GpuTextureSystem); this.managedTextures = []; this._gpuSources = /* @__PURE__ */Object.create(null); this._gpuSamplers = /* @__PURE__ */Object.create(null); this._bindGroupHash = /* @__PURE__ */Object.create(null); this._textureViewHash = /* @__PURE__ */Object.create(null); this._uploads = { image: gpuUploadImageSource.gpuUploadImageResource, buffer: gpuUploadBufferImageResource.gpuUploadBufferImageResource, video: gpuUploadVideoSource.gpuUploadVideoResource, compressed: gpuUploadCompressedTextureResource.gpuUploadCompressedTextureResource }; this._renderer = renderer; renderer.renderableGC.addManagedHash(this, "_gpuSources"); renderer.renderableGC.addManagedHash(this, "_gpuSamplers"); renderer.renderableGC.addManagedHash(this, "_bindGroupHash"); renderer.renderableGC.addManagedHash(this, "_textureViewHash"); } return _createClass(GpuTextureSystem, [{ key: "contextChange", value: function contextChange(gpu) { this._gpu = gpu; } }, { key: "initSource", value: function initSource(source) { if (source.autoGenerateMipmaps) { var biggestDimension = Math.max(source.pixelWidth, source.pixelHeight); source.mipLevelCount = Math.floor(Math.log2(biggestDimension)) + 1; } var usage = GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST; if (source.uploadMethodId !== "compressed") { usage |= GPUTextureUsage.RENDER_ATTACHMENT; usage |= GPUTextureUsage.COPY_SRC; } var blockData = gpuUploadCompressedTextureResource.blockDataMap[source.format] || { blockBytes: 4, blockWidth: 1, blockHeight: 1 }; var width = Math.ceil(source.pixelWidth / blockData.blockWidth) * blockData.blockWidth; var height = Math.ceil(source.pixelHeight / blockData.blockHeight) * blockData.blockHeight; var textureDescriptor = { label: source.label, size: { width: width, height: height }, format: source.format, sampleCount: source.sampleCount, mipLevelCount: source.mipLevelCount, dimension: source.dimension, usage: usage }; var gpuTexture = this._gpu.device.createTexture(textureDescriptor); this._gpuSources[source.uid] = gpuTexture; if (!this.managedTextures.includes(source)) { source.on("update", this.onSourceUpdate, this); source.on("resize", this.onSourceResize, this); source.on("destroy", this.onSourceDestroy, this); source.on("unload", this.onSourceUnload, this); source.on("updateMipmaps", this.onUpdateMipmaps, this); this.managedTextures.push(source); } this.onSourceUpdate(source); return gpuTexture; } }, { key: "onSourceUpdate", value: function onSourceUpdate(source) { var gpuTexture = this.getGpuSource(source); if (!gpuTexture) return; if (this._uploads[source.uploadMethodId]) { this._uploads[source.uploadMethodId].upload(source, gpuTexture, this._gpu); } if (source.autoGenerateMipmaps && source.mipLevelCount > 1) { this.onUpdateMipmaps(source); } } }, { key: "onSourceUnload", value: function onSourceUnload(source) { var gpuTexture = this._gpuSources[source.uid]; if (gpuTexture) { this._gpuSources[source.uid] = null; gpuTexture.destroy(); } } }, { key: "onUpdateMipmaps", value: function onUpdateMipmaps(source) { if (!this._mipmapGenerator) { this._mipmapGenerator = new GpuMipmapGenerator.GpuMipmapGenerator(this._gpu.device); } var gpuTexture = this.getGpuSource(source); this._mipmapGenerator.generateMipmap(gpuTexture); } }, { key: "onSourceDestroy", value: function onSourceDestroy(source) { source.off("update", this.onSourceUpdate, this); source.off("unload", this.onSourceUnload, this); source.off("destroy", this.onSourceDestroy, this); source.off("resize", this.onSourceResize, this); source.off("updateMipmaps", this.onUpdateMipmaps, this); this.managedTextures.splice(this.managedTextures.indexOf(source), 1); this.onSourceUnload(source); } }, { key: "onSourceResize", value: function onSourceResize(source) { var gpuTexture = this._gpuSources[source.uid]; if (!gpuTexture) { this.initSource(source); } else if (gpuTexture.width !== source.pixelWidth || gpuTexture.height !== source.pixelHeight) { this._textureViewHash[source.uid] = null; this._bindGroupHash[source.uid] = null; this.onSourceUnload(source); this.initSource(source); } } }, { key: "_initSampler", value: function _initSampler(sampler) { this._gpuSamplers[sampler._resourceId] = this._gpu.device.createSampler(sampler); return this._gpuSamplers[sampler._resourceId]; } }, { key: "getGpuSampler", value: function getGpuSampler(sampler) { return this._gpuSamplers[sampler._resourceId] || this._initSampler(sampler); } }, { key: "getGpuSource", value: function getGpuSource(source) { return this._gpuSources[source.uid] || this.initSource(source); } /** * this returns s bind group for a specific texture, the bind group contains * - the texture source * - the texture style * - the texture matrix * This is cached so the bind group should only be created once per texture * @param texture - the texture you want the bindgroup for * @returns the bind group for the texture */ }, { key: "getTextureBindGroup", value: function getTextureBindGroup(texture) { var _this$_bindGroupHash$; return (_this$_bindGroupHash$ = this._bindGroupHash[texture.uid]) !== null && _this$_bindGroupHash$ !== void 0 ? _this$_bindGroupHash$ : this._createTextureBindGroup(texture); } }, { key: "_createTextureBindGroup", value: function _createTextureBindGroup(texture) { var source = texture.source; this._bindGroupHash[texture.uid] = new BindGroup.BindGroup({ 0: source, 1: source.style, 2: new UniformGroup.UniformGroup({ uTextureMatrix: { type: "mat3x3<f32>", value: texture.textureMatrix.mapCoord } }) }); return this._bindGroupHash[texture.uid]; } }, { key: "getTextureView", value: function getTextureView(texture) { var _this$_textureViewHas; var source = texture.source; return (_this$_textureViewHas = this._textureViewHash[source.uid]) !== null && _this$_textureViewHas !== void 0 ? _this$_textureViewHas : this._createTextureView(source); } }, { key: "_createTextureView", value: function _createTextureView(texture) { this._textureViewHash[texture.uid] = this.getGpuSource(texture).createView(); return this._textureViewHash[texture.uid]; } }, { key: "generateCanvas", value: function generateCanvas(texture) { var renderer = this._renderer; var commandEncoder = renderer.gpu.device.createCommandEncoder(); var canvas = adapter.DOMAdapter.get().createCanvas(); canvas.width = texture.source.pixelWidth; canvas.height = texture.source.pixelHeight; var context = canvas.getContext("webgpu"); context.configure({ device: renderer.gpu.device, usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.COPY_SRC, format: adapter.DOMAdapter.get().getNavigator().gpu.getPreferredCanvasFormat(), alphaMode: "premultiplied" }); commandEncoder.copyTextureToTexture({ texture: renderer.texture.getGpuSource(texture.source), origin: { x: 0, y: 0 } }, { texture: context.getCurrentTexture() }, { width: canvas.width, height: canvas.height }); renderer.gpu.device.queue.submit([commandEncoder.finish()]); return canvas; } }, { key: "getPixels", value: function getPixels(texture) { var webGPUCanvas = this.generateCanvas(texture); var canvasAndContext = CanvasPool.CanvasPool.getOptimalCanvasAndContext(webGPUCanvas.width, webGPUCanvas.height); var context = canvasAndContext.context; context.drawImage(webGPUCanvas, 0, 0); var width = webGPUCanvas.width, height = webGPUCanvas.height; var imageData = context.getImageData(0, 0, width, height); var pixels = new Uint8ClampedArray(imageData.data.buffer); CanvasPool.CanvasPool.returnCanvasAndContext(canvasAndContext); return { pixels: pixels, width: width, height: height }; } }, { key: "destroy", value: function destroy() { var _this = this; this.managedTextures.slice().forEach(function (source) { return _this.onSourceDestroy(source); }); this.managedTextures = null; for (var _i = 0, _Object$keys = Object.keys(this._bindGroupHash); _i < _Object$keys.length; _i++) { var k = _Object$keys[_i]; var key = Number(k); var bindGroup = this._bindGroupHash[key]; bindGroup === null || bindGroup === void 0 || bindGroup.destroy(); this._bindGroupHash[key] = null; } this._gpu = null; this._mipmapGenerator = null; this._gpuSources = null; this._bindGroupHash = null; this._textureViewHash = null; this._gpuSamplers = null; } }]); }(); /** @ignore */ GpuTextureSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "texture" }; exports.GpuTextureSystem = GpuTextureSystem; /***/ }), /***/ 61435: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var EventEmitter = __webpack_require__(19497); var Point = __webpack_require__(75544); var warn = __webpack_require__(57371); var EventTicker = __webpack_require__(21623); var FederatedMouseEvent = __webpack_require__(73616); var FederatedPointerEvent = __webpack_require__(58122); var FederatedWheelEvent = __webpack_require__(69288); "use strict"; var PROPAGATION_LIMIT = 2048; var tempHitLocation = new Point.Point(); var tempLocalMapping = new Point.Point(); var EventBoundary = /*#__PURE__*/function () { /** * @param rootTarget - The holder of the event boundary. */ function EventBoundary(rootTarget) { _classCallCheck(this, EventBoundary); /** * Emits events after they were dispatched into the scene graph. * * This can be used for global events listening, regardless of the scene graph being used. It should * not be used by interactive libraries for normal use. * * Special events that do not bubble all the way to the root target are not emitted from here, * e.g. pointerenter, pointerleave, click. */ this.dispatch = new EventEmitter(); /** * This flag would emit `pointermove`, `touchmove`, and `mousemove` events on all Containers. * * The `moveOnAll` semantics mirror those of earlier versions of PixiJS. This was disabled in favor of * the Pointer Event API's approach. */ this.moveOnAll = false; /** Enables the global move events. `globalpointermove`, `globaltouchmove`, and `globalmousemove` */ this.enableGlobalMoveEvents = true; /** * State object for mapping methods. * @see EventBoundary#trackingData */ this.mappingState = { trackingData: {} }; /** * The event pool maps event constructors to an free pool of instances of those specific events. * @see EventBoundary#allocateEvent * @see EventBoundary#freeEvent */ this.eventPool = /* @__PURE__ */new Map(); /** Every interactive element gathered from the scene. Only used in `pointermove` */ this._allInteractiveElements = []; /** Every element that passed the hit test. Only used in `pointermove` */ this._hitElements = []; /** Whether or not to collect all the interactive elements from the scene. Enabled in `pointermove` */ this._isPointerMoveEvent = false; this.rootTarget = rootTarget; this.hitPruneFn = this.hitPruneFn.bind(this); this.hitTestFn = this.hitTestFn.bind(this); this.mapPointerDown = this.mapPointerDown.bind(this); this.mapPointerMove = this.mapPointerMove.bind(this); this.mapPointerOut = this.mapPointerOut.bind(this); this.mapPointerOver = this.mapPointerOver.bind(this); this.mapPointerUp = this.mapPointerUp.bind(this); this.mapPointerUpOutside = this.mapPointerUpOutside.bind(this); this.mapWheel = this.mapWheel.bind(this); this.mappingTable = {}; this.addEventMapping("pointerdown", this.mapPointerDown); this.addEventMapping("pointermove", this.mapPointerMove); this.addEventMapping("pointerout", this.mapPointerOut); this.addEventMapping("pointerleave", this.mapPointerOut); this.addEventMapping("pointerover", this.mapPointerOver); this.addEventMapping("pointerup", this.mapPointerUp); this.addEventMapping("pointerupoutside", this.mapPointerUpOutside); this.addEventMapping("wheel", this.mapWheel); } /** * Adds an event mapping for the event `type` handled by `fn`. * * Event mappings can be used to implement additional or custom events. They take an event * coming from the upstream scene (or directly from the {@link EventSystem}) and dispatch new downstream events * generally trickling down and bubbling up to {@link EventBoundary.rootTarget this.rootTarget}. * * To modify the semantics of existing events, the built-in mapping methods of EventBoundary should be overridden * instead. * @param type - The type of upstream event to map. * @param fn - The mapping method. The context of this function must be bound manually, if desired. */ return _createClass(EventBoundary, [{ key: "addEventMapping", value: function addEventMapping(type, fn) { if (!this.mappingTable[type]) { this.mappingTable[type] = []; } this.mappingTable[type].push({ fn: fn, priority: 0 }); this.mappingTable[type].sort(function (a, b) { return a.priority - b.priority; }); } /** * Dispatches the given event * @param e - The event to dispatch. * @param type - The type of event to dispatch. Defaults to `e.type`. */ }, { key: "dispatchEvent", value: function dispatchEvent(e, type) { e.propagationStopped = false; e.propagationImmediatelyStopped = false; this.propagate(e, type); this.dispatch.emit(type || e.type, e); } /** * Maps the given upstream event through the event boundary and propagates it downstream. * @param e - The event to map. */ }, { key: "mapEvent", value: function mapEvent(e) { if (!this.rootTarget) { return; } var mappers = this.mappingTable[e.type]; if (mappers) { for (var i = 0, j = mappers.length; i < j; i++) { mappers[i].fn(e); } } else { warn.warn("[EventBoundary]: Event mapping not defined for ".concat(e.type)); } } /** * Finds the Container that is the target of a event at the given coordinates. * * The passed (x,y) coordinates are in the world space above this event boundary. * @param x - The x coordinate of the event. * @param y - The y coordinate of the event. */ }, { key: "hitTest", value: function hitTest(x, y) { EventTicker.EventsTicker.pauseUpdate = true; var useMove = this._isPointerMoveEvent && this.enableGlobalMoveEvents; var fn = useMove ? "hitTestMoveRecursive" : "hitTestRecursive"; var invertedPath = this[fn](this.rootTarget, this.rootTarget.eventMode, tempHitLocation.set(x, y), this.hitTestFn, this.hitPruneFn); return invertedPath && invertedPath[0]; } /** * Propagate the passed event from from {@link EventBoundary.rootTarget this.rootTarget} to its * target {@code e.target}. * @param e - The event to propagate. * @param type - The type of event to propagate. Defaults to `e.type`. */ }, { key: "propagate", value: function propagate(e, type) { if (!e.target) { return; } var composedPath = e.composedPath(); e.eventPhase = e.CAPTURING_PHASE; for (var i = 0, j = composedPath.length - 1; i < j; i++) { e.currentTarget = composedPath[i]; this.notifyTarget(e, type); if (e.propagationStopped || e.propagationImmediatelyStopped) return; } e.eventPhase = e.AT_TARGET; e.currentTarget = e.target; this.notifyTarget(e, type); if (e.propagationStopped || e.propagationImmediatelyStopped) return; e.eventPhase = e.BUBBLING_PHASE; for (var _i = composedPath.length - 2; _i >= 0; _i--) { e.currentTarget = composedPath[_i]; this.notifyTarget(e, type); if (e.propagationStopped || e.propagationImmediatelyStopped) return; } } /** * Emits the event {@code e} to all interactive containers. The event is propagated in the bubbling phase always. * * This is used in the `globalpointermove` event. * @param e - The emitted event. * @param type - The listeners to notify. * @param targets - The targets to notify. */ }, { key: "all", value: function all(e, type) { var _this = this; var targets = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this._allInteractiveElements; if (targets.length === 0) return; e.eventPhase = e.BUBBLING_PHASE; var events = Array.isArray(type) ? type : [type]; var _loop = function _loop(i) { events.forEach(function (event) { e.currentTarget = targets[i]; _this.notifyTarget(e, event); }); }; for (var i = targets.length - 1; i >= 0; i--) { _loop(i); } } /** * Finds the propagation path from {@link EventBoundary.rootTarget rootTarget} to the passed * {@code target}. The last element in the path is {@code target}. * @param target - The target to find the propagation path to. */ }, { key: "propagationPath", value: function propagationPath(target) { var propagationPath = [target]; for (var i = 0; i < PROPAGATION_LIMIT && target !== this.rootTarget && target.parent; i++) { if (!target.parent) { throw new Error("Cannot find propagation path to disconnected target"); } propagationPath.push(target.parent); target = target.parent; } propagationPath.reverse(); return propagationPath; } }, { key: "hitTestMoveRecursive", value: function hitTestMoveRecursive(currentTarget, eventMode, location, testFn, pruneFn) { var ignore = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; var shouldReturn = false; if (this._interactivePrune(currentTarget)) return null; if (currentTarget.eventMode === "dynamic" || eventMode === "dynamic") { EventTicker.EventsTicker.pauseUpdate = false; } if (currentTarget.interactiveChildren && currentTarget.children) { var children = currentTarget.children; for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; var nestedHit = this.hitTestMoveRecursive(child, this._isInteractive(eventMode) ? eventMode : child.eventMode, location, testFn, pruneFn, ignore || pruneFn(currentTarget, location)); if (nestedHit) { if (nestedHit.length > 0 && !nestedHit[nestedHit.length - 1].parent) { continue; } var isInteractive = currentTarget.isInteractive(); if (nestedHit.length > 0 || isInteractive) { if (isInteractive) this._allInteractiveElements.push(currentTarget); nestedHit.push(currentTarget); } if (this._hitElements.length === 0) this._hitElements = nestedHit; shouldReturn = true; } } } var isInteractiveMode = this._isInteractive(eventMode); var isInteractiveTarget = currentTarget.isInteractive(); if (isInteractiveTarget && isInteractiveTarget) this._allInteractiveElements.push(currentTarget); if (ignore || this._hitElements.length > 0) return null; if (shouldReturn) return this._hitElements; if (isInteractiveMode && !pruneFn(currentTarget, location) && testFn(currentTarget, location)) { return isInteractiveTarget ? [currentTarget] : []; } return null; } /** * Recursive implementation for {@link EventBoundary.hitTest hitTest}. * @param currentTarget - The Container that is to be hit tested. * @param eventMode - The event mode for the `currentTarget` or one of its parents. * @param location - The location that is being tested for overlap. * @param testFn - Callback that determines whether the target passes hit testing. This callback * can assume that `pruneFn` failed to prune the container. * @param pruneFn - Callback that determiness whether the target and all of its children * cannot pass the hit test. It is used as a preliminary optimization to prune entire subtrees * of the scene graph. * @returns An array holding the hit testing target and all its ancestors in order. The first element * is the target itself and the last is {@link EventBoundary.rootTarget rootTarget}. This is the opposite * order w.r.t. the propagation path. If no hit testing target is found, null is returned. */ }, { key: "hitTestRecursive", value: function hitTestRecursive(currentTarget, eventMode, location, testFn, pruneFn) { if (this._interactivePrune(currentTarget) || pruneFn(currentTarget, location)) { return null; } if (currentTarget.eventMode === "dynamic" || eventMode === "dynamic") { EventTicker.EventsTicker.pauseUpdate = false; } if (currentTarget.interactiveChildren && currentTarget.children) { var children = currentTarget.children; var relativeLocation = location; for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; var nestedHit = this.hitTestRecursive(child, this._isInteractive(eventMode) ? eventMode : child.eventMode, relativeLocation, testFn, pruneFn); if (nestedHit) { if (nestedHit.length > 0 && !nestedHit[nestedHit.length - 1].parent) { continue; } var isInteractive = currentTarget.isInteractive(); if (nestedHit.length > 0 || isInteractive) nestedHit.push(currentTarget); return nestedHit; } } } var isInteractiveMode = this._isInteractive(eventMode); var isInteractiveTarget = currentTarget.isInteractive(); if (isInteractiveMode && testFn(currentTarget, location)) { return isInteractiveTarget ? [currentTarget] : []; } return null; } }, { key: "_isInteractive", value: function _isInteractive(_int) { return _int === "static" || _int === "dynamic"; } }, { key: "_interactivePrune", value: function _interactivePrune(container) { if (!container || !container.visible || !container.renderable || !container.measurable) { return true; } if (container.eventMode === "none") { return true; } if (container.eventMode === "passive" && !container.interactiveChildren) { return true; } return false; } /** * Checks whether the container or any of its children cannot pass the hit test at all. * * {@link EventBoundary}'s implementation uses the {@link Container.hitArea hitArea} * and {@link Container._maskEffect} for pruning. * @param container - The container to prune. * @param location - The location to test for overlap. */ }, { key: "hitPruneFn", value: function hitPruneFn(container, location) { if (container.hitArea) { container.worldTransform.applyInverse(location, tempLocalMapping); if (!container.hitArea.contains(tempLocalMapping.x, tempLocalMapping.y)) { return true; } } if (container.effects && container.effects.length) { for (var i = 0; i < container.effects.length; i++) { var effect = container.effects[i]; if (effect.containsPoint) { var effectContainsPoint = effect.containsPoint(location, this.hitTestFn); if (!effectContainsPoint) { return true; } } } } return false; } /** * Checks whether the container passes hit testing for the given location. * @param container - The container to test. * @param location - The location to test for overlap. * @returns - Whether `container` passes hit testing for `location`. */ }, { key: "hitTestFn", value: function hitTestFn(container, location) { if (container.hitArea) { return true; } if (container !== null && container !== void 0 && container.containsPoint) { container.worldTransform.applyInverse(location, tempLocalMapping); return container.containsPoint(tempLocalMapping); } return false; } /** * Notify all the listeners to the event's `currentTarget`. * * If the `currentTarget` contains the property `on<type>`, then it is called here, * simulating the behavior from version 6.x and prior. * @param e - The event passed to the target. * @param type - The type of event to notify. Defaults to `e.type`. */ }, { key: "notifyTarget", value: function notifyTarget(e, type) { var _e$currentTarget$hand, _e$currentTarget; if (!e.currentTarget.isInteractive()) { return; } type !== null && type !== void 0 ? type : type = e.type; var handlerKey = "on".concat(type); (_e$currentTarget$hand = (_e$currentTarget = e.currentTarget)[handlerKey]) === null || _e$currentTarget$hand === void 0 || _e$currentTarget$hand.call(_e$currentTarget, e); var key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? "".concat(type, "capture") : type; this._notifyListeners(e, key); if (e.eventPhase === e.AT_TARGET) { this._notifyListeners(e, type); } } /** * Maps the upstream `pointerdown` events to a downstream `pointerdown` event. * * `touchstart`, `rightdown`, `mousedown` events are also dispatched for specific pointer types. * @param from - The upstream `pointerdown` event. */ }, { key: "mapPointerDown", value: function mapPointerDown(from) { if (!(from instanceof FederatedPointerEvent.FederatedPointerEvent)) { warn.warn("EventBoundary cannot map a non-pointer event as a pointer event"); return; } var e = this.createPointerEvent(from); this.dispatchEvent(e, "pointerdown"); if (e.pointerType === "touch") { this.dispatchEvent(e, "touchstart"); } else if (e.pointerType === "mouse" || e.pointerType === "pen") { var isRightButton = e.button === 2; this.dispatchEvent(e, isRightButton ? "rightdown" : "mousedown"); } var trackingData = this.trackingData(from.pointerId); trackingData.pressTargetsByButton[from.button] = e.composedPath(); this.freeEvent(e); } /** * Maps the upstream `pointermove` to downstream `pointerout`, `pointerover`, and `pointermove` events, in that order. * * The tracking data for the specific pointer has an updated `overTarget`. `mouseout`, `mouseover`, * `mousemove`, and `touchmove` events are fired as well for specific pointer types. * @param from - The upstream `pointermove` event. */ }, { key: "mapPointerMove", value: function mapPointerMove(from) { var _trackingData$overTar, _this$enableGlobalMov; if (!(from instanceof FederatedPointerEvent.FederatedPointerEvent)) { warn.warn("EventBoundary cannot map a non-pointer event as a pointer event"); return; } this._allInteractiveElements.length = 0; this._hitElements.length = 0; this._isPointerMoveEvent = true; var e = this.createPointerEvent(from); this._isPointerMoveEvent = false; var isMouse = e.pointerType === "mouse" || e.pointerType === "pen"; var trackingData = this.trackingData(from.pointerId); var outTarget = this.findMountedTarget(trackingData.overTargets); if (((_trackingData$overTar = trackingData.overTargets) === null || _trackingData$overTar === void 0 ? void 0 : _trackingData$overTar.length) > 0 && outTarget !== e.target) { var outType = from.type === "mousemove" ? "mouseout" : "pointerout"; var outEvent = this.createPointerEvent(from, outType, outTarget); this.dispatchEvent(outEvent, "pointerout"); if (isMouse) this.dispatchEvent(outEvent, "mouseout"); if (!e.composedPath().includes(outTarget)) { var leaveEvent = this.createPointerEvent(from, "pointerleave", outTarget); leaveEvent.eventPhase = leaveEvent.AT_TARGET; while (leaveEvent.target && !e.composedPath().includes(leaveEvent.target)) { leaveEvent.currentTarget = leaveEvent.target; this.notifyTarget(leaveEvent); if (isMouse) this.notifyTarget(leaveEvent, "mouseleave"); leaveEvent.target = leaveEvent.target.parent; } this.freeEvent(leaveEvent); } this.freeEvent(outEvent); } if (outTarget !== e.target) { var overType = from.type === "mousemove" ? "mouseover" : "pointerover"; var overEvent = this.clonePointerEvent(e, overType); this.dispatchEvent(overEvent, "pointerover"); if (isMouse) this.dispatchEvent(overEvent, "mouseover"); var overTargetAncestor = outTarget === null || outTarget === void 0 ? void 0 : outTarget.parent; while (overTargetAncestor && overTargetAncestor !== this.rootTarget.parent) { if (overTargetAncestor === e.target) break; overTargetAncestor = overTargetAncestor.parent; } var didPointerEnter = !overTargetAncestor || overTargetAncestor === this.rootTarget.parent; if (didPointerEnter) { var enterEvent = this.clonePointerEvent(e, "pointerenter"); enterEvent.eventPhase = enterEvent.AT_TARGET; while (enterEvent.target && enterEvent.target !== outTarget && enterEvent.target !== this.rootTarget.parent) { enterEvent.currentTarget = enterEvent.target; this.notifyTarget(enterEvent); if (isMouse) this.notifyTarget(enterEvent, "mouseenter"); enterEvent.target = enterEvent.target.parent; } this.freeEvent(enterEvent); } this.freeEvent(overEvent); } var allMethods = []; var allowGlobalPointerEvents = (_this$enableGlobalMov = this.enableGlobalMoveEvents) !== null && _this$enableGlobalMov !== void 0 ? _this$enableGlobalMov : true; this.moveOnAll ? allMethods.push("pointermove") : this.dispatchEvent(e, "pointermove"); allowGlobalPointerEvents && allMethods.push("globalpointermove"); if (e.pointerType === "touch") { this.moveOnAll ? allMethods.splice(1, 0, "touchmove") : this.dispatchEvent(e, "touchmove"); allowGlobalPointerEvents && allMethods.push("globaltouchmove"); } if (isMouse) { var _e$target; this.moveOnAll ? allMethods.splice(1, 0, "mousemove") : this.dispatchEvent(e, "mousemove"); allowGlobalPointerEvents && allMethods.push("globalmousemove"); this.cursor = (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.cursor; } if (allMethods.length > 0) { this.all(e, allMethods); } this._allInteractiveElements.length = 0; this._hitElements.length = 0; trackingData.overTargets = e.composedPath(); this.freeEvent(e); } /** * Maps the upstream `pointerover` to downstream `pointerover` and `pointerenter` events, in that order. * * The tracking data for the specific pointer gets a new `overTarget`. * @param from - The upstream `pointerover` event. */ }, { key: "mapPointerOver", value: function mapPointerOver(from) { var _e$target2; if (!(from instanceof FederatedPointerEvent.FederatedPointerEvent)) { warn.warn("EventBoundary cannot map a non-pointer event as a pointer event"); return; } var trackingData = this.trackingData(from.pointerId); var e = this.createPointerEvent(from); var isMouse = e.pointerType === "mouse" || e.pointerType === "pen"; this.dispatchEvent(e, "pointerover"); if (isMouse) this.dispatchEvent(e, "mouseover"); if (e.pointerType === "mouse") this.cursor = (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.cursor; var enterEvent = this.clonePointerEvent(e, "pointerenter"); enterEvent.eventPhase = enterEvent.AT_TARGET; while (enterEvent.target && enterEvent.target !== this.rootTarget.parent) { enterEvent.currentTarget = enterEvent.target; this.notifyTarget(enterEvent); if (isMouse) this.notifyTarget(enterEvent, "mouseenter"); enterEvent.target = enterEvent.target.parent; } trackingData.overTargets = e.composedPath(); this.freeEvent(e); this.freeEvent(enterEvent); } /** * Maps the upstream `pointerout` to downstream `pointerout`, `pointerleave` events, in that order. * * The tracking data for the specific pointer is cleared of a `overTarget`. * @param from - The upstream `pointerout` event. */ }, { key: "mapPointerOut", value: function mapPointerOut(from) { if (!(from instanceof FederatedPointerEvent.FederatedPointerEvent)) { warn.warn("EventBoundary cannot map a non-pointer event as a pointer event"); return; } var trackingData = this.trackingData(from.pointerId); if (trackingData.overTargets) { var isMouse = from.pointerType === "mouse" || from.pointerType === "pen"; var outTarget = this.findMountedTarget(trackingData.overTargets); var outEvent = this.createPointerEvent(from, "pointerout", outTarget); this.dispatchEvent(outEvent); if (isMouse) this.dispatchEvent(outEvent, "mouseout"); var leaveEvent = this.createPointerEvent(from, "pointerleave", outTarget); leaveEvent.eventPhase = leaveEvent.AT_TARGET; while (leaveEvent.target && leaveEvent.target !== this.rootTarget.parent) { leaveEvent.currentTarget = leaveEvent.target; this.notifyTarget(leaveEvent); if (isMouse) this.notifyTarget(leaveEvent, "mouseleave"); leaveEvent.target = leaveEvent.target.parent; } trackingData.overTargets = null; this.freeEvent(outEvent); this.freeEvent(leaveEvent); } this.cursor = null; } /** * Maps the upstream `pointerup` event to downstream `pointerup`, `pointerupoutside`, * and `click`/`rightclick`/`pointertap` events, in that order. * * The `pointerupoutside` event bubbles from the original `pointerdown` target to the most specific * ancestor of the `pointerdown` and `pointerup` targets, which is also the `click` event's target. `touchend`, * `rightup`, `mouseup`, `touchendoutside`, `rightupoutside`, `mouseupoutside`, and `tap` are fired as well for * specific pointer types. * @param from - The upstream `pointerup` event. */ }, { key: "mapPointerUp", value: function mapPointerUp(from) { if (!(from instanceof FederatedPointerEvent.FederatedPointerEvent)) { warn.warn("EventBoundary cannot map a non-pointer event as a pointer event"); return; } var now = performance.now(); var e = this.createPointerEvent(from); this.dispatchEvent(e, "pointerup"); if (e.pointerType === "touch") { this.dispatchEvent(e, "touchend"); } else if (e.pointerType === "mouse" || e.pointerType === "pen") { var isRightButton = e.button === 2; this.dispatchEvent(e, isRightButton ? "rightup" : "mouseup"); } var trackingData = this.trackingData(from.pointerId); var pressTarget = this.findMountedTarget(trackingData.pressTargetsByButton[from.button]); var clickTarget = pressTarget; if (pressTarget && !e.composedPath().includes(pressTarget)) { var currentTarget = pressTarget; while (currentTarget && !e.composedPath().includes(currentTarget)) { e.currentTarget = currentTarget; this.notifyTarget(e, "pointerupoutside"); if (e.pointerType === "touch") { this.notifyTarget(e, "touchendoutside"); } else if (e.pointerType === "mouse" || e.pointerType === "pen") { var _isRightButton = e.button === 2; this.notifyTarget(e, _isRightButton ? "rightupoutside" : "mouseupoutside"); } currentTarget = currentTarget.parent; } delete trackingData.pressTargetsByButton[from.button]; clickTarget = currentTarget; } if (clickTarget) { var clickEvent = this.clonePointerEvent(e, "click"); clickEvent.target = clickTarget; clickEvent.path = null; if (!trackingData.clicksByButton[from.button]) { trackingData.clicksByButton[from.button] = { clickCount: 0, target: clickEvent.target, timeStamp: now }; } var clickHistory = trackingData.clicksByButton[from.button]; if (clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < 200) { ++clickHistory.clickCount; } else { clickHistory.clickCount = 1; } clickHistory.target = clickEvent.target; clickHistory.timeStamp = now; clickEvent.detail = clickHistory.clickCount; if (clickEvent.pointerType === "mouse") { var _isRightButton2 = clickEvent.button === 2; this.dispatchEvent(clickEvent, _isRightButton2 ? "rightclick" : "click"); } else if (clickEvent.pointerType === "touch") { this.dispatchEvent(clickEvent, "tap"); } this.dispatchEvent(clickEvent, "pointertap"); this.freeEvent(clickEvent); } this.freeEvent(e); } /** * Maps the upstream `pointerupoutside` event to a downstream `pointerupoutside` event, bubbling from the original * `pointerdown` target to `rootTarget`. * * (The most specific ancestor of the `pointerdown` event and the `pointerup` event must the * `{@link EventBoundary}'s root because the `pointerup` event occurred outside of the boundary.) * * `touchendoutside`, `mouseupoutside`, and `rightupoutside` events are fired as well for specific pointer * types. The tracking data for the specific pointer is cleared of a `pressTarget`. * @param from - The upstream `pointerupoutside` event. */ }, { key: "mapPointerUpOutside", value: function mapPointerUpOutside(from) { if (!(from instanceof FederatedPointerEvent.FederatedPointerEvent)) { warn.warn("EventBoundary cannot map a non-pointer event as a pointer event"); return; } var trackingData = this.trackingData(from.pointerId); var pressTarget = this.findMountedTarget(trackingData.pressTargetsByButton[from.button]); var e = this.createPointerEvent(from); if (pressTarget) { var currentTarget = pressTarget; while (currentTarget) { e.currentTarget = currentTarget; this.notifyTarget(e, "pointerupoutside"); if (e.pointerType === "touch") { this.notifyTarget(e, "touchendoutside"); } else if (e.pointerType === "mouse" || e.pointerType === "pen") { this.notifyTarget(e, e.button === 2 ? "rightupoutside" : "mouseupoutside"); } currentTarget = currentTarget.parent; } delete trackingData.pressTargetsByButton[from.button]; } this.freeEvent(e); } /** * Maps the upstream `wheel` event to a downstream `wheel` event. * @param from - The upstream `wheel` event. */ }, { key: "mapWheel", value: function mapWheel(from) { if (!(from instanceof FederatedWheelEvent.FederatedWheelEvent)) { warn.warn("EventBoundary cannot map a non-wheel event as a wheel event"); return; } var wheelEvent = this.createWheelEvent(from); this.dispatchEvent(wheelEvent); this.freeEvent(wheelEvent); } /** * Finds the most specific event-target in the given propagation path that is still mounted in the scene graph. * * This is used to find the correct `pointerup` and `pointerout` target in the case that the original `pointerdown` * or `pointerover` target was unmounted from the scene graph. * @param propagationPath - The propagation path was valid in the past. * @returns - The most specific event-target still mounted at the same location in the scene graph. */ }, { key: "findMountedTarget", value: function findMountedTarget(propagationPath) { if (!propagationPath) { return null; } var currentTarget = propagationPath[0]; for (var i = 1; i < propagationPath.length; i++) { if (propagationPath[i].parent === currentTarget) { currentTarget = propagationPath[i]; } else { break; } } return currentTarget; } /** * Creates an event whose {@code originalEvent} is {@code from}, with an optional `type` and `target` override. * * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}. * @param from - The {@code originalEvent} for the returned event. * @param [type=from.type] - The type of the returned event. * @param target - The target of the returned event. */ }, { key: "createPointerEvent", value: function createPointerEvent(from, type, target) { var _ref; var event = this.allocateEvent(FederatedPointerEvent.FederatedPointerEvent); this.copyPointerData(from, event); this.copyMouseData(from, event); this.copyData(from, event); event.nativeEvent = from.nativeEvent; event.originalEvent = from; event.target = (_ref = target !== null && target !== void 0 ? target : this.hitTest(event.global.x, event.global.y)) !== null && _ref !== void 0 ? _ref : this._hitElements[0]; if (typeof type === "string") { event.type = type; } return event; } /** * Creates a wheel event whose {@code originalEvent} is {@code from}. * * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}. * @param from - The upstream wheel event. */ }, { key: "createWheelEvent", value: function createWheelEvent(from) { var event = this.allocateEvent(FederatedWheelEvent.FederatedWheelEvent); this.copyWheelData(from, event); this.copyMouseData(from, event); this.copyData(from, event); event.nativeEvent = from.nativeEvent; event.originalEvent = from; event.target = this.hitTest(event.global.x, event.global.y); return event; } /** * Clones the event {@code from}, with an optional {@code type} override. * * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}. * @param from - The event to clone. * @param [type=from.type] - The type of the returned event. */ }, { key: "clonePointerEvent", value: function clonePointerEvent(from, type) { var event = this.allocateEvent(FederatedPointerEvent.FederatedPointerEvent); event.nativeEvent = from.nativeEvent; event.originalEvent = from.originalEvent; this.copyPointerData(from, event); this.copyMouseData(from, event); this.copyData(from, event); event.target = from.target; event.path = from.composedPath().slice(); event.type = type !== null && type !== void 0 ? type : event.type; return event; } /** * Copies wheel {@link FederatedWheelEvent} data from {@code from} into {@code to}. * * The following properties are copied: * + deltaMode * + deltaX * + deltaY * + deltaZ * @param from - The event to copy data from. * @param to - The event to copy data into. */ }, { key: "copyWheelData", value: function copyWheelData(from, to) { to.deltaMode = from.deltaMode; to.deltaX = from.deltaX; to.deltaY = from.deltaY; to.deltaZ = from.deltaZ; } /** * Copies pointer {@link FederatedPointerEvent} data from {@code from} into {@code to}. * * The following properties are copied: * + pointerId * + width * + height * + isPrimary * + pointerType * + pressure * + tangentialPressure * + tiltX * + tiltY * @param from - The event to copy data from. * @param to - The event to copy data into. */ }, { key: "copyPointerData", value: function copyPointerData(from, to) { if (!(from instanceof FederatedPointerEvent.FederatedPointerEvent && to instanceof FederatedPointerEvent.FederatedPointerEvent)) return; to.pointerId = from.pointerId; to.width = from.width; to.height = from.height; to.isPrimary = from.isPrimary; to.pointerType = from.pointerType; to.pressure = from.pressure; to.tangentialPressure = from.tangentialPressure; to.tiltX = from.tiltX; to.tiltY = from.tiltY; to.twist = from.twist; } /** * Copies mouse {@link FederatedMouseEvent} data from {@code from} to {@code to}. * * The following properties are copied: * + altKey * + button * + buttons * + clientX * + clientY * + metaKey * + movementX * + movementY * + pageX * + pageY * + x * + y * + screen * + shiftKey * + global * @param from - The event to copy data from. * @param to - The event to copy data into. */ }, { key: "copyMouseData", value: function copyMouseData(from, to) { if (!(from instanceof FederatedMouseEvent.FederatedMouseEvent && to instanceof FederatedMouseEvent.FederatedMouseEvent)) return; to.altKey = from.altKey; to.button = from.button; to.buttons = from.buttons; to.client.copyFrom(from.client); to.ctrlKey = from.ctrlKey; to.metaKey = from.metaKey; to.movement.copyFrom(from.movement); to.screen.copyFrom(from.screen); to.shiftKey = from.shiftKey; to.global.copyFrom(from.global); } /** * Copies base {@link FederatedEvent} data from {@code from} into {@code to}. * * The following properties are copied: * + isTrusted * + srcElement * + timeStamp * + type * @param from - The event to copy data from. * @param to - The event to copy data into. */ }, { key: "copyData", value: function copyData(from, to) { to.isTrusted = from.isTrusted; to.srcElement = from.srcElement; to.timeStamp = performance.now(); to.type = from.type; to.detail = from.detail; to.view = from.view; to.which = from.which; to.layer.copyFrom(from.layer); to.page.copyFrom(from.page); } /** * @param id - The pointer ID. * @returns The tracking data stored for the given pointer. If no data exists, a blank * state will be created. */ }, { key: "trackingData", value: function trackingData(id) { if (!this.mappingState.trackingData[id]) { this.mappingState.trackingData[id] = { pressTargetsByButton: {}, clicksByButton: {}, overTarget: null }; } return this.mappingState.trackingData[id]; } /** * Allocate a specific type of event from {@link EventBoundary#eventPool this.eventPool}. * * This allocation is constructor-agnostic, as long as it only takes one argument - this event * boundary. * @param constructor - The event's constructor. */ }, { key: "allocateEvent", value: function allocateEvent(constructor) { if (!this.eventPool.has(constructor)) { this.eventPool.set(constructor, []); } var event = this.eventPool.get(constructor).pop() || new constructor(this); event.eventPhase = event.NONE; event.currentTarget = null; event.defaultPrevented = false; event.path = null; event.target = null; return event; } /** * Frees the event and puts it back into the event pool. * * It is illegal to reuse the event until it is allocated again, using `this.allocateEvent`. * * It is also advised that events not allocated from {@link EventBoundary#allocateEvent this.allocateEvent} * not be freed. This is because of the possibility that the same event is freed twice, which can cause * it to be allocated twice & result in overwriting. * @param event - The event to be freed. * @throws Error if the event is managed by another event boundary. */ }, { key: "freeEvent", value: function freeEvent(event) { if (event.manager !== this) throw new Error("It is illegal to free an event not managed by this EventBoundary!"); var constructor = event.constructor; if (!this.eventPool.has(constructor)) { this.eventPool.set(constructor, []); } this.eventPool.get(constructor).push(event); } /** * Similar to {@link EventEmitter.emit}, except it stops if the `propagationImmediatelyStopped` flag * is set on the event. * @param e - The event to call each listener with. * @param type - The event key. */ }, { key: "_notifyListeners", value: function _notifyListeners(e, type) { var listeners = e.currentTarget._events[type]; if (!listeners) return; if ("fn" in listeners) { if (listeners.once) e.currentTarget.removeListener(type, listeners.fn, void 0, true); listeners.fn.call(listeners.context, e); } else { for (var i = 0, j = listeners.length; i < j && !e.propagationImmediatelyStopped; i++) { if (listeners[i].once) e.currentTarget.removeListener(type, listeners[i].fn, void 0, true); listeners[i].fn.call(listeners[i].context, e); } } } }]); }(); exports.EventBoundary = EventBoundary; /***/ }), /***/ 61507: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var fragment = "\nin vec2 vTextureCoord;\n\nout vec4 finalColor;\n\nuniform float uAlpha;\nuniform sampler2D uTexture;\n\nvoid main()\n{\n finalColor = texture(uTexture, vTextureCoord) * uAlpha;\n}\n"; exports["default"] = fragment; /***/ }), /***/ 61647: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var GlParticleContainerAdaptor = __webpack_require__(54600); var ParticleContainerPipe = __webpack_require__(52874); "use strict"; var GlParticleContainerPipe = /*#__PURE__*/function (_ParticleContainerPip) { function GlParticleContainerPipe(renderer) { _classCallCheck(this, GlParticleContainerPipe); return _callSuper(this, GlParticleContainerPipe, [renderer, new GlParticleContainerAdaptor.GlParticleContainerAdaptor()]); } _inherits(GlParticleContainerPipe, _ParticleContainerPip); return _createClass(GlParticleContainerPipe); }(ParticleContainerPipe.ParticleContainerPipe); /** @ignore */ GlParticleContainerPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes], name: "particle" }; exports.GlParticleContainerPipe = GlParticleContainerPipe; /***/ }), /***/ 61751: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var fragTemplate = ["precision mediump float;", "void main(void){", "float test = 0.1;", "%forloop%", "gl_FragColor = vec4(0.0);", "}"].join("\n"); function generateIfTestSrc(maxIfs) { var src = ""; for (var i = 0; i < maxIfs; ++i) { if (i > 0) { src += "\nelse "; } if (i < maxIfs - 1) { src += "if(test == ".concat(i, ".0){}"); } } return src; } function checkMaxIfStatementsInShader(maxIfs, gl) { if (maxIfs === 0) { throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`"); } var shader = gl.createShader(gl.FRAGMENT_SHADER); try { while (true) { var fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs)); gl.shaderSource(shader, fragmentSrc); gl.compileShader(shader); if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { maxIfs = maxIfs / 2 | 0; } else { break; } } } finally { gl.deleteShader(shader); } return maxIfs; } exports.checkMaxIfStatementsInShader = checkMaxIfStatementsInShader; /***/ }), /***/ 61784: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var GlBatchAdaptor = __webpack_require__(39062); var checkMaxIfStatementsInShader = __webpack_require__(61751); var maxRecommendedTextures = __webpack_require__(6899); var generateGPULayout = __webpack_require__(14952); var generateLayout = __webpack_require__(58840); var getTextureBatchBindGroup = __webpack_require__(62340); var GpuBatchAdaptor = __webpack_require__(53626); var Batcher = __webpack_require__(55403); var BatcherPipe = __webpack_require__(61087); var BatchGeometry = __webpack_require__(31932); var BatchTextureArray = __webpack_require__(54404); var DefaultBatcher = __webpack_require__(91938); var DefaultShader = __webpack_require__(51080); var compileHighShaderToProgram = __webpack_require__(97754); var compileHighShader = __webpack_require__(14075); __webpack_require__(18486); var addBits = __webpack_require__(88750); var compileHooks = __webpack_require__(33102); var compileInputs = __webpack_require__(13281); var compileOutputs = __webpack_require__(32012); var formatShader = __webpack_require__(79379); var injectBits = __webpack_require__(22880); var defaultProgramTemplate = __webpack_require__(46484); var colorBit = __webpack_require__(78786); var generateTextureBatchBit = __webpack_require__(96847); var globalUniformsBit = __webpack_require__(31359); var localUniformBit = __webpack_require__(21654); var roundPixelsBit = __webpack_require__(35268); var textureBit = __webpack_require__(37874); var AlphaMask = __webpack_require__(28662); var AlphaMaskPipe = __webpack_require__(89914); var ColorMask = __webpack_require__(37078); var ColorMaskPipe = __webpack_require__(42682); var MaskEffectManager = __webpack_require__(47281); var ScissorMask = __webpack_require__(70854); var StencilMask = __webpack_require__(13798); var StencilMaskPipe = __webpack_require__(28010); var addMaskBounds = __webpack_require__(30597); var addMaskLocalBounds = __webpack_require__(82132); var autoDetectRenderer = __webpack_require__(68556); var _const = __webpack_require__(43265); var GlBuffer = __webpack_require__(59061); var GlBufferSystem = __webpack_require__(46952); var _const$1 = __webpack_require__(63548); var GlContextSystem = __webpack_require__(84344); __webpack_require__(82295); __webpack_require__(82352); var GlGeometrySystem = __webpack_require__(85580); var getGlTypeFromFormat = __webpack_require__(74374); var GlBackBufferSystem = __webpack_require__(800); var GlColorMaskSystem = __webpack_require__(38084); var GlEncoderSystem = __webpack_require__(16051); var GlRenderTarget = __webpack_require__(39401); var GlStencilSystem = __webpack_require__(10011); var GlUboSystem = __webpack_require__(68951); var GlRenderTargetAdaptor = __webpack_require__(53310); var GlRenderTargetSystem = __webpack_require__(58002); __webpack_require__(88798); var GenerateShaderSyncCode = __webpack_require__(70809); var getBatchSamplersUniformGroup = __webpack_require__(72059); var GlProgram = __webpack_require__(23896); var GlProgramData = __webpack_require__(41568); var GlShaderSystem = __webpack_require__(17058); var GlUniformGroupSystem = __webpack_require__(72360); var migrateFragmentFromV7toV8 = __webpack_require__(22380); var compileShader = __webpack_require__(80442); var defaultValue = __webpack_require__(40486); var ensureAttributes = __webpack_require__(85855); var extractAttributesFromGlProgram = __webpack_require__(3061); var generateProgram = __webpack_require__(40559); var getMaxFragmentPrecision = __webpack_require__(56696); var getTestContext = __webpack_require__(25131); var getUboData = __webpack_require__(31216); var getUniformData = __webpack_require__(98192); var logProgramError = __webpack_require__(40474); var mapSize = __webpack_require__(31349); var mapType = __webpack_require__(63880); var addProgramDefines = __webpack_require__(66702); var ensurePrecision = __webpack_require__(57151); var insertVersion = __webpack_require__(30942); var setProgramName = __webpack_require__(55946); var stripVersion = __webpack_require__(20303); var createUboElementsSTD40 = __webpack_require__(86754); var createUboSyncSTD40 = __webpack_require__(2187); var generateArraySyncSTD40 = __webpack_require__(71075); var generateUniformsSync = __webpack_require__(19114); var generateUniformsSyncTypes = __webpack_require__(1761); var GlStateSystem = __webpack_require__(43528); var mapWebGLBlendModesToPixi = __webpack_require__(95822); var _const$2 = __webpack_require__(80176); var GlTexture = __webpack_require__(10485); var GlTextureSystem = __webpack_require__(90216); __webpack_require__(29943); var glUploadBufferImageResource = __webpack_require__(45394); var glUploadCompressedTextureResource = __webpack_require__(33173); var glUploadImageResource = __webpack_require__(13864); var glUploadVideoResource = __webpack_require__(18410); var applyStyleParams = __webpack_require__(2818); var getSupportedGlCompressedTextureFormats = __webpack_require__(40260); var mapFormatToGlFormat = __webpack_require__(99229); var mapFormatToGlInternalFormat = __webpack_require__(6088); var mapFormatToGlType = __webpack_require__(96230); var pixiToGlMaps = __webpack_require__(77236); var unpremultiplyAlpha = __webpack_require__(88545); var WebGLRenderer = __webpack_require__(15973); var BindGroupSystem = __webpack_require__(95865); var GpuBufferSystem = __webpack_require__(37848); var GpuReadBuffer = __webpack_require__(70001); var UboBatch = __webpack_require__(41581); var GpuColorMaskSystem = __webpack_require__(83432); var GpuDeviceSystem = __webpack_require__(58815); var GpuEncoderSystem = __webpack_require__(59471); var GpuStencilSystem = __webpack_require__(47135); var GpuUboSystem = __webpack_require__(51387); var GpuUniformBatchPipe = __webpack_require__(79236); var PipelineSystem = __webpack_require__(12026); var calculateProjection = __webpack_require__(46415); var GpuRenderTarget = __webpack_require__(46873); var GpuRenderTargetAdaptor = __webpack_require__(64884); var GpuRenderTargetSystem = __webpack_require__(30324); var BindGroup = __webpack_require__(85156); __webpack_require__(10983); var GpuProgram = __webpack_require__(57974); var GpuShaderSystem = __webpack_require__(82084); var createUboElementsWGSL = __webpack_require__(30008); var createUboSyncFunctionWGSL = __webpack_require__(2898); var extractAttributesFromGpuProgram = __webpack_require__(10494); var extractStructAndGroups = __webpack_require__(23551); var generateArraySyncWGSL = __webpack_require__(98954); var generateGpuLayoutGroups = __webpack_require__(14405); var generateLayoutHash = __webpack_require__(70823); var removeStructAndGroupDuplicates = __webpack_require__(92893); var GpuBlendModesToPixi = __webpack_require__(2422); var GpuStateSystem = __webpack_require__(95120); var GpuStencilModesToPixi = __webpack_require__(25039); var GpuTextureSystem = __webpack_require__(61284); __webpack_require__(76431); var gpuUploadBufferImageResource = __webpack_require__(52138); var gpuUploadCompressedTextureResource = __webpack_require__(92989); var gpuUploadImageSource = __webpack_require__(37493); var gpuUploadVideoSource = __webpack_require__(28595); var getSupportedGPUCompressedTextureFormats = __webpack_require__(53252); var GpuMipmapGenerator = __webpack_require__(45413); var WebGPURenderer = __webpack_require__(98971); var BackgroundSystem = __webpack_require__(52481); var BlendModePipe = __webpack_require__(73155); var Buffer = __webpack_require__(59832); var BufferResource = __webpack_require__(1484); var _const$3 = __webpack_require__(33843); var fastCopy = __webpack_require__(36243); var ExtractSystem = __webpack_require__(41267); var GenerateTextureSystem = __webpack_require__(66304); var _const$4 = __webpack_require__(43469); var Geometry = __webpack_require__(18964); var buildUvs = __webpack_require__(36262); var ensureIsBuffer = __webpack_require__(9258); var getAttributeInfoFromFormat = __webpack_require__(63421); var getGeometryBounds = __webpack_require__(1021); var transformVertices = __webpack_require__(25835); __webpack_require__(80851); var InstructionSet = __webpack_require__(15571); __webpack_require__(31863); __webpack_require__(97177); var GlobalUniformSystem = __webpack_require__(78115); var isRenderingToScreen = __webpack_require__(33490); var RenderTarget = __webpack_require__(25654); var RenderTargetSystem = __webpack_require__(50827); var viewportFromFrame = __webpack_require__(1336); var SchedulerSystem = __webpack_require__(93381); var _const$5 = __webpack_require__(23448); var Shader = __webpack_require__(27866); __webpack_require__(21047); var types = __webpack_require__(4386); var UboSystem = __webpack_require__(50626); var UniformGroup = __webpack_require__(34400); var createUboSyncFunction = __webpack_require__(46674); var getDefaultUniformValue = __webpack_require__(15489); var uboSyncFunctions = __webpack_require__(52029); var uniformParsers = __webpack_require__(23845); var HelloSystem = __webpack_require__(34102); var _const$6 = __webpack_require__(15068); var getAdjustedBlendModeBlend = __webpack_require__(4794); var State = __webpack_require__(84938); var AbstractRenderer = __webpack_require__(59158); var SharedSystems = __webpack_require__(96406); __webpack_require__(88370); var SystemRunner = __webpack_require__(70652); __webpack_require__(968); var CanvasPool = __webpack_require__(88699); var _const$7 = __webpack_require__(18578); __webpack_require__(57962); var RenderableGCSystem = __webpack_require__(52070); var RenderTexture = __webpack_require__(37314); var BufferImageSource = __webpack_require__(56634); var CanvasSource = __webpack_require__(35879); var CompressedSource = __webpack_require__(49326); var ImageSource = __webpack_require__(80344); var TextureSource = __webpack_require__(55406); var VideoSource = __webpack_require__(19782); var Texture = __webpack_require__(73782); var TextureGCSystem = __webpack_require__(19977); var TextureMatrix = __webpack_require__(82467); var TexturePool = __webpack_require__(53248); var TextureStyle = __webpack_require__(62881); var TextureUvs = __webpack_require__(41136); var generateUID = __webpack_require__(69968); var getCanvasTexture = __webpack_require__(57240); var getSupportedCompressedTextureFormats = __webpack_require__(2081); var getSupportedTextureFormats = __webpack_require__(10144); var textureFrom = __webpack_require__(42268); var createIdFromString = __webpack_require__(79471); var parseFunctionBody = __webpack_require__(45520); __webpack_require__(90914); var ViewSystem = __webpack_require__(79679); var types$1 = __webpack_require__(9634); "use strict"; exports.GlBatchAdaptor = GlBatchAdaptor.GlBatchAdaptor; exports.checkMaxIfStatementsInShader = checkMaxIfStatementsInShader.checkMaxIfStatementsInShader; exports.getMaxTexturesPerBatch = maxRecommendedTextures.getMaxTexturesPerBatch; exports.generateGPULayout = generateGPULayout.generateGPULayout; exports.generateLayout = generateLayout.generateLayout; exports.getTextureBatchBindGroup = getTextureBatchBindGroup.getTextureBatchBindGroup; exports.GpuBatchAdaptor = GpuBatchAdaptor.GpuBatchAdaptor; exports.Batch = Batcher.Batch; exports.Batcher = Batcher.Batcher; exports.BatcherPipe = BatcherPipe.BatcherPipe; exports.BatchGeometry = BatchGeometry.BatchGeometry; exports.BatchTextureArray = BatchTextureArray.BatchTextureArray; exports.DefaultBatcher = DefaultBatcher.DefaultBatcher; exports.DefaultShader = DefaultShader.DefaultShader; exports.compileHighShaderGlProgram = compileHighShaderToProgram.compileHighShaderGlProgram; exports.compileHighShaderGpuProgram = compileHighShaderToProgram.compileHighShaderGpuProgram; exports.compileHighShader = compileHighShader.compileHighShader; exports.compileHighShaderGl = compileHighShader.compileHighShaderGl; exports.addBits = addBits.addBits; exports.compileHooks = compileHooks.compileHooks; exports.findHooksRx = compileHooks.findHooksRx; exports.compileInputs = compileInputs.compileInputs; exports.compileOutputs = compileOutputs.compileOutputs; exports.formatShader = formatShader.formatShader; exports.injectBits = injectBits.injectBits; exports.fragmentGPUTemplate = defaultProgramTemplate.fragmentGPUTemplate; exports.fragmentGlTemplate = defaultProgramTemplate.fragmentGlTemplate; exports.vertexGPUTemplate = defaultProgramTemplate.vertexGPUTemplate; exports.vertexGlTemplate = defaultProgramTemplate.vertexGlTemplate; exports.colorBit = colorBit.colorBit; exports.colorBitGl = colorBit.colorBitGl; exports.generateTextureBatchBit = generateTextureBatchBit.generateTextureBatchBit; exports.generateTextureBatchBitGl = generateTextureBatchBit.generateTextureBatchBitGl; exports.globalUniformsBit = globalUniformsBit.globalUniformsBit; exports.globalUniformsBitGl = globalUniformsBit.globalUniformsBitGl; exports.globalUniformsUBOBitGl = globalUniformsBit.globalUniformsUBOBitGl; exports.localUniformBit = localUniformBit.localUniformBit; exports.localUniformBitGl = localUniformBit.localUniformBitGl; exports.localUniformBitGroup2 = localUniformBit.localUniformBitGroup2; exports.roundPixelsBit = roundPixelsBit.roundPixelsBit; exports.roundPixelsBitGl = roundPixelsBit.roundPixelsBitGl; exports.textureBit = textureBit.textureBit; exports.textureBitGl = textureBit.textureBitGl; exports.AlphaMask = AlphaMask.AlphaMask; exports.AlphaMaskPipe = AlphaMaskPipe.AlphaMaskPipe; exports.ColorMask = ColorMask.ColorMask; exports.ColorMaskPipe = ColorMaskPipe.ColorMaskPipe; exports.MaskEffectManager = MaskEffectManager.MaskEffectManager; exports.MaskEffectManagerClass = MaskEffectManager.MaskEffectManagerClass; exports.ScissorMask = ScissorMask.ScissorMask; exports.StencilMask = StencilMask.StencilMask; exports.StencilMaskPipe = StencilMaskPipe.StencilMaskPipe; exports.addMaskBounds = addMaskBounds.addMaskBounds; exports.addMaskLocalBounds = addMaskLocalBounds.addMaskLocalBounds; exports.getMatrixRelativeToParent = addMaskLocalBounds.getMatrixRelativeToParent; exports.autoDetectRenderer = autoDetectRenderer.autoDetectRenderer; exports.BUFFER_TYPE = _const.BUFFER_TYPE; exports.GlBuffer = GlBuffer.GlBuffer; exports.GlBufferSystem = GlBufferSystem.GlBufferSystem; exports.CLEAR = _const$1.CLEAR; exports.GlContextSystem = GlContextSystem.GlContextSystem; exports.GlGeometrySystem = GlGeometrySystem.GlGeometrySystem; exports.getGlTypeFromFormat = getGlTypeFromFormat.getGlTypeFromFormat; exports.GlBackBufferSystem = GlBackBufferSystem.GlBackBufferSystem; exports.GlColorMaskSystem = GlColorMaskSystem.GlColorMaskSystem; exports.GlEncoderSystem = GlEncoderSystem.GlEncoderSystem; exports.GlRenderTarget = GlRenderTarget.GlRenderTarget; exports.GlStencilSystem = GlStencilSystem.GlStencilSystem; exports.GlUboSystem = GlUboSystem.GlUboSystem; exports.GlRenderTargetAdaptor = GlRenderTargetAdaptor.GlRenderTargetAdaptor; exports.GlRenderTargetSystem = GlRenderTargetSystem.GlRenderTargetSystem; exports.generateShaderSyncCode = GenerateShaderSyncCode.generateShaderSyncCode; exports.getBatchSamplersUniformGroup = getBatchSamplersUniformGroup.getBatchSamplersUniformGroup; exports.GlProgram = GlProgram.GlProgram; exports.GlProgramData = GlProgramData.GlProgramData; exports.IGLUniformData = GlProgramData.IGLUniformData; exports.GlShaderSystem = GlShaderSystem.GlShaderSystem; exports.GlUniformGroupSystem = GlUniformGroupSystem.GlUniformGroupSystem; exports.migrateFragmentFromV7toV8 = migrateFragmentFromV7toV8.migrateFragmentFromV7toV8; exports.compileShader = compileShader.compileShader; exports.defaultValue = defaultValue.defaultValue; exports.ensureAttributes = ensureAttributes.ensureAttributes; exports.extractAttributesFromGlProgram = extractAttributesFromGlProgram.extractAttributesFromGlProgram; exports.generateProgram = generateProgram.generateProgram; exports.getMaxFragmentPrecision = getMaxFragmentPrecision.getMaxFragmentPrecision; exports.getTestContext = getTestContext.getTestContext; exports.getUboData = getUboData.getUboData; exports.getUniformData = getUniformData.getUniformData; exports.logProgramError = logProgramError.logProgramError; exports.mapSize = mapSize.mapSize; exports.mapGlToVertexFormat = mapType.mapGlToVertexFormat; exports.mapType = mapType.mapType; exports.addProgramDefines = addProgramDefines.addProgramDefines; exports.ensurePrecision = ensurePrecision.ensurePrecision; exports.insertVersion = insertVersion.insertVersion; exports.setProgramName = setProgramName.setProgramName; exports.stripVersion = stripVersion.stripVersion; exports.WGSL_TO_STD40_SIZE = createUboElementsSTD40.WGSL_TO_STD40_SIZE; exports.createUboElementsSTD40 = createUboElementsSTD40.createUboElementsSTD40; exports.createUboSyncFunctionSTD40 = createUboSyncSTD40.createUboSyncFunctionSTD40; exports.generateArraySyncSTD40 = generateArraySyncSTD40.generateArraySyncSTD40; exports.generateUniformsSync = generateUniformsSync.generateUniformsSync; exports.UNIFORM_TO_ARRAY_SETTERS = generateUniformsSyncTypes.UNIFORM_TO_ARRAY_SETTERS; exports.UNIFORM_TO_SINGLE_SETTERS = generateUniformsSyncTypes.UNIFORM_TO_SINGLE_SETTERS; exports.GlStateSystem = GlStateSystem.GlStateSystem; exports.mapWebGLBlendModesToPixi = mapWebGLBlendModesToPixi.mapWebGLBlendModesToPixi; exports.GL_FORMATS = _const$2.GL_FORMATS; exports.GL_TARGETS = _const$2.GL_TARGETS; exports.GL_TYPES = _const$2.GL_TYPES; exports.GL_WRAP_MODES = _const$2.GL_WRAP_MODES; exports.GlTexture = GlTexture.GlTexture; exports.GlTextureSystem = GlTextureSystem.GlTextureSystem; exports.glUploadBufferImageResource = glUploadBufferImageResource.glUploadBufferImageResource; exports.glUploadCompressedTextureResource = glUploadCompressedTextureResource.glUploadCompressedTextureResource; exports.glUploadImageResource = glUploadImageResource.glUploadImageResource; exports.glUploadVideoResource = glUploadVideoResource.glUploadVideoResource; exports.applyStyleParams = applyStyleParams.applyStyleParams; exports.getSupportedGlCompressedTextureFormats = getSupportedGlCompressedTextureFormats.getSupportedGlCompressedTextureFormats; exports.mapFormatToGlFormat = mapFormatToGlFormat.mapFormatToGlFormat; exports.mapFormatToGlInternalFormat = mapFormatToGlInternalFormat.mapFormatToGlInternalFormat; exports.mapFormatToGlType = mapFormatToGlType.mapFormatToGlType; exports.compareModeToGlCompare = pixiToGlMaps.compareModeToGlCompare; exports.mipmapScaleModeToGlFilter = pixiToGlMaps.mipmapScaleModeToGlFilter; exports.scaleModeToGlFilter = pixiToGlMaps.scaleModeToGlFilter; exports.wrapModeToGlAddress = pixiToGlMaps.wrapModeToGlAddress; exports.unpremultiplyAlpha = unpremultiplyAlpha.unpremultiplyAlpha; exports.WebGLRenderer = WebGLRenderer.WebGLRenderer; exports.BindGroupSystem = BindGroupSystem.BindGroupSystem; exports.GpuBufferSystem = GpuBufferSystem.GpuBufferSystem; exports.GpuReadBuffer = GpuReadBuffer.GpuReadBuffer; exports.UboBatch = UboBatch.UboBatch; exports.GpuColorMaskSystem = GpuColorMaskSystem.GpuColorMaskSystem; exports.GpuDeviceSystem = GpuDeviceSystem.GpuDeviceSystem; exports.GpuEncoderSystem = GpuEncoderSystem.GpuEncoderSystem; exports.GpuStencilSystem = GpuStencilSystem.GpuStencilSystem; exports.GpuUboSystem = GpuUboSystem.GpuUboSystem; exports.GpuUniformBatchPipe = GpuUniformBatchPipe.GpuUniformBatchPipe; exports.PipelineSystem = PipelineSystem.PipelineSystem; exports.calculateProjection = calculateProjection.calculateProjection; exports.GpuRenderTarget = GpuRenderTarget.GpuRenderTarget; exports.GpuRenderTargetAdaptor = GpuRenderTargetAdaptor.GpuRenderTargetAdaptor; exports.GpuRenderTargetSystem = GpuRenderTargetSystem.GpuRenderTargetSystem; exports.BindGroup = BindGroup.BindGroup; exports.GpuProgram = GpuProgram.GpuProgram; exports.GpuShaderSystem = GpuShaderSystem.GpuShaderSystem; exports.WGSL_ALIGN_SIZE_DATA = createUboElementsWGSL.WGSL_ALIGN_SIZE_DATA; exports.createUboElementsWGSL = createUboElementsWGSL.createUboElementsWGSL; exports.createUboSyncFunctionWGSL = createUboSyncFunctionWGSL.createUboSyncFunctionWGSL; exports.extractAttributesFromGpuProgram = extractAttributesFromGpuProgram.extractAttributesFromGpuProgram; exports.extractStructAndGroups = extractStructAndGroups.extractStructAndGroups; exports.generateArraySyncWGSL = generateArraySyncWGSL.generateArraySyncWGSL; exports.generateGpuLayoutGroups = generateGpuLayoutGroups.generateGpuLayoutGroups; exports.generateLayoutHash = generateLayoutHash.generateLayoutHash; exports.removeStructAndGroupDuplicates = removeStructAndGroupDuplicates.removeStructAndGroupDuplicates; exports.GpuBlendModesToPixi = GpuBlendModesToPixi.GpuBlendModesToPixi; exports.GpuStateSystem = GpuStateSystem.GpuStateSystem; exports.GpuStencilModesToPixi = GpuStencilModesToPixi.GpuStencilModesToPixi; exports.GpuTextureSystem = GpuTextureSystem.GpuTextureSystem; exports.gpuUploadBufferImageResource = gpuUploadBufferImageResource.gpuUploadBufferImageResource; exports.blockDataMap = gpuUploadCompressedTextureResource.blockDataMap; exports.gpuUploadCompressedTextureResource = gpuUploadCompressedTextureResource.gpuUploadCompressedTextureResource; exports.gpuUploadImageResource = gpuUploadImageSource.gpuUploadImageResource; exports.gpuUploadVideoResource = gpuUploadVideoSource.gpuUploadVideoResource; exports.getSupportedGPUCompressedTextureFormats = getSupportedGPUCompressedTextureFormats.getSupportedGPUCompressedTextureFormats; exports.GpuMipmapGenerator = GpuMipmapGenerator.GpuMipmapGenerator; exports.WebGPURenderer = WebGPURenderer.WebGPURenderer; exports.BackgroundSystem = BackgroundSystem.BackgroundSystem; exports.BlendModePipe = BlendModePipe.BlendModePipe; exports.Buffer = Buffer.Buffer; exports.BufferResource = BufferResource.BufferResource; exports.BufferUsage = _const$3.BufferUsage; exports.fastCopy = fastCopy.fastCopy; exports.ExtractSystem = ExtractSystem.ExtractSystem; exports.GenerateTextureSystem = GenerateTextureSystem.GenerateTextureSystem; exports.DRAW_MODES = _const$4.DRAW_MODES; exports.Geometry = Geometry.Geometry; exports.buildSimpleUvs = buildUvs.buildSimpleUvs; exports.buildUvs = buildUvs.buildUvs; exports.ensureIsBuffer = ensureIsBuffer.ensureIsBuffer; exports.getAttributeInfoFromFormat = getAttributeInfoFromFormat.getAttributeInfoFromFormat; exports.getGeometryBounds = getGeometryBounds.getGeometryBounds; exports.transformVertices = transformVertices.transformVertices; exports.InstructionSet = InstructionSet.InstructionSet; exports.GlobalUniformSystem = GlobalUniformSystem.GlobalUniformSystem; exports.isRenderingToScreen = isRenderingToScreen.isRenderingToScreen; exports.RenderTarget = RenderTarget.RenderTarget; exports.RenderTargetSystem = RenderTargetSystem.RenderTargetSystem; exports.viewportFromFrame = viewportFromFrame.viewportFromFrame; exports.SchedulerSystem = SchedulerSystem.SchedulerSystem; exports.ShaderStage = _const$5.ShaderStage; exports.Shader = Shader.Shader; exports.UNIFORM_TYPES_MAP = types.UNIFORM_TYPES_MAP; exports.UNIFORM_TYPES_VALUES = types.UNIFORM_TYPES_VALUES; exports.UboSystem = UboSystem.UboSystem; exports.UniformGroup = UniformGroup.UniformGroup; exports.createUboSyncFunction = createUboSyncFunction.createUboSyncFunction; exports.getDefaultUniformValue = getDefaultUniformValue.getDefaultUniformValue; exports.uboSyncFunctionsSTD40 = uboSyncFunctions.uboSyncFunctionsSTD40; exports.uboSyncFunctionsWGSL = uboSyncFunctions.uboSyncFunctionsWGSL; exports.uniformParsers = uniformParsers.uniformParsers; exports.HelloSystem = HelloSystem.HelloSystem; exports.BLEND_TO_NPM = _const$6.BLEND_TO_NPM; exports.STENCIL_MODES = _const$6.STENCIL_MODES; exports.getAdjustedBlendModeBlend = getAdjustedBlendModeBlend.getAdjustedBlendModeBlend; exports.State = State.State; exports.AbstractRenderer = AbstractRenderer.AbstractRenderer; exports.SharedRenderPipes = SharedSystems.SharedRenderPipes; exports.SharedSystems = SharedSystems.SharedSystems; exports.SystemRunner = SystemRunner.SystemRunner; exports.CanvasPool = CanvasPool.CanvasPool; exports.CanvasPoolClass = CanvasPool.CanvasPoolClass; exports.DEPRECATED_SCALE_MODES = _const$7.DEPRECATED_SCALE_MODES; exports.DEPRECATED_WRAP_MODES = _const$7.DEPRECATED_WRAP_MODES; exports.MSAA_QUALITY = _const$7.MSAA_QUALITY; exports.SCALE_MODES = _const$7.SCALE_MODES; exports.WRAP_MODES = _const$7.WRAP_MODES; exports.RenderableGCSystem = RenderableGCSystem.RenderableGCSystem; exports.RenderTexture = RenderTexture.RenderTexture; exports.BufferImageSource = BufferImageSource.BufferImageSource; exports.CanvasSource = CanvasSource.CanvasSource; exports.CompressedSource = CompressedSource.CompressedSource; exports.ImageSource = ImageSource.ImageSource; exports.TextureSource = TextureSource.TextureSource; exports.VideoSource = VideoSource.VideoSource; exports.Texture = Texture.Texture; exports.TextureGCSystem = TextureGCSystem.TextureGCSystem; exports.TextureMatrix = TextureMatrix.TextureMatrix; exports.TexturePool = TexturePool.TexturePool; exports.TexturePoolClass = TexturePool.TexturePoolClass; exports.TextureStyle = TextureStyle.TextureStyle; exports.TextureUvs = TextureUvs.TextureUvs; exports.generateUID = generateUID.generateUID; exports.getCanvasTexture = getCanvasTexture.getCanvasTexture; exports.hasCachedCanvasTexture = getCanvasTexture.hasCachedCanvasTexture; exports.getSupportedCompressedTextureFormats = getSupportedCompressedTextureFormats.getSupportedCompressedTextureFormats; exports.getSupportedTextureFormats = getSupportedTextureFormats.getSupportedTextureFormats; exports.nonCompressedFormats = getSupportedTextureFormats.nonCompressedFormats; exports.autoDetectSource = textureFrom.autoDetectSource; exports.resourceToTexture = textureFrom.resourceToTexture; exports.textureFrom = textureFrom.textureFrom; exports.createIdFromString = createIdFromString.createIdFromString; exports.parseFunctionBody = parseFunctionBody.parseFunctionBody; exports.ViewSystem = ViewSystem.ViewSystem; exports.RendererType = types$1.RendererType; /***/ }), /***/ 61787: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var AbstractText = __webpack_require__(93213); var CanvasTextMetrics = __webpack_require__(1635); var TextStyle = __webpack_require__(55858); "use strict"; var Text = /*#__PURE__*/function (_AbstractText$Abstrac) { function Text() { var _this; _classCallCheck(this, Text); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var options = AbstractText.ensureTextOptions(args, "Text"); _this = _callSuper(this, Text, [options, TextStyle.TextStyle]); _this.renderPipeId = "text"; return _this; } /** @private */ _inherits(Text, _AbstractText$Abstrac); return _createClass(Text, [{ key: "updateBounds", value: function updateBounds() { var bounds = this._bounds; var anchor = this._anchor; var canvasMeasurement = CanvasTextMetrics.CanvasTextMetrics.measureText(this._text, this._style); var width = canvasMeasurement.width, height = canvasMeasurement.height; bounds.minX = -anchor._x * width; bounds.maxX = bounds.minX + width; bounds.minY = -anchor._y * height; bounds.maxY = bounds.minY + height; } }]); }(AbstractText.AbstractText); exports.Text = Text; /***/ }), /***/ 62340: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var BindGroup = __webpack_require__(85156); var Texture = __webpack_require__(73782); var maxRecommendedTextures = __webpack_require__(6899); "use strict"; var cachedGroups = {}; function getTextureBatchBindGroup(textures, size) { var uid = 2166136261; for (var i = 0; i < size; i++) { uid ^= textures[i].uid; uid = Math.imul(uid, 16777619); uid >>>= 0; } return cachedGroups[uid] || generateTextureBatchBindGroup(textures, size, uid); } var maxTextures = 0; function generateTextureBatchBindGroup(textures, size, key) { var bindGroupResources = {}; var bindIndex = 0; if (!maxTextures) maxTextures = maxRecommendedTextures.getMaxTexturesPerBatch(); for (var i = 0; i < maxTextures; i++) { var texture = i < size ? textures[i] : Texture.Texture.EMPTY.source; bindGroupResources[bindIndex++] = texture.source; bindGroupResources[bindIndex++] = texture.style; } var bindGroup = new BindGroup.BindGroup(bindGroupResources); cachedGroups[key] = bindGroup; return bindGroup; } exports.getTextureBatchBindGroup = getTextureBatchBindGroup; /***/ }), /***/ 62461: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var getGlobalBounds = __webpack_require__(27182); var matrixAndBoundsPool = __webpack_require__(22727); var multiplyColors = __webpack_require__(79904); "use strict"; function bgr2rgb(color) { return ((color & 255) << 16) + (color & 65280) + (color >> 16 & 255); } var getGlobalMixin = { /** * Returns the global (compound) alpha of the container within the scene. * @param skipUpdate - Performance optimization flag: * - If false (default): Recalculates the entire alpha chain through parents for accuracy * - If true: Uses cached worldAlpha from the last render pass for better performance * @returns The resulting alpha value (between 0 and 1) * @example * // Accurate but slower - recalculates entire alpha chain * const preciseAlpha = container.getGlobalAlpha(); * * // Faster but may be outdated - uses cached alpha * const cachedAlpha = container.getGlobalAlpha(true); */ getGlobalAlpha: function getGlobalAlpha(skipUpdate) { if (skipUpdate) { if (this.renderGroup) { return this.renderGroup.worldAlpha; } if (this.parentRenderGroup) { return this.parentRenderGroup.worldAlpha * this.alpha; } return this.alpha; } var alpha = this.alpha; var current = this.parent; while (current) { alpha *= current.alpha; current = current.parent; } return alpha; }, /** * Returns the global transform matrix of the container within the scene. * @param matrix - Optional matrix to store the result. If not provided, a new Matrix will be created. * @param skipUpdate - Performance optimization flag: * - If false (default): Recalculates the entire transform chain for accuracy * - If true: Uses cached worldTransform from the last render pass for better performance * @returns The resulting transformation matrix (either the input matrix or a new one) * @example * // Accurate but slower - recalculates entire transform chain * const preciseTransform = container.getGlobalTransform(); * * // Faster but may be outdated - uses cached transform * const cachedTransform = container.getGlobalTransform(undefined, true); * * // Reuse existing matrix * const existingMatrix = new Matrix(); * container.getGlobalTransform(existingMatrix); */ getGlobalTransform: function getGlobalTransform(matrix, skipUpdate) { if (skipUpdate) { return matrix.copyFrom(this.worldTransform); } this.updateLocalTransform(); var parentTransform = getGlobalBounds.updateTransformBackwards(this, matrixAndBoundsPool.matrixPool.get().identity()); matrix.appendFrom(this.localTransform, parentTransform); matrixAndBoundsPool.matrixPool["return"](parentTransform); return matrix; }, /** * Returns the global (compound) tint color of the container within the scene. * @param skipUpdate - Performance optimization flag: * - If false (default): Recalculates the entire tint chain through parents for accuracy * - If true: Uses cached worldColor from the last render pass for better performance * @returns The resulting tint color as a 24-bit RGB number (0xRRGGBB) * @example * // Accurate but slower - recalculates entire tint chain * const preciseTint = container.getGlobalTint(); * * // Faster but may be outdated - uses cached tint * const cachedTint = container.getGlobalTint(true); */ getGlobalTint: function getGlobalTint(skipUpdate) { if (skipUpdate) { if (this.renderGroup) { return bgr2rgb(this.renderGroup.worldColor); } if (this.parentRenderGroup) { return bgr2rgb(multiplyColors.multiplyColors(this.localColor, this.parentRenderGroup.worldColor)); } return this.tint; } var color = this.localColor; var parent = this.parent; while (parent) { color = multiplyColors.multiplyColors(color, parent.localColor); parent = parent.parent; } return bgr2rgb(color); } }; exports.bgr2rgb = bgr2rgb; exports.getGlobalMixin = getGlobalMixin; /***/ }), /***/ 62881: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var uid = __webpack_require__(90844); var deprecation = __webpack_require__(11225); "use strict"; var idHash = /* @__PURE__ */Object.create(null); function createResourceIdFromString(value) { var id = idHash[value]; if (id === void 0) { idHash[value] = uid.uid("resource"); } return id; } var _TextureStyle = /*#__PURE__*/function (_EventEmitter) { /** * @param options - options for the style */ function _TextureStyle() { var _options$addressModeU, _options$addressModeV, _options$addressModeW, _options$magFilter, _options$minFilter, _options$mipmapFilter, _options$maxAnisotrop; var _this; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; _classCallCheck(this, _TextureStyle); _this = _callSuper(this, _TextureStyle); _this._resourceType = "textureSampler"; _this._touched = 0; /** * Specifies the maximum anisotropy value clamp used by the sampler. * Note: Most implementations support {@link GPUSamplerDescriptor#maxAnisotropy} values in range * between 1 and 16, inclusive. The used value of {@link GPUSamplerDescriptor#maxAnisotropy} will * be clamped to the maximum value that the platform supports. * @internal * @ignore */ _this._maxAnisotropy = 1; /** * Has the style been destroyed? * @readonly */ _this.destroyed = false; options = _objectSpread(_objectSpread({}, _TextureStyle.defaultOptions), options); _this.addressMode = options.addressMode; _this.addressModeU = (_options$addressModeU = options.addressModeU) !== null && _options$addressModeU !== void 0 ? _options$addressModeU : _this.addressModeU; _this.addressModeV = (_options$addressModeV = options.addressModeV) !== null && _options$addressModeV !== void 0 ? _options$addressModeV : _this.addressModeV; _this.addressModeW = (_options$addressModeW = options.addressModeW) !== null && _options$addressModeW !== void 0 ? _options$addressModeW : _this.addressModeW; _this.scaleMode = options.scaleMode; _this.magFilter = (_options$magFilter = options.magFilter) !== null && _options$magFilter !== void 0 ? _options$magFilter : _this.magFilter; _this.minFilter = (_options$minFilter = options.minFilter) !== null && _options$minFilter !== void 0 ? _options$minFilter : _this.minFilter; _this.mipmapFilter = (_options$mipmapFilter = options.mipmapFilter) !== null && _options$mipmapFilter !== void 0 ? _options$mipmapFilter : _this.mipmapFilter; _this.lodMinClamp = options.lodMinClamp; _this.lodMaxClamp = options.lodMaxClamp; _this.compare = options.compare; _this.maxAnisotropy = (_options$maxAnisotrop = options.maxAnisotropy) !== null && _options$maxAnisotrop !== void 0 ? _options$maxAnisotrop : 1; return _this; } _inherits(_TextureStyle, _EventEmitter); return _createClass(_TextureStyle, [{ key: "addressMode", get: /** setting this will set wrapModeU,wrapModeV and wrapModeW all at once! */ function get() { return this.addressModeU; }, set: function set(value) { this.addressModeU = value; this.addressModeV = value; this.addressModeW = value; } }, { key: "wrapMode", get: function get() { return this.addressMode; }, set: function set(value) { deprecation.deprecation(deprecation.v8_0_0, "TextureStyle.wrapMode is now TextureStyle.addressMode"); this.addressMode = value; } }, { key: "scaleMode", get: /** setting this will set magFilter,minFilter and mipmapFilter all at once! */ function get() { return this.magFilter; } /** Specifies the maximum anisotropy value clamp used by the sampler. */, set: function set(value) { this.magFilter = value; this.minFilter = value; this.mipmapFilter = value; } }, { key: "maxAnisotropy", get: function get() { return this._maxAnisotropy; } // TODO - move this to WebGL? , set: function set(value) { this._maxAnisotropy = Math.min(value, 16); if (this._maxAnisotropy > 1) { this.scaleMode = "linear"; } } }, { key: "_resourceId", get: function get() { return this._sharedResourceId || this._generateResourceId(); } }, { key: "update", value: function update() { this.emit("change", this); this._sharedResourceId = null; } }, { key: "_generateResourceId", value: function _generateResourceId() { var bigKey = "".concat(this.addressModeU, "-").concat(this.addressModeV, "-").concat(this.addressModeW, "-").concat(this.magFilter, "-").concat(this.minFilter, "-").concat(this.mipmapFilter, "-").concat(this.lodMinClamp, "-").concat(this.lodMaxClamp, "-").concat(this.compare, "-").concat(this._maxAnisotropy); this._sharedResourceId = createResourceIdFromString(bigKey); return this._resourceId; } /** Destroys the style */ }, { key: "destroy", value: function destroy() { this.destroyed = true; this.emit("destroy", this); this.emit("change", this); this.removeAllListeners(); } }]); }(EventEmitter); /** default options for the style */ _TextureStyle.defaultOptions = { addressMode: "clamp-to-edge", scaleMode: "linear" }; var TextureStyle = _TextureStyle; exports.TextureStyle = TextureStyle; /***/ }), /***/ 62997: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var Texture = __webpack_require__(73782); "use strict"; var cacheTextureArray = { extension: { type: Extensions.ExtensionType.CacheParser, name: "cacheTextureArray" }, test: function test(asset) { return Array.isArray(asset) && asset.every(function (t) { return t instanceof Texture.Texture; }); }, getCacheableAssets: function getCacheableAssets(keys, asset) { var out = {}; keys.forEach(function (key) { asset.forEach(function (item, i) { out[key + (i === 0 ? "" : i + 1)] = item; }); }); return out; } }; exports.cacheTextureArray = cacheTextureArray; /***/ }), /***/ 63147: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = getFunctionName; /** * * @param {Function} func */ function getFunctionName(func) { var ret = func.toString(); ret = ret.substr('function '.length); ret = ret.substr(0, ret.indexOf('(')); return ret; } /***/ }), /***/ 63174: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var freeze = (__webpack_require__(86621).freeze); /** * The entities that are predefined in every XML document. * * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1 * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0 * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia */ exports.XML_ENTITIES = freeze({ amp: '&', apos: "'", gt: '>', lt: '<', quot: '"' }); /** * A map of all entities that are detected in an HTML document. * They contain all entries from `XML_ENTITIES`. * * @see XML_ENTITIES * @see DOMParser.parseFromString * @see DOMImplementation.prototype.createHTMLDocument * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec * @see https://html.spec.whatwg.org/entities.json JSON * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML) * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML) */ exports.HTML_ENTITIES = freeze({ Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\uD835\uDD04", afr: "\uD835\uDD1E", Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\u2A3F", AMP: "&", amp: "&", And: "\u2A53", and: "\u2227", andand: "\u2A55", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220", ange: "\u29A4", angle: "\u2220", angmsd: "\u2221", angmsdaa: "\u29A8", angmsdab: "\u29A9", angmsdac: "\u29AA", angmsdad: "\u29AB", angmsdae: "\u29AC", angmsdaf: "\u29AD", angmsdag: "\u29AE", angmsdah: "\u29AF", angrt: "\u221F", angrtvb: "\u22BE", angrtvbd: "\u299D", angsph: "\u2222", angst: "\xC5", angzarr: "\u237C", Aogon: "\u0104", aogon: "\u0105", Aopf: "\uD835\uDD38", aopf: "\uD835\uDD52", ap: "\u2248", apacir: "\u2A6F", apE: "\u2A70", ape: "\u224A", apid: "\u224B", apos: "'", ApplyFunction: "\u2061", approx: "\u2248", approxeq: "\u224A", Aring: "\xC5", aring: "\xE5", Ascr: "\uD835\uDC9C", ascr: "\uD835\uDCB6", Assign: "\u2254", ast: "*", asymp: "\u2248", asympeq: "\u224D", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", awconint: "\u2233", awint: "\u2A11", backcong: "\u224C", backepsilon: "\u03F6", backprime: "\u2035", backsim: "\u223D", backsimeq: "\u22CD", Backslash: "\u2216", Barv: "\u2AE7", barvee: "\u22BD", Barwed: "\u2306", barwed: "\u2305", barwedge: "\u2305", bbrk: "\u23B5", bbrktbrk: "\u23B6", bcong: "\u224C", Bcy: "\u0411", bcy: "\u0431", bdquo: "\u201E", becaus: "\u2235", Because: "\u2235", because: "\u2235", bemptyv: "\u29B0", bepsi: "\u03F6", bernou: "\u212C", Bernoullis: "\u212C", Beta: "\u0392", beta: "\u03B2", beth: "\u2136", between: "\u226C", Bfr: "\uD835\uDD05", bfr: "\uD835\uDD1F", bigcap: "\u22C2", bigcirc: "\u25EF", bigcup: "\u22C3", bigodot: "\u2A00", bigoplus: "\u2A01", bigotimes: "\u2A02", bigsqcup: "\u2A06", bigstar: "\u2605", bigtriangledown: "\u25BD", bigtriangleup: "\u25B3", biguplus: "\u2A04", bigvee: "\u22C1", bigwedge: "\u22C0", bkarow: "\u290D", blacklozenge: "\u29EB", blacksquare: "\u25AA", blacktriangle: "\u25B4", blacktriangledown: "\u25BE", blacktriangleleft: "\u25C2", blacktriangleright: "\u25B8", blank: "\u2423", blk12: "\u2592", blk14: "\u2591", blk34: "\u2593", block: "\u2588", bne: "=\u20E5", bnequiv: "\u2261\u20E5", bNot: "\u2AED", bnot: "\u2310", Bopf: "\uD835\uDD39", bopf: "\uD835\uDD53", bot: "\u22A5", bottom: "\u22A5", bowtie: "\u22C8", boxbox: "\u29C9", boxDL: "\u2557", boxDl: "\u2556", boxdL: "\u2555", boxdl: "\u2510", boxDR: "\u2554", boxDr: "\u2553", boxdR: "\u2552", boxdr: "\u250C", boxH: "\u2550", boxh: "\u2500", boxHD: "\u2566", boxHd: "\u2564", boxhD: "\u2565", boxhd: "\u252C", boxHU: "\u2569", boxHu: "\u2567", boxhU: "\u2568", boxhu: "\u2534", boxminus: "\u229F", boxplus: "\u229E", boxtimes: "\u22A0", boxUL: "\u255D", boxUl: "\u255C", boxuL: "\u255B", boxul: "\u2518", boxUR: "\u255A", boxUr: "\u2559", boxuR: "\u2558", boxur: "\u2514", boxV: "\u2551", boxv: "\u2502", boxVH: "\u256C", boxVh: "\u256B", boxvH: "\u256A", boxvh: "\u253C", boxVL: "\u2563", boxVl: "\u2562", boxvL: "\u2561", boxvl: "\u2524", boxVR: "\u2560", boxVr: "\u255F", boxvR: "\u255E", boxvr: "\u251C", bprime: "\u2035", Breve: "\u02D8", breve: "\u02D8", brvbar: "\xA6", Bscr: "\u212C", bscr: "\uD835\uDCB7", bsemi: "\u204F", bsim: "\u223D", bsime: "\u22CD", bsol: "\\", bsolb: "\u29C5", bsolhsub: "\u27C8", bull: "\u2022", bullet: "\u2022", bump: "\u224E", bumpE: "\u2AAE", bumpe: "\u224F", Bumpeq: "\u224E", bumpeq: "\u224F", Cacute: "\u0106", cacute: "\u0107", Cap: "\u22D2", cap: "\u2229", capand: "\u2A44", capbrcup: "\u2A49", capcap: "\u2A4B", capcup: "\u2A47", capdot: "\u2A40", CapitalDifferentialD: "\u2145", caps: "\u2229\uFE00", caret: "\u2041", caron: "\u02C7", Cayleys: "\u212D", ccaps: "\u2A4D", Ccaron: "\u010C", ccaron: "\u010D", Ccedil: "\xC7", ccedil: "\xE7", Ccirc: "\u0108", ccirc: "\u0109", Cconint: "\u2230", ccups: "\u2A4C", ccupssm: "\u2A50", Cdot: "\u010A", cdot: "\u010B", cedil: "\xB8", Cedilla: "\xB8", cemptyv: "\u29B2", cent: "\xA2", CenterDot: "\xB7", centerdot: "\xB7", Cfr: "\u212D", cfr: "\uD835\uDD20", CHcy: "\u0427", chcy: "\u0447", check: "\u2713", checkmark: "\u2713", Chi: "\u03A7", chi: "\u03C7", cir: "\u25CB", circ: "\u02C6", circeq: "\u2257", circlearrowleft: "\u21BA", circlearrowright: "\u21BB", circledast: "\u229B", circledcirc: "\u229A", circleddash: "\u229D", CircleDot: "\u2299", circledR: "\xAE", circledS: "\u24C8", CircleMinus: "\u2296", CirclePlus: "\u2295", CircleTimes: "\u2297", cirE: "\u29C3", cire: "\u2257", cirfnint: "\u2A10", cirmid: "\u2AEF", cirscir: "\u29C2", ClockwiseContourIntegral: "\u2232", CloseCurlyDoubleQuote: "\u201D", CloseCurlyQuote: "\u2019", clubs: "\u2663", clubsuit: "\u2663", Colon: "\u2237", colon: ":", Colone: "\u2A74", colone: "\u2254", coloneq: "\u2254", comma: ",", commat: "@", comp: "\u2201", compfn: "\u2218", complement: "\u2201", complexes: "\u2102", cong: "\u2245", congdot: "\u2A6D", Congruent: "\u2261", Conint: "\u222F", conint: "\u222E", ContourIntegral: "\u222E", Copf: "\u2102", copf: "\uD835\uDD54", coprod: "\u2210", Coproduct: "\u2210", COPY: "\xA9", copy: "\xA9", copysr: "\u2117", CounterClockwiseContourIntegral: "\u2233", crarr: "\u21B5", Cross: "\u2A2F", cross: "\u2717", Cscr: "\uD835\uDC9E", cscr: "\uD835\uDCB8", csub: "\u2ACF", csube: "\u2AD1", csup: "\u2AD0", csupe: "\u2AD2", ctdot: "\u22EF", cudarrl: "\u2938", cudarrr: "\u2935", cuepr: "\u22DE", cuesc: "\u22DF", cularr: "\u21B6", cularrp: "\u293D", Cup: "\u22D3", cup: "\u222A", cupbrcap: "\u2A48", CupCap: "\u224D", cupcap: "\u2A46", cupcup: "\u2A4A", cupdot: "\u228D", cupor: "\u2A45", cups: "\u222A\uFE00", curarr: "\u21B7", curarrm: "\u293C", curlyeqprec: "\u22DE", curlyeqsucc: "\u22DF", curlyvee: "\u22CE", curlywedge: "\u22CF", curren: "\xA4", curvearrowleft: "\u21B6", curvearrowright: "\u21B7", cuvee: "\u22CE", cuwed: "\u22CF", cwconint: "\u2232", cwint: "\u2231", cylcty: "\u232D", Dagger: "\u2021", dagger: "\u2020", daleth: "\u2138", Darr: "\u21A1", dArr: "\u21D3", darr: "\u2193", dash: "\u2010", Dashv: "\u2AE4", dashv: "\u22A3", dbkarow: "\u290F", dblac: "\u02DD", Dcaron: "\u010E", dcaron: "\u010F", Dcy: "\u0414", dcy: "\u0434", DD: "\u2145", dd: "\u2146", ddagger: "\u2021", ddarr: "\u21CA", DDotrahd: "\u2911", ddotseq: "\u2A77", deg: "\xB0", Del: "\u2207", Delta: "\u0394", delta: "\u03B4", demptyv: "\u29B1", dfisht: "\u297F", Dfr: "\uD835\uDD07", dfr: "\uD835\uDD21", dHar: "\u2965", dharl: "\u21C3", dharr: "\u21C2", DiacriticalAcute: "\xB4", DiacriticalDot: "\u02D9", DiacriticalDoubleAcute: "\u02DD", DiacriticalGrave: "`", DiacriticalTilde: "\u02DC", diam: "\u22C4", Diamond: "\u22C4", diamond: "\u22C4", diamondsuit: "\u2666", diams: "\u2666", die: "\xA8", DifferentialD: "\u2146", digamma: "\u03DD", disin: "\u22F2", div: "\xF7", divide: "\xF7", divideontimes: "\u22C7", divonx: "\u22C7", DJcy: "\u0402", djcy: "\u0452", dlcorn: "\u231E", dlcrop: "\u230D", dollar: "$", Dopf: "\uD835\uDD3B", dopf: "\uD835\uDD55", Dot: "\xA8", dot: "\u02D9", DotDot: "\u20DC", doteq: "\u2250", doteqdot: "\u2251", DotEqual: "\u2250", dotminus: "\u2238", dotplus: "\u2214", dotsquare: "\u22A1", doublebarwedge: "\u2306", DoubleContourIntegral: "\u222F", DoubleDot: "\xA8", DoubleDownArrow: "\u21D3", DoubleLeftArrow: "\u21D0", DoubleLeftRightArrow: "\u21D4", DoubleLeftTee: "\u2AE4", DoubleLongLeftArrow: "\u27F8", DoubleLongLeftRightArrow: "\u27FA", DoubleLongRightArrow: "\u27F9", DoubleRightArrow: "\u21D2", DoubleRightTee: "\u22A8", DoubleUpArrow: "\u21D1", DoubleUpDownArrow: "\u21D5", DoubleVerticalBar: "\u2225", DownArrow: "\u2193", Downarrow: "\u21D3", downarrow: "\u2193", DownArrowBar: "\u2913", DownArrowUpArrow: "\u21F5", DownBreve: "\u0311", downdownarrows: "\u21CA", downharpoonleft: "\u21C3", downharpoonright: "\u21C2", DownLeftRightVector: "\u2950", DownLeftTeeVector: "\u295E", DownLeftVector: "\u21BD", DownLeftVectorBar: "\u2956", DownRightTeeVector: "\u295F", DownRightVector: "\u21C1", DownRightVectorBar: "\u2957", DownTee: "\u22A4", DownTeeArrow: "\u21A7", drbkarow: "\u2910", drcorn: "\u231F", drcrop: "\u230C", Dscr: "\uD835\uDC9F", dscr: "\uD835\uDCB9", DScy: "\u0405", dscy: "\u0455", dsol: "\u29F6", Dstrok: "\u0110", dstrok: "\u0111", dtdot: "\u22F1", dtri: "\u25BF", dtrif: "\u25BE", duarr: "\u21F5", duhar: "\u296F", dwangle: "\u29A6", DZcy: "\u040F", dzcy: "\u045F", dzigrarr: "\u27FF", Eacute: "\xC9", eacute: "\xE9", easter: "\u2A6E", Ecaron: "\u011A", ecaron: "\u011B", ecir: "\u2256", Ecirc: "\xCA", ecirc: "\xEA", ecolon: "\u2255", Ecy: "\u042D", ecy: "\u044D", eDDot: "\u2A77", Edot: "\u0116", eDot: "\u2251", edot: "\u0117", ee: "\u2147", efDot: "\u2252", Efr: "\uD835\uDD08", efr: "\uD835\uDD22", eg: "\u2A9A", Egrave: "\xC8", egrave: "\xE8", egs: "\u2A96", egsdot: "\u2A98", el: "\u2A99", Element: "\u2208", elinters: "\u23E7", ell: "\u2113", els: "\u2A95", elsdot: "\u2A97", Emacr: "\u0112", emacr: "\u0113", empty: "\u2205", emptyset: "\u2205", EmptySmallSquare: "\u25FB", emptyv: "\u2205", EmptyVerySmallSquare: "\u25AB", emsp: "\u2003", emsp13: "\u2004", emsp14: "\u2005", ENG: "\u014A", eng: "\u014B", ensp: "\u2002", Eogon: "\u0118", eogon: "\u0119", Eopf: "\uD835\uDD3C", eopf: "\uD835\uDD56", epar: "\u22D5", eparsl: "\u29E3", eplus: "\u2A71", epsi: "\u03B5", Epsilon: "\u0395", epsilon: "\u03B5", epsiv: "\u03F5", eqcirc: "\u2256", eqcolon: "\u2255", eqsim: "\u2242", eqslantgtr: "\u2A96", eqslantless: "\u2A95", Equal: "\u2A75", equals: "=", EqualTilde: "\u2242", equest: "\u225F", Equilibrium: "\u21CC", equiv: "\u2261", equivDD: "\u2A78", eqvparsl: "\u29E5", erarr: "\u2971", erDot: "\u2253", Escr: "\u2130", escr: "\u212F", esdot: "\u2250", Esim: "\u2A73", esim: "\u2242", Eta: "\u0397", eta: "\u03B7", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", euro: "\u20AC", excl: "!", exist: "\u2203", Exists: "\u2203", expectation: "\u2130", ExponentialE: "\u2147", exponentiale: "\u2147", fallingdotseq: "\u2252", Fcy: "\u0424", fcy: "\u0444", female: "\u2640", ffilig: "\uFB03", fflig: "\uFB00", ffllig: "\uFB04", Ffr: "\uD835\uDD09", ffr: "\uD835\uDD23", filig: "\uFB01", FilledSmallSquare: "\u25FC", FilledVerySmallSquare: "\u25AA", fjlig: "fj", flat: "\u266D", fllig: "\uFB02", fltns: "\u25B1", fnof: "\u0192", Fopf: "\uD835\uDD3D", fopf: "\uD835\uDD57", ForAll: "\u2200", forall: "\u2200", fork: "\u22D4", forkv: "\u2AD9", Fouriertrf: "\u2131", fpartint: "\u2A0D", frac12: "\xBD", frac13: "\u2153", frac14: "\xBC", frac15: "\u2155", frac16: "\u2159", frac18: "\u215B", frac23: "\u2154", frac25: "\u2156", frac34: "\xBE", frac35: "\u2157", frac38: "\u215C", frac45: "\u2158", frac56: "\u215A", frac58: "\u215D", frac78: "\u215E", frasl: "\u2044", frown: "\u2322", Fscr: "\u2131", fscr: "\uD835\uDCBB", gacute: "\u01F5", Gamma: "\u0393", gamma: "\u03B3", Gammad: "\u03DC", gammad: "\u03DD", gap: "\u2A86", Gbreve: "\u011E", gbreve: "\u011F", Gcedil: "\u0122", Gcirc: "\u011C", gcirc: "\u011D", Gcy: "\u0413", gcy: "\u0433", Gdot: "\u0120", gdot: "\u0121", gE: "\u2267", ge: "\u2265", gEl: "\u2A8C", gel: "\u22DB", geq: "\u2265", geqq: "\u2267", geqslant: "\u2A7E", ges: "\u2A7E", gescc: "\u2AA9", gesdot: "\u2A80", gesdoto: "\u2A82", gesdotol: "\u2A84", gesl: "\u22DB\uFE00", gesles: "\u2A94", Gfr: "\uD835\uDD0A", gfr: "\uD835\uDD24", Gg: "\u22D9", gg: "\u226B", ggg: "\u22D9", gimel: "\u2137", GJcy: "\u0403", gjcy: "\u0453", gl: "\u2277", gla: "\u2AA5", glE: "\u2A92", glj: "\u2AA4", gnap: "\u2A8A", gnapprox: "\u2A8A", gnE: "\u2269", gne: "\u2A88", gneq: "\u2A88", gneqq: "\u2269", gnsim: "\u22E7", Gopf: "\uD835\uDD3E", gopf: "\uD835\uDD58", grave: "`", GreaterEqual: "\u2265", GreaterEqualLess: "\u22DB", GreaterFullEqual: "\u2267", GreaterGreater: "\u2AA2", GreaterLess: "\u2277", GreaterSlantEqual: "\u2A7E", GreaterTilde: "\u2273", Gscr: "\uD835\uDCA2", gscr: "\u210A", gsim: "\u2273", gsime: "\u2A8E", gsiml: "\u2A90", Gt: "\u226B", GT: ">", gt: ">", gtcc: "\u2AA7", gtcir: "\u2A7A", gtdot: "\u22D7", gtlPar: "\u2995", gtquest: "\u2A7C", gtrapprox: "\u2A86", gtrarr: "\u2978", gtrdot: "\u22D7", gtreqless: "\u22DB", gtreqqless: "\u2A8C", gtrless: "\u2277", gtrsim: "\u2273", gvertneqq: "\u2269\uFE00", gvnE: "\u2269\uFE00", Hacek: "\u02C7", hairsp: "\u200A", half: "\xBD", hamilt: "\u210B", HARDcy: "\u042A", hardcy: "\u044A", hArr: "\u21D4", harr: "\u2194", harrcir: "\u2948", harrw: "\u21AD", Hat: "^", hbar: "\u210F", Hcirc: "\u0124", hcirc: "\u0125", hearts: "\u2665", heartsuit: "\u2665", hellip: "\u2026", hercon: "\u22B9", Hfr: "\u210C", hfr: "\uD835\uDD25", HilbertSpace: "\u210B", hksearow: "\u2925", hkswarow: "\u2926", hoarr: "\u21FF", homtht: "\u223B", hookleftarrow: "\u21A9", hookrightarrow: "\u21AA", Hopf: "\u210D", hopf: "\uD835\uDD59", horbar: "\u2015", HorizontalLine: "\u2500", Hscr: "\u210B", hscr: "\uD835\uDCBD", hslash: "\u210F", Hstrok: "\u0126", hstrok: "\u0127", HumpDownHump: "\u224E", HumpEqual: "\u224F", hybull: "\u2043", hyphen: "\u2010", Iacute: "\xCD", iacute: "\xED", ic: "\u2063", Icirc: "\xCE", icirc: "\xEE", Icy: "\u0418", icy: "\u0438", Idot: "\u0130", IEcy: "\u0415", iecy: "\u0435", iexcl: "\xA1", iff: "\u21D4", Ifr: "\u2111", ifr: "\uD835\uDD26", Igrave: "\xCC", igrave: "\xEC", ii: "\u2148", iiiint: "\u2A0C", iiint: "\u222D", iinfin: "\u29DC", iiota: "\u2129", IJlig: "\u0132", ijlig: "\u0133", Im: "\u2111", Imacr: "\u012A", imacr: "\u012B", image: "\u2111", ImaginaryI: "\u2148", imagline: "\u2110", imagpart: "\u2111", imath: "\u0131", imof: "\u22B7", imped: "\u01B5", Implies: "\u21D2", "in": "\u2208", incare: "\u2105", infin: "\u221E", infintie: "\u29DD", inodot: "\u0131", Int: "\u222C", "int": "\u222B", intcal: "\u22BA", integers: "\u2124", Integral: "\u222B", intercal: "\u22BA", Intersection: "\u22C2", intlarhk: "\u2A17", intprod: "\u2A3C", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "\u0401", iocy: "\u0451", Iogon: "\u012E", iogon: "\u012F", Iopf: "\uD835\uDD40", iopf: "\uD835\uDD5A", Iota: "\u0399", iota: "\u03B9", iprod: "\u2A3C", iquest: "\xBF", Iscr: "\u2110", iscr: "\uD835\uDCBE", isin: "\u2208", isindot: "\u22F5", isinE: "\u22F9", isins: "\u22F4", isinsv: "\u22F3", isinv: "\u2208", it: "\u2062", Itilde: "\u0128", itilde: "\u0129", Iukcy: "\u0406", iukcy: "\u0456", Iuml: "\xCF", iuml: "\xEF", Jcirc: "\u0134", jcirc: "\u0135", Jcy: "\u0419", jcy: "\u0439", Jfr: "\uD835\uDD0D", jfr: "\uD835\uDD27", jmath: "\u0237", Jopf: "\uD835\uDD41", jopf: "\uD835\uDD5B", Jscr: "\uD835\uDCA5", jscr: "\uD835\uDCBF", Jsercy: "\u0408", jsercy: "\u0458", Jukcy: "\u0404", jukcy: "\u0454", Kappa: "\u039A", kappa: "\u03BA", kappav: "\u03F0", Kcedil: "\u0136", kcedil: "\u0137", Kcy: "\u041A", kcy: "\u043A", Kfr: "\uD835\uDD0E", kfr: "\uD835\uDD28", kgreen: "\u0138", KHcy: "\u0425", khcy: "\u0445", KJcy: "\u040C", kjcy: "\u045C", Kopf: "\uD835\uDD42", kopf: "\uD835\uDD5C", Kscr: "\uD835\uDCA6", kscr: "\uD835\uDCC0", lAarr: "\u21DA", Lacute: "\u0139", lacute: "\u013A", laemptyv: "\u29B4", lagran: "\u2112", Lambda: "\u039B", lambda: "\u03BB", Lang: "\u27EA", lang: "\u27E8", langd: "\u2991", langle: "\u27E8", lap: "\u2A85", Laplacetrf: "\u2112", laquo: "\xAB", Larr: "\u219E", lArr: "\u21D0", larr: "\u2190", larrb: "\u21E4", larrbfs: "\u291F", larrfs: "\u291D", larrhk: "\u21A9", larrlp: "\u21AB", larrpl: "\u2939", larrsim: "\u2973", larrtl: "\u21A2", lat: "\u2AAB", lAtail: "\u291B", latail: "\u2919", late: "\u2AAD", lates: "\u2AAD\uFE00", lBarr: "\u290E", lbarr: "\u290C", lbbrk: "\u2772", lbrace: "{", lbrack: "[", lbrke: "\u298B", lbrksld: "\u298F", lbrkslu: "\u298D", Lcaron: "\u013D", lcaron: "\u013E", Lcedil: "\u013B", lcedil: "\u013C", lceil: "\u2308", lcub: "{", Lcy: "\u041B", lcy: "\u043B", ldca: "\u2936", ldquo: "\u201C", ldquor: "\u201E", ldrdhar: "\u2967", ldrushar: "\u294B", ldsh: "\u21B2", lE: "\u2266", le: "\u2264", LeftAngleBracket: "\u27E8", LeftArrow: "\u2190", Leftarrow: "\u21D0", leftarrow: "\u2190", LeftArrowBar: "\u21E4", LeftArrowRightArrow: "\u21C6", leftarrowtail: "\u21A2", LeftCeiling: "\u2308", LeftDoubleBracket: "\u27E6", LeftDownTeeVector: "\u2961", LeftDownVector: "\u21C3", LeftDownVectorBar: "\u2959", LeftFloor: "\u230A", leftharpoondown: "\u21BD", leftharpoonup: "\u21BC", leftleftarrows: "\u21C7", LeftRightArrow: "\u2194", Leftrightarrow: "\u21D4", leftrightarrow: "\u2194", leftrightarrows: "\u21C6", leftrightharpoons: "\u21CB", leftrightsquigarrow: "\u21AD", LeftRightVector: "\u294E", LeftTee: "\u22A3", LeftTeeArrow: "\u21A4", LeftTeeVector: "\u295A", leftthreetimes: "\u22CB", LeftTriangle: "\u22B2", LeftTriangleBar: "\u29CF", LeftTriangleEqual: "\u22B4", LeftUpDownVector: "\u2951", LeftUpTeeVector: "\u2960", LeftUpVector: "\u21BF", LeftUpVectorBar: "\u2958", LeftVector: "\u21BC", LeftVectorBar: "\u2952", lEg: "\u2A8B", leg: "\u22DA", leq: "\u2264", leqq: "\u2266", leqslant: "\u2A7D", les: "\u2A7D", lescc: "\u2AA8", lesdot: "\u2A7F", lesdoto: "\u2A81", lesdotor: "\u2A83", lesg: "\u22DA\uFE00", lesges: "\u2A93", lessapprox: "\u2A85", lessdot: "\u22D6", lesseqgtr: "\u22DA", lesseqqgtr: "\u2A8B", LessEqualGreater: "\u22DA", LessFullEqual: "\u2266", LessGreater: "\u2276", lessgtr: "\u2276", LessLess: "\u2AA1", lesssim: "\u2272", LessSlantEqual: "\u2A7D", LessTilde: "\u2272", lfisht: "\u297C", lfloor: "\u230A", Lfr: "\uD835\uDD0F", lfr: "\uD835\uDD29", lg: "\u2276", lgE: "\u2A91", lHar: "\u2962", lhard: "\u21BD", lharu: "\u21BC", lharul: "\u296A", lhblk: "\u2584", LJcy: "\u0409", ljcy: "\u0459", Ll: "\u22D8", ll: "\u226A", llarr: "\u21C7", llcorner: "\u231E", Lleftarrow: "\u21DA", llhard: "\u296B", lltri: "\u25FA", Lmidot: "\u013F", lmidot: "\u0140", lmoust: "\u23B0", lmoustache: "\u23B0", lnap: "\u2A89", lnapprox: "\u2A89", lnE: "\u2268", lne: "\u2A87", lneq: "\u2A87", lneqq: "\u2268", lnsim: "\u22E6", loang: "\u27EC", loarr: "\u21FD", lobrk: "\u27E6", LongLeftArrow: "\u27F5", Longleftarrow: "\u27F8", longleftarrow: "\u27F5", LongLeftRightArrow: "\u27F7", Longleftrightarrow: "\u27FA", longleftrightarrow: "\u27F7", longmapsto: "\u27FC", LongRightArrow: "\u27F6", Longrightarrow: "\u27F9", longrightarrow: "\u27F6", looparrowleft: "\u21AB", looparrowright: "\u21AC", lopar: "\u2985", Lopf: "\uD835\uDD43", lopf: "\uD835\uDD5D", loplus: "\u2A2D", lotimes: "\u2A34", lowast: "\u2217", lowbar: "_", LowerLeftArrow: "\u2199", LowerRightArrow: "\u2198", loz: "\u25CA", lozenge: "\u25CA", lozf: "\u29EB", lpar: "(", lparlt: "\u2993", lrarr: "\u21C6", lrcorner: "\u231F", lrhar: "\u21CB", lrhard: "\u296D", lrm: "\u200E", lrtri: "\u22BF", lsaquo: "\u2039", Lscr: "\u2112", lscr: "\uD835\uDCC1", Lsh: "\u21B0", lsh: "\u21B0", lsim: "\u2272", lsime: "\u2A8D", lsimg: "\u2A8F", lsqb: "[", lsquo: "\u2018", lsquor: "\u201A", Lstrok: "\u0141", lstrok: "\u0142", Lt: "\u226A", LT: "<", lt: "<", ltcc: "\u2AA6", ltcir: "\u2A79", ltdot: "\u22D6", lthree: "\u22CB", ltimes: "\u22C9", ltlarr: "\u2976", ltquest: "\u2A7B", ltri: "\u25C3", ltrie: "\u22B4", ltrif: "\u25C2", ltrPar: "\u2996", lurdshar: "\u294A", luruhar: "\u2966", lvertneqq: "\u2268\uFE00", lvnE: "\u2268\uFE00", macr: "\xAF", male: "\u2642", malt: "\u2720", maltese: "\u2720", Map: "\u2905", map: "\u21A6", mapsto: "\u21A6", mapstodown: "\u21A7", mapstoleft: "\u21A4", mapstoup: "\u21A5", marker: "\u25AE", mcomma: "\u2A29", Mcy: "\u041C", mcy: "\u043C", mdash: "\u2014", mDDot: "\u223A", measuredangle: "\u2221", MediumSpace: "\u205F", Mellintrf: "\u2133", Mfr: "\uD835\uDD10", mfr: "\uD835\uDD2A", mho: "\u2127", micro: "\xB5", mid: "\u2223", midast: "*", midcir: "\u2AF0", middot: "\xB7", minus: "\u2212", minusb: "\u229F", minusd: "\u2238", minusdu: "\u2A2A", MinusPlus: "\u2213", mlcp: "\u2ADB", mldr: "\u2026", mnplus: "\u2213", models: "\u22A7", Mopf: "\uD835\uDD44", mopf: "\uD835\uDD5E", mp: "\u2213", Mscr: "\u2133", mscr: "\uD835\uDCC2", mstpos: "\u223E", Mu: "\u039C", mu: "\u03BC", multimap: "\u22B8", mumap: "\u22B8", nabla: "\u2207", Nacute: "\u0143", nacute: "\u0144", nang: "\u2220\u20D2", nap: "\u2249", napE: "\u2A70\u0338", napid: "\u224B\u0338", napos: "\u0149", napprox: "\u2249", natur: "\u266E", natural: "\u266E", naturals: "\u2115", nbsp: "\xA0", nbump: "\u224E\u0338", nbumpe: "\u224F\u0338", ncap: "\u2A43", Ncaron: "\u0147", ncaron: "\u0148", Ncedil: "\u0145", ncedil: "\u0146", ncong: "\u2247", ncongdot: "\u2A6D\u0338", ncup: "\u2A42", Ncy: "\u041D", ncy: "\u043D", ndash: "\u2013", ne: "\u2260", nearhk: "\u2924", neArr: "\u21D7", nearr: "\u2197", nearrow: "\u2197", nedot: "\u2250\u0338", NegativeMediumSpace: "\u200B", NegativeThickSpace: "\u200B", NegativeThinSpace: "\u200B", NegativeVeryThinSpace: "\u200B", nequiv: "\u2262", nesear: "\u2928", nesim: "\u2242\u0338", NestedGreaterGreater: "\u226B", NestedLessLess: "\u226A", NewLine: "\n", nexist: "\u2204", nexists: "\u2204", Nfr: "\uD835\uDD11", nfr: "\uD835\uDD2B", ngE: "\u2267\u0338", nge: "\u2271", ngeq: "\u2271", ngeqq: "\u2267\u0338", ngeqslant: "\u2A7E\u0338", nges: "\u2A7E\u0338", nGg: "\u22D9\u0338", ngsim: "\u2275", nGt: "\u226B\u20D2", ngt: "\u226F", ngtr: "\u226F", nGtv: "\u226B\u0338", nhArr: "\u21CE", nharr: "\u21AE", nhpar: "\u2AF2", ni: "\u220B", nis: "\u22FC", nisd: "\u22FA", niv: "\u220B", NJcy: "\u040A", njcy: "\u045A", nlArr: "\u21CD", nlarr: "\u219A", nldr: "\u2025", nlE: "\u2266\u0338", nle: "\u2270", nLeftarrow: "\u21CD", nleftarrow: "\u219A", nLeftrightarrow: "\u21CE", nleftrightarrow: "\u21AE", nleq: "\u2270", nleqq: "\u2266\u0338", nleqslant: "\u2A7D\u0338", nles: "\u2A7D\u0338", nless: "\u226E", nLl: "\u22D8\u0338", nlsim: "\u2274", nLt: "\u226A\u20D2", nlt: "\u226E", nltri: "\u22EA", nltrie: "\u22EC", nLtv: "\u226A\u0338", nmid: "\u2224", NoBreak: "\u2060", NonBreakingSpace: "\xA0", Nopf: "\u2115", nopf: "\uD835\uDD5F", Not: "\u2AEC", not: "\xAC", NotCongruent: "\u2262", NotCupCap: "\u226D", NotDoubleVerticalBar: "\u2226", NotElement: "\u2209", NotEqual: "\u2260", NotEqualTilde: "\u2242\u0338", NotExists: "\u2204", NotGreater: "\u226F", NotGreaterEqual: "\u2271", NotGreaterFullEqual: "\u2267\u0338", NotGreaterGreater: "\u226B\u0338", NotGreaterLess: "\u2279", NotGreaterSlantEqual: "\u2A7E\u0338", NotGreaterTilde: "\u2275", NotHumpDownHump: "\u224E\u0338", NotHumpEqual: "\u224F\u0338", notin: "\u2209", notindot: "\u22F5\u0338", notinE: "\u22F9\u0338", notinva: "\u2209", notinvb: "\u22F7", notinvc: "\u22F6", NotLeftTriangle: "\u22EA", NotLeftTriangleBar: "\u29CF\u0338", NotLeftTriangleEqual: "\u22EC", NotLess: "\u226E", NotLessEqual: "\u2270", NotLessGreater: "\u2278", NotLessLess: "\u226A\u0338", NotLessSlantEqual: "\u2A7D\u0338", NotLessTilde: "\u2274", NotNestedGreaterGreater: "\u2AA2\u0338", NotNestedLessLess: "\u2AA1\u0338", notni: "\u220C", notniva: "\u220C", notnivb: "\u22FE", notnivc: "\u22FD", NotPrecedes: "\u2280", NotPrecedesEqual: "\u2AAF\u0338", NotPrecedesSlantEqual: "\u22E0", NotReverseElement: "\u220C", NotRightTriangle: "\u22EB", NotRightTriangleBar: "\u29D0\u0338", NotRightTriangleEqual: "\u22ED", NotSquareSubset: "\u228F\u0338", NotSquareSubsetEqual: "\u22E2", NotSquareSuperset: "\u2290\u0338", NotSquareSupersetEqual: "\u22E3", NotSubset: "\u2282\u20D2", NotSubsetEqual: "\u2288", NotSucceeds: "\u2281", NotSucceedsEqual: "\u2AB0\u0338", NotSucceedsSlantEqual: "\u22E1", NotSucceedsTilde: "\u227F\u0338", NotSuperset: "\u2283\u20D2", NotSupersetEqual: "\u2289", NotTilde: "\u2241", NotTildeEqual: "\u2244", NotTildeFullEqual: "\u2247", NotTildeTilde: "\u2249", NotVerticalBar: "\u2224", npar: "\u2226", nparallel: "\u2226", nparsl: "\u2AFD\u20E5", npart: "\u2202\u0338", npolint: "\u2A14", npr: "\u2280", nprcue: "\u22E0", npre: "\u2AAF\u0338", nprec: "\u2280", npreceq: "\u2AAF\u0338", nrArr: "\u21CF", nrarr: "\u219B", nrarrc: "\u2933\u0338", nrarrw: "\u219D\u0338", nRightarrow: "\u21CF", nrightarrow: "\u219B", nrtri: "\u22EB", nrtrie: "\u22ED", nsc: "\u2281", nsccue: "\u22E1", nsce: "\u2AB0\u0338", Nscr: "\uD835\uDCA9", nscr: "\uD835\uDCC3", nshortmid: "\u2224", nshortparallel: "\u2226", nsim: "\u2241", nsime: "\u2244", nsimeq: "\u2244", nsmid: "\u2224", nspar: "\u2226", nsqsube: "\u22E2", nsqsupe: "\u22E3", nsub: "\u2284", nsubE: "\u2AC5\u0338", nsube: "\u2288", nsubset: "\u2282\u20D2", nsubseteq: "\u2288", nsubseteqq: "\u2AC5\u0338", nsucc: "\u2281", nsucceq: "\u2AB0\u0338", nsup: "\u2285", nsupE: "\u2AC6\u0338", nsupe: "\u2289", nsupset: "\u2283\u20D2", nsupseteq: "\u2289", nsupseteqq: "\u2AC6\u0338", ntgl: "\u2279", Ntilde: "\xD1", ntilde: "\xF1", ntlg: "\u2278", ntriangleleft: "\u22EA", ntrianglelefteq: "\u22EC", ntriangleright: "\u22EB", ntrianglerighteq: "\u22ED", Nu: "\u039D", nu: "\u03BD", num: "#", numero: "\u2116", numsp: "\u2007", nvap: "\u224D\u20D2", nVDash: "\u22AF", nVdash: "\u22AE", nvDash: "\u22AD", nvdash: "\u22AC", nvge: "\u2265\u20D2", nvgt: ">\u20D2", nvHarr: "\u2904", nvinfin: "\u29DE", nvlArr: "\u2902", nvle: "\u2264\u20D2", nvlt: "<\u20D2", nvltrie: "\u22B4\u20D2", nvrArr: "\u2903", nvrtrie: "\u22B5\u20D2", nvsim: "\u223C\u20D2", nwarhk: "\u2923", nwArr: "\u21D6", nwarr: "\u2196", nwarrow: "\u2196", nwnear: "\u2927", Oacute: "\xD3", oacute: "\xF3", oast: "\u229B", ocir: "\u229A", Ocirc: "\xD4", ocirc: "\xF4", Ocy: "\u041E", ocy: "\u043E", odash: "\u229D", Odblac: "\u0150", odblac: "\u0151", odiv: "\u2A38", odot: "\u2299", odsold: "\u29BC", OElig: "\u0152", oelig: "\u0153", ofcir: "\u29BF", Ofr: "\uD835\uDD12", ofr: "\uD835\uDD2C", ogon: "\u02DB", Ograve: "\xD2", ograve: "\xF2", ogt: "\u29C1", ohbar: "\u29B5", ohm: "\u03A9", oint: "\u222E", olarr: "\u21BA", olcir: "\u29BE", olcross: "\u29BB", oline: "\u203E", olt: "\u29C0", Omacr: "\u014C", omacr: "\u014D", Omega: "\u03A9", omega: "\u03C9", Omicron: "\u039F", omicron: "\u03BF", omid: "\u29B6", ominus: "\u2296", Oopf: "\uD835\uDD46", oopf: "\uD835\uDD60", opar: "\u29B7", OpenCurlyDoubleQuote: "\u201C", OpenCurlyQuote: "\u2018", operp: "\u29B9", oplus: "\u2295", Or: "\u2A54", or: "\u2228", orarr: "\u21BB", ord: "\u2A5D", order: "\u2134", orderof: "\u2134", ordf: "\xAA", ordm: "\xBA", origof: "\u22B6", oror: "\u2A56", orslope: "\u2A57", orv: "\u2A5B", oS: "\u24C8", Oscr: "\uD835\uDCAA", oscr: "\u2134", Oslash: "\xD8", oslash: "\xF8", osol: "\u2298", Otilde: "\xD5", otilde: "\xF5", Otimes: "\u2A37", otimes: "\u2297", otimesas: "\u2A36", Ouml: "\xD6", ouml: "\xF6", ovbar: "\u233D", OverBar: "\u203E", OverBrace: "\u23DE", OverBracket: "\u23B4", OverParenthesis: "\u23DC", par: "\u2225", para: "\xB6", parallel: "\u2225", parsim: "\u2AF3", parsl: "\u2AFD", part: "\u2202", PartialD: "\u2202", Pcy: "\u041F", pcy: "\u043F", percnt: "%", period: ".", permil: "\u2030", perp: "\u22A5", pertenk: "\u2031", Pfr: "\uD835\uDD13", pfr: "\uD835\uDD2D", Phi: "\u03A6", phi: "\u03C6", phiv: "\u03D5", phmmat: "\u2133", phone: "\u260E", Pi: "\u03A0", pi: "\u03C0", pitchfork: "\u22D4", piv: "\u03D6", planck: "\u210F", planckh: "\u210E", plankv: "\u210F", plus: "+", plusacir: "\u2A23", plusb: "\u229E", pluscir: "\u2A22", plusdo: "\u2214", plusdu: "\u2A25", pluse: "\u2A72", PlusMinus: "\xB1", plusmn: "\xB1", plussim: "\u2A26", plustwo: "\u2A27", pm: "\xB1", Poincareplane: "\u210C", pointint: "\u2A15", Popf: "\u2119", popf: "\uD835\uDD61", pound: "\xA3", Pr: "\u2ABB", pr: "\u227A", prap: "\u2AB7", prcue: "\u227C", prE: "\u2AB3", pre: "\u2AAF", prec: "\u227A", precapprox: "\u2AB7", preccurlyeq: "\u227C", Precedes: "\u227A", PrecedesEqual: "\u2AAF", PrecedesSlantEqual: "\u227C", PrecedesTilde: "\u227E", preceq: "\u2AAF", precnapprox: "\u2AB9", precneqq: "\u2AB5", precnsim: "\u22E8", precsim: "\u227E", Prime: "\u2033", prime: "\u2032", primes: "\u2119", prnap: "\u2AB9", prnE: "\u2AB5", prnsim: "\u22E8", prod: "\u220F", Product: "\u220F", profalar: "\u232E", profline: "\u2312", profsurf: "\u2313", prop: "\u221D", Proportion: "\u2237", Proportional: "\u221D", propto: "\u221D", prsim: "\u227E", prurel: "\u22B0", Pscr: "\uD835\uDCAB", pscr: "\uD835\uDCC5", Psi: "\u03A8", psi: "\u03C8", puncsp: "\u2008", Qfr: "\uD835\uDD14", qfr: "\uD835\uDD2E", qint: "\u2A0C", Qopf: "\u211A", qopf: "\uD835\uDD62", qprime: "\u2057", Qscr: "\uD835\uDCAC", qscr: "\uD835\uDCC6", quaternions: "\u210D", quatint: "\u2A16", quest: "?", questeq: "\u225F", QUOT: "\"", quot: "\"", rAarr: "\u21DB", race: "\u223D\u0331", Racute: "\u0154", racute: "\u0155", radic: "\u221A", raemptyv: "\u29B3", Rang: "\u27EB", rang: "\u27E9", rangd: "\u2992", range: "\u29A5", rangle: "\u27E9", raquo: "\xBB", Rarr: "\u21A0", rArr: "\u21D2", rarr: "\u2192", rarrap: "\u2975", rarrb: "\u21E5", rarrbfs: "\u2920", rarrc: "\u2933", rarrfs: "\u291E", rarrhk: "\u21AA", rarrlp: "\u21AC", rarrpl: "\u2945", rarrsim: "\u2974", Rarrtl: "\u2916", rarrtl: "\u21A3", rarrw: "\u219D", rAtail: "\u291C", ratail: "\u291A", ratio: "\u2236", rationals: "\u211A", RBarr: "\u2910", rBarr: "\u290F", rbarr: "\u290D", rbbrk: "\u2773", rbrace: "}", rbrack: "]", rbrke: "\u298C", rbrksld: "\u298E", rbrkslu: "\u2990", Rcaron: "\u0158", rcaron: "\u0159", Rcedil: "\u0156", rcedil: "\u0157", rceil: "\u2309", rcub: "}", Rcy: "\u0420", rcy: "\u0440", rdca: "\u2937", rdldhar: "\u2969", rdquo: "\u201D", rdquor: "\u201D", rdsh: "\u21B3", Re: "\u211C", real: "\u211C", realine: "\u211B", realpart: "\u211C", reals: "\u211D", rect: "\u25AD", REG: "\xAE", reg: "\xAE", ReverseElement: "\u220B", ReverseEquilibrium: "\u21CB", ReverseUpEquilibrium: "\u296F", rfisht: "\u297D", rfloor: "\u230B", Rfr: "\u211C", rfr: "\uD835\uDD2F", rHar: "\u2964", rhard: "\u21C1", rharu: "\u21C0", rharul: "\u296C", Rho: "\u03A1", rho: "\u03C1", rhov: "\u03F1", RightAngleBracket: "\u27E9", RightArrow: "\u2192", Rightarrow: "\u21D2", rightarrow: "\u2192", RightArrowBar: "\u21E5", RightArrowLeftArrow: "\u21C4", rightarrowtail: "\u21A3", RightCeiling: "\u2309", RightDoubleBracket: "\u27E7", RightDownTeeVector: "\u295D", RightDownVector: "\u21C2", RightDownVectorBar: "\u2955", RightFloor: "\u230B", rightharpoondown: "\u21C1", rightharpoonup: "\u21C0", rightleftarrows: "\u21C4", rightleftharpoons: "\u21CC", rightrightarrows: "\u21C9", rightsquigarrow: "\u219D", RightTee: "\u22A2", RightTeeArrow: "\u21A6", RightTeeVector: "\u295B", rightthreetimes: "\u22CC", RightTriangle: "\u22B3", RightTriangleBar: "\u29D0", RightTriangleEqual: "\u22B5", RightUpDownVector: "\u294F", RightUpTeeVector: "\u295C", RightUpVector: "\u21BE", RightUpVectorBar: "\u2954", RightVector: "\u21C0", RightVectorBar: "\u2953", ring: "\u02DA", risingdotseq: "\u2253", rlarr: "\u21C4", rlhar: "\u21CC", rlm: "\u200F", rmoust: "\u23B1", rmoustache: "\u23B1", rnmid: "\u2AEE", roang: "\u27ED", roarr: "\u21FE", robrk: "\u27E7", ropar: "\u2986", Ropf: "\u211D", ropf: "\uD835\uDD63", roplus: "\u2A2E", rotimes: "\u2A35", RoundImplies: "\u2970", rpar: ")", rpargt: "\u2994", rppolint: "\u2A12", rrarr: "\u21C9", Rrightarrow: "\u21DB", rsaquo: "\u203A", Rscr: "\u211B", rscr: "\uD835\uDCC7", Rsh: "\u21B1", rsh: "\u21B1", rsqb: "]", rsquo: "\u2019", rsquor: "\u2019", rthree: "\u22CC", rtimes: "\u22CA", rtri: "\u25B9", rtrie: "\u22B5", rtrif: "\u25B8", rtriltri: "\u29CE", RuleDelayed: "\u29F4", ruluhar: "\u2968", rx: "\u211E", Sacute: "\u015A", sacute: "\u015B", sbquo: "\u201A", Sc: "\u2ABC", sc: "\u227B", scap: "\u2AB8", Scaron: "\u0160", scaron: "\u0161", sccue: "\u227D", scE: "\u2AB4", sce: "\u2AB0", Scedil: "\u015E", scedil: "\u015F", Scirc: "\u015C", scirc: "\u015D", scnap: "\u2ABA", scnE: "\u2AB6", scnsim: "\u22E9", scpolint: "\u2A13", scsim: "\u227F", Scy: "\u0421", scy: "\u0441", sdot: "\u22C5", sdotb: "\u22A1", sdote: "\u2A66", searhk: "\u2925", seArr: "\u21D8", searr: "\u2198", searrow: "\u2198", sect: "\xA7", semi: ";", seswar: "\u2929", setminus: "\u2216", setmn: "\u2216", sext: "\u2736", Sfr: "\uD835\uDD16", sfr: "\uD835\uDD30", sfrown: "\u2322", sharp: "\u266F", SHCHcy: "\u0429", shchcy: "\u0449", SHcy: "\u0428", shcy: "\u0448", ShortDownArrow: "\u2193", ShortLeftArrow: "\u2190", shortmid: "\u2223", shortparallel: "\u2225", ShortRightArrow: "\u2192", ShortUpArrow: "\u2191", shy: "\xAD", Sigma: "\u03A3", sigma: "\u03C3", sigmaf: "\u03C2", sigmav: "\u03C2", sim: "\u223C", simdot: "\u2A6A", sime: "\u2243", simeq: "\u2243", simg: "\u2A9E", simgE: "\u2AA0", siml: "\u2A9D", simlE: "\u2A9F", simne: "\u2246", simplus: "\u2A24", simrarr: "\u2972", slarr: "\u2190", SmallCircle: "\u2218", smallsetminus: "\u2216", smashp: "\u2A33", smeparsl: "\u29E4", smid: "\u2223", smile: "\u2323", smt: "\u2AAA", smte: "\u2AAC", smtes: "\u2AAC\uFE00", SOFTcy: "\u042C", softcy: "\u044C", sol: "/", solb: "\u29C4", solbar: "\u233F", Sopf: "\uD835\uDD4A", sopf: "\uD835\uDD64", spades: "\u2660", spadesuit: "\u2660", spar: "\u2225", sqcap: "\u2293", sqcaps: "\u2293\uFE00", sqcup: "\u2294", sqcups: "\u2294\uFE00", Sqrt: "\u221A", sqsub: "\u228F", sqsube: "\u2291", sqsubset: "\u228F", sqsubseteq: "\u2291", sqsup: "\u2290", sqsupe: "\u2292", sqsupset: "\u2290", sqsupseteq: "\u2292", squ: "\u25A1", Square: "\u25A1", square: "\u25A1", SquareIntersection: "\u2293", SquareSubset: "\u228F", SquareSubsetEqual: "\u2291", SquareSuperset: "\u2290", SquareSupersetEqual: "\u2292", SquareUnion: "\u2294", squarf: "\u25AA", squf: "\u25AA", srarr: "\u2192", Sscr: "\uD835\uDCAE", sscr: "\uD835\uDCC8", ssetmn: "\u2216", ssmile: "\u2323", sstarf: "\u22C6", Star: "\u22C6", star: "\u2606", starf: "\u2605", straightepsilon: "\u03F5", straightphi: "\u03D5", strns: "\xAF", Sub: "\u22D0", sub: "\u2282", subdot: "\u2ABD", subE: "\u2AC5", sube: "\u2286", subedot: "\u2AC3", submult: "\u2AC1", subnE: "\u2ACB", subne: "\u228A", subplus: "\u2ABF", subrarr: "\u2979", Subset: "\u22D0", subset: "\u2282", subseteq: "\u2286", subseteqq: "\u2AC5", SubsetEqual: "\u2286", subsetneq: "\u228A", subsetneqq: "\u2ACB", subsim: "\u2AC7", subsub: "\u2AD5", subsup: "\u2AD3", succ: "\u227B", succapprox: "\u2AB8", succcurlyeq: "\u227D", Succeeds: "\u227B", SucceedsEqual: "\u2AB0", SucceedsSlantEqual: "\u227D", SucceedsTilde: "\u227F", succeq: "\u2AB0", succnapprox: "\u2ABA", succneqq: "\u2AB6", succnsim: "\u22E9", succsim: "\u227F", SuchThat: "\u220B", Sum: "\u2211", sum: "\u2211", sung: "\u266A", Sup: "\u22D1", sup: "\u2283", sup1: "\xB9", sup2: "\xB2", sup3: "\xB3", supdot: "\u2ABE", supdsub: "\u2AD8", supE: "\u2AC6", supe: "\u2287", supedot: "\u2AC4", Superset: "\u2283", SupersetEqual: "\u2287", suphsol: "\u27C9", suphsub: "\u2AD7", suplarr: "\u297B", supmult: "\u2AC2", supnE: "\u2ACC", supne: "\u228B", supplus: "\u2AC0", Supset: "\u22D1", supset: "\u2283", supseteq: "\u2287", supseteqq: "\u2AC6", supsetneq: "\u228B", supsetneqq: "\u2ACC", supsim: "\u2AC8", supsub: "\u2AD4", supsup: "\u2AD6", swarhk: "\u2926", swArr: "\u21D9", swarr: "\u2199", swarrow: "\u2199", swnwar: "\u292A", szlig: "\xDF", Tab: "\t", target: "\u2316", Tau: "\u03A4", tau: "\u03C4", tbrk: "\u23B4", Tcaron: "\u0164", tcaron: "\u0165", Tcedil: "\u0162", tcedil: "\u0163", Tcy: "\u0422", tcy: "\u0442", tdot: "\u20DB", telrec: "\u2315", Tfr: "\uD835\uDD17", tfr: "\uD835\uDD31", there4: "\u2234", Therefore: "\u2234", therefore: "\u2234", Theta: "\u0398", theta: "\u03B8", thetasym: "\u03D1", thetav: "\u03D1", thickapprox: "\u2248", thicksim: "\u223C", ThickSpace: "\u205F\u200A", thinsp: "\u2009", ThinSpace: "\u2009", thkap: "\u2248", thksim: "\u223C", THORN: "\xDE", thorn: "\xFE", Tilde: "\u223C", tilde: "\u02DC", TildeEqual: "\u2243", TildeFullEqual: "\u2245", TildeTilde: "\u2248", times: "\xD7", timesb: "\u22A0", timesbar: "\u2A31", timesd: "\u2A30", tint: "\u222D", toea: "\u2928", top: "\u22A4", topbot: "\u2336", topcir: "\u2AF1", Topf: "\uD835\uDD4B", topf: "\uD835\uDD65", topfork: "\u2ADA", tosa: "\u2929", tprime: "\u2034", TRADE: "\u2122", trade: "\u2122", triangle: "\u25B5", triangledown: "\u25BF", triangleleft: "\u25C3", trianglelefteq: "\u22B4", triangleq: "\u225C", triangleright: "\u25B9", trianglerighteq: "\u22B5", tridot: "\u25EC", trie: "\u225C", triminus: "\u2A3A", TripleDot: "\u20DB", triplus: "\u2A39", trisb: "\u29CD", tritime: "\u2A3B", trpezium: "\u23E2", Tscr: "\uD835\uDCAF", tscr: "\uD835\uDCC9", TScy: "\u0426", tscy: "\u0446", TSHcy: "\u040B", tshcy: "\u045B", Tstrok: "\u0166", tstrok: "\u0167", twixt: "\u226C", twoheadleftarrow: "\u219E", twoheadrightarrow: "\u21A0", Uacute: "\xDA", uacute: "\xFA", Uarr: "\u219F", uArr: "\u21D1", uarr: "\u2191", Uarrocir: "\u2949", Ubrcy: "\u040E", ubrcy: "\u045E", Ubreve: "\u016C", ubreve: "\u016D", Ucirc: "\xDB", ucirc: "\xFB", Ucy: "\u0423", ucy: "\u0443", udarr: "\u21C5", Udblac: "\u0170", udblac: "\u0171", udhar: "\u296E", ufisht: "\u297E", Ufr: "\uD835\uDD18", ufr: "\uD835\uDD32", Ugrave: "\xD9", ugrave: "\xF9", uHar: "\u2963", uharl: "\u21BF", uharr: "\u21BE", uhblk: "\u2580", ulcorn: "\u231C", ulcorner: "\u231C", ulcrop: "\u230F", ultri: "\u25F8", Umacr: "\u016A", umacr: "\u016B", uml: "\xA8", UnderBar: "_", UnderBrace: "\u23DF", UnderBracket: "\u23B5", UnderParenthesis: "\u23DD", Union: "\u22C3", UnionPlus: "\u228E", Uogon: "\u0172", uogon: "\u0173", Uopf: "\uD835\uDD4C", uopf: "\uD835\uDD66", UpArrow: "\u2191", Uparrow: "\u21D1", uparrow: "\u2191", UpArrowBar: "\u2912", UpArrowDownArrow: "\u21C5", UpDownArrow: "\u2195", Updownarrow: "\u21D5", updownarrow: "\u2195", UpEquilibrium: "\u296E", upharpoonleft: "\u21BF", upharpoonright: "\u21BE", uplus: "\u228E", UpperLeftArrow: "\u2196", UpperRightArrow: "\u2197", Upsi: "\u03D2", upsi: "\u03C5", upsih: "\u03D2", Upsilon: "\u03A5", upsilon: "\u03C5", UpTee: "\u22A5", UpTeeArrow: "\u21A5", upuparrows: "\u21C8", urcorn: "\u231D", urcorner: "\u231D", urcrop: "\u230E", Uring: "\u016E", uring: "\u016F", urtri: "\u25F9", Uscr: "\uD835\uDCB0", uscr: "\uD835\uDCCA", utdot: "\u22F0", Utilde: "\u0168", utilde: "\u0169", utri: "\u25B5", utrif: "\u25B4", uuarr: "\u21C8", Uuml: "\xDC", uuml: "\xFC", uwangle: "\u29A7", vangrt: "\u299C", varepsilon: "\u03F5", varkappa: "\u03F0", varnothing: "\u2205", varphi: "\u03D5", varpi: "\u03D6", varpropto: "\u221D", vArr: "\u21D5", varr: "\u2195", varrho: "\u03F1", varsigma: "\u03C2", varsubsetneq: "\u228A\uFE00", varsubsetneqq: "\u2ACB\uFE00", varsupsetneq: "\u228B\uFE00", varsupsetneqq: "\u2ACC\uFE00", vartheta: "\u03D1", vartriangleleft: "\u22B2", vartriangleright: "\u22B3", Vbar: "\u2AEB", vBar: "\u2AE8", vBarv: "\u2AE9", Vcy: "\u0412", vcy: "\u0432", VDash: "\u22AB", Vdash: "\u22A9", vDash: "\u22A8", vdash: "\u22A2", Vdashl: "\u2AE6", Vee: "\u22C1", vee: "\u2228", veebar: "\u22BB", veeeq: "\u225A", vellip: "\u22EE", Verbar: "\u2016", verbar: "|", Vert: "\u2016", vert: "|", VerticalBar: "\u2223", VerticalLine: "|", VerticalSeparator: "\u2758", VerticalTilde: "\u2240", VeryThinSpace: "\u200A", Vfr: "\uD835\uDD19", vfr: "\uD835\uDD33", vltri: "\u22B2", vnsub: "\u2282\u20D2", vnsup: "\u2283\u20D2", Vopf: "\uD835\uDD4D", vopf: "\uD835\uDD67", vprop: "\u221D", vrtri: "\u22B3", Vscr: "\uD835\uDCB1", vscr: "\uD835\uDCCB", vsubnE: "\u2ACB\uFE00", vsubne: "\u228A\uFE00", vsupnE: "\u2ACC\uFE00", vsupne: "\u228B\uFE00", Vvdash: "\u22AA", vzigzag: "\u299A", Wcirc: "\u0174", wcirc: "\u0175", wedbar: "\u2A5F", Wedge: "\u22C0", wedge: "\u2227", wedgeq: "\u2259", weierp: "\u2118", Wfr: "\uD835\uDD1A", wfr: "\uD835\uDD34", Wopf: "\uD835\uDD4E", wopf: "\uD835\uDD68", wp: "\u2118", wr: "\u2240", wreath: "\u2240", Wscr: "\uD835\uDCB2", wscr: "\uD835\uDCCC", xcap: "\u22C2", xcirc: "\u25EF", xcup: "\u22C3", xdtri: "\u25BD", Xfr: "\uD835\uDD1B", xfr: "\uD835\uDD35", xhArr: "\u27FA", xharr: "\u27F7", Xi: "\u039E", xi: "\u03BE", xlArr: "\u27F8", xlarr: "\u27F5", xmap: "\u27FC", xnis: "\u22FB", xodot: "\u2A00", Xopf: "\uD835\uDD4F", xopf: "\uD835\uDD69", xoplus: "\u2A01", xotime: "\u2A02", xrArr: "\u27F9", xrarr: "\u27F6", Xscr: "\uD835\uDCB3", xscr: "\uD835\uDCCD", xsqcup: "\u2A06", xuplus: "\u2A04", xutri: "\u25B3", xvee: "\u22C1", xwedge: "\u22C0", Yacute: "\xDD", yacute: "\xFD", YAcy: "\u042F", yacy: "\u044F", Ycirc: "\u0176", ycirc: "\u0177", Ycy: "\u042B", ycy: "\u044B", yen: "\xA5", Yfr: "\uD835\uDD1C", yfr: "\uD835\uDD36", YIcy: "\u0407", yicy: "\u0457", Yopf: "\uD835\uDD50", yopf: "\uD835\uDD6A", Yscr: "\uD835\uDCB4", yscr: "\uD835\uDCCE", YUcy: "\u042E", yucy: "\u044E", Yuml: "\u0178", yuml: "\xFF", Zacute: "\u0179", zacute: "\u017A", Zcaron: "\u017D", zcaron: "\u017E", Zcy: "\u0417", zcy: "\u0437", Zdot: "\u017B", zdot: "\u017C", zeetrf: "\u2128", ZeroWidthSpace: "\u200B", Zeta: "\u0396", zeta: "\u03B6", Zfr: "\u2128", zfr: "\uD835\uDD37", ZHcy: "\u0416", zhcy: "\u0436", zigrarr: "\u21DD", Zopf: "\u2124", zopf: "\uD835\uDD6B", Zscr: "\uD835\uDCB5", zscr: "\uD835\uDCCF", zwj: "\u200D", zwnj: "\u200C" }); /** * @deprecated use `HTML_ENTITIES` instead * @see HTML_ENTITIES */ exports.entityMap = exports.HTML_ENTITIES; /***/ }), /***/ 63232: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 63421: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var attributeFormatData = { uint8x2: { size: 2, stride: 2, normalised: false }, uint8x4: { size: 4, stride: 4, normalised: false }, sint8x2: { size: 2, stride: 2, normalised: false }, sint8x4: { size: 4, stride: 4, normalised: false }, unorm8x2: { size: 2, stride: 2, normalised: true }, unorm8x4: { size: 4, stride: 4, normalised: true }, snorm8x2: { size: 2, stride: 2, normalised: true }, snorm8x4: { size: 4, stride: 4, normalised: true }, uint16x2: { size: 2, stride: 4, normalised: false }, uint16x4: { size: 4, stride: 8, normalised: false }, sint16x2: { size: 2, stride: 4, normalised: false }, sint16x4: { size: 4, stride: 8, normalised: false }, unorm16x2: { size: 2, stride: 4, normalised: true }, unorm16x4: { size: 4, stride: 8, normalised: true }, snorm16x2: { size: 2, stride: 4, normalised: true }, snorm16x4: { size: 4, stride: 8, normalised: true }, float16x2: { size: 2, stride: 4, normalised: false }, float16x4: { size: 4, stride: 8, normalised: false }, float32: { size: 1, stride: 4, normalised: false }, float32x2: { size: 2, stride: 8, normalised: false }, float32x3: { size: 3, stride: 12, normalised: false }, float32x4: { size: 4, stride: 16, normalised: false }, uint32: { size: 1, stride: 4, normalised: false }, uint32x2: { size: 2, stride: 8, normalised: false }, uint32x3: { size: 3, stride: 12, normalised: false }, uint32x4: { size: 4, stride: 16, normalised: false }, sint32: { size: 1, stride: 4, normalised: false }, sint32x2: { size: 2, stride: 8, normalised: false }, sint32x3: { size: 3, stride: 12, normalised: false }, sint32x4: { size: 4, stride: 16, normalised: false } }; function getAttributeInfoFromFormat(format) { var _attributeFormatData$; return (_attributeFormatData$ = attributeFormatData[format]) !== null && _attributeFormatData$ !== void 0 ? _attributeFormatData$ : attributeFormatData.float32; } exports.getAttributeInfoFromFormat = getAttributeInfoFromFormat; /***/ }), /***/ 63548: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var CLEAR = /* @__PURE__ */function (CLEAR2) { CLEAR2[CLEAR2["NONE"] = 0] = "NONE"; CLEAR2[CLEAR2["COLOR"] = 16384] = "COLOR"; CLEAR2[CLEAR2["STENCIL"] = 1024] = "STENCIL"; CLEAR2[CLEAR2["DEPTH"] = 256] = "DEPTH"; CLEAR2[CLEAR2["COLOR_DEPTH"] = 16640] = "COLOR_DEPTH"; CLEAR2[CLEAR2["COLOR_STENCIL"] = 17408] = "COLOR_STENCIL"; CLEAR2[CLEAR2["DEPTH_STENCIL"] = 1280] = "DEPTH_STENCIL"; CLEAR2[CLEAR2["ALL"] = 17664] = "ALL"; return CLEAR2; }(CLEAR || {}); exports.CLEAR = CLEAR; /***/ }), /***/ 63607: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 63880: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var GL_TABLE = null; var GL_TO_GLSL_TYPES = { 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" }; var GLSL_TO_VERTEX_TYPES = { "float": "float32", vec2: "float32x2", vec3: "float32x3", vec4: "float32x4", "int": "sint32", ivec2: "sint32x2", ivec3: "sint32x3", ivec4: "sint32x4", uint: "uint32", uvec2: "uint32x2", uvec3: "uint32x3", uvec4: "uint32x4", bool: "uint32", bvec2: "uint32x2", bvec3: "uint32x3", bvec4: "uint32x4" }; function mapType(gl, type) { if (!GL_TABLE) { var typeNames = Object.keys(GL_TO_GLSL_TYPES); GL_TABLE = {}; for (var i = 0; i < typeNames.length; ++i) { var tn = typeNames[i]; GL_TABLE[gl[tn]] = GL_TO_GLSL_TYPES[tn]; } } return GL_TABLE[type]; } function mapGlToVertexFormat(gl, type) { var typeValue = mapType(gl, type); return GLSL_TO_VERTEX_TYPES[typeValue] || "float32"; } exports.mapGlToVertexFormat = mapGlToVertexFormat; exports.mapType = mapType; /***/ }), /***/ 64181: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.bindFunctions = bindFunctions; exports["default"] = void 0; exports.drillProperty = drillProperty; exports.inheritCreator = inheritCreator; exports.mixClass = mixClass; exports.overrideMethod = overrideMethod; /** * @param {Object} object * @param {String} key * @param {Function} method */ function overrideMethod(object, key, method) { if (object[key] === undefined) object[key] = method;else { var _superMethod = object[key]; object[key] = function (_superMethod, method) { return function () { var _super = this["super"]; this["super"] = _superMethod; var result = method.apply(this, arguments); this["super"] = _super; return result; }; }(_superMethod, method); } } function extendsObject(object, prototype) { // do not use setter, getter for (var key in prototype) { if (key !== 'constructor' && key !== '__proto__') { if (typeof prototype[key] == 'function') { overrideMethod(object, key, prototype[key]); } else if (prototype[key] !== undefined && prototype[key] !== null) { object[key] = prototype[key]; //just copy } } } } ; function quickInheritObject(child, parent) { // do not use setter, getter Object.keys(parent).forEach(function (key) { if (key !== 'constructor' && typeof parent[key] == 'function') { var superMethod = parent[key]; var currentMethod = child[key]; if (!currentMethod) child[key] = superMethod;else { child[key] = function () { var _super = this["super"]; this["super"] = superMethod; var result = currentMethod.apply(this, arguments); this["super"] = _super; return result; }; } } }); } ; function drillProperty(topObject, botObject, keyTop, keyBot) { if (typeof keyTop == 'string') { keyBot = keyBot || keyTop; Object.defineProperty(topObject, keyTop, { set: function set(value) { botObject[keyBot] = value; }, get: function get() { return botObject[keyBot]; }, configurable: true }); } else { if (keyTop instanceof Array) { for (var i = 0; i < keyTop.length; ++i) { drillProperty(topObject, botObject, keyTop[i], keyTop[i]); } } else { for (var key in keyTop) { drillProperty(topObject, botObject, key, keyTop[key]); } } } } ; function bindFunctions(_this, handlers) { var res = {}; for (var key in handlers) { res[key] = handlers[key].bind(_this); } return res; } ; function inheritCreator(parent, child) { var i; if (child.property) { if (parent.property) { for (i in parent.property) { if (!child.property[i]) child.property[i] = parent.property[i]; } } } for (i in parent.prototype) { if (!child.prototype[i]) { child.prototype[i] = parent.prototype[i]; } else { child.prototype[i] = function (superFunction, childFunction) { return function () { var _super = this["super"]; this["super"] = superFunction; var result = childFunction.apply(this, arguments); this["super"] = _super; return result; }; }(parent.prototype[i], child.prototype[i]); } } } ; /*** * * @param {Function} constructor */ function mixClass(constructor) { var descriptors = {}; for (var i = 1; i < arguments.length; ++i) { Object.assign(descriptors, Object.getOwnPropertyDescriptors(arguments[i].prototype)); } delete descriptors.constructor; Object.defineProperties(constructor.prototype, descriptors); } var OOP = { overrideMethod: overrideMethod, "extends": extendsObject, inherit: quickInheritObject, mixClass: mixClass, inheritCreator: inheritCreator, drillProperty: drillProperty, bindFunctions: bindFunctions }; var _default = exports["default"] = OOP; /***/ }), /***/ 64373: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Point = __webpack_require__(75544); var matrixAndBoundsPool = __webpack_require__(22727); "use strict"; var toLocalGlobalMixin = { /** * Returns the global position of the container. * @param point - The optional point to write the global value to. * @param skipUpdate - Should we skip the update transform. * @returns - The updated point. * @memberof scene.Container# */ getGlobalPosition: function getGlobalPosition() { var point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Point.Point(); var skipUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (this.parent) { this.parent.toGlobal(this._position, point, skipUpdate); } else { point.x = this._position.x; point.y = this._position.y; } return point; }, /** * Calculates the global position of the container. * @param position - The world origin to calculate from. * @param point - A Point object in which to store the value, optional * (otherwise will create a new Point). * @param skipUpdate - Should we skip the update transform. * @returns - A point object representing the position of this object. * @memberof scene.Container# */ toGlobal: function toGlobal(position, point) { var skipUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var globalMatrix = this.getGlobalTransform(matrixAndBoundsPool.matrixPool.get(), skipUpdate); point = globalMatrix.apply(position, point); matrixAndBoundsPool.matrixPool["return"](globalMatrix); return point; }, /** * Calculates the local position of the container relative to another point. * @param position - The world origin to calculate from. * @param from - The Container to calculate the global position from. * @param point - A Point object in which to store the value, optional * (otherwise will create a new Point). * @param skipUpdate - Should we skip the update transform * @returns - A point object representing the position of this object * @memberof scene.Container# */ toLocal: function toLocal(position, from, point, skipUpdate) { if (from) { position = from.toGlobal(position, point, skipUpdate); } var globalMatrix = this.getGlobalTransform(matrixAndBoundsPool.matrixPool.get(), skipUpdate); point = globalMatrix.applyInverse(position, point); matrixAndBoundsPool.matrixPool["return"](globalMatrix); return point; } }; exports.toLocalGlobalMixin = toLocalGlobalMixin; /***/ }), /***/ 64564: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var buildArc = __webpack_require__(52165); "use strict"; function buildArcTo(points, x1, y1, x2, y2, radius) { var fromX = points[points.length - 2]; var fromY = points[points.length - 1]; var a1 = fromY - y1; var b1 = fromX - x1; var a2 = y2 - y1; var b2 = x2 - x1; var mm = Math.abs(a1 * b2 - b1 * a2); if (mm < 1e-8 || radius === 0) { if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) { points.push(x1, y1); } return; } var dd = a1 * a1 + b1 * b1; var cc = a2 * a2 + b2 * b2; var tt = a1 * a2 + b1 * b2; var k1 = radius * Math.sqrt(dd) / mm; var k2 = radius * Math.sqrt(cc) / mm; var j1 = k1 * tt / dd; var j2 = k2 * tt / cc; var cx = k1 * b2 + k2 * b1; var cy = k1 * a2 + k2 * a1; var px = b1 * (k2 + j1); var py = a1 * (k2 + j1); var qx = b2 * (k1 + j2); var qy = a2 * (k1 + j2); var startAngle = Math.atan2(py - cy, px - cx); var endAngle = Math.atan2(qy - cy, qx - cx); buildArc.buildArc(points, cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); } exports.buildArcTo = buildArcTo; /***/ }), /***/ 64884: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var _const = __webpack_require__(63548); var CanvasSource = __webpack_require__(35879); var TextureSource = __webpack_require__(55406); var GpuRenderTarget = __webpack_require__(46873); "use strict"; var GpuRenderTargetAdaptor = /*#__PURE__*/function () { function GpuRenderTargetAdaptor() { _classCallCheck(this, GpuRenderTargetAdaptor); } return _createClass(GpuRenderTargetAdaptor, [{ key: "init", value: function init(renderer, renderTargetSystem) { this._renderer = renderer; this._renderTargetSystem = renderTargetSystem; } }, { key: "copyToTexture", value: function copyToTexture(sourceRenderSurfaceTexture, destinationTexture, originSrc, size, originDest) { var renderer = this._renderer; var baseGpuTexture = this._getGpuColorTexture(sourceRenderSurfaceTexture); var backGpuTexture = renderer.texture.getGpuSource(destinationTexture.source); renderer.encoder.commandEncoder.copyTextureToTexture({ texture: baseGpuTexture, origin: originSrc }, { texture: backGpuTexture, origin: originDest }, size); return destinationTexture; } }, { key: "startRenderPass", value: function startRenderPass(renderTarget) { var clear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var clearColor = arguments.length > 2 ? arguments[2] : undefined; var viewport = arguments.length > 3 ? arguments[3] : undefined; var renderTargetSystem = this._renderTargetSystem; var gpuRenderTarget = renderTargetSystem.getGpuRenderTarget(renderTarget); var descriptor = this.getDescriptor(renderTarget, clear, clearColor); gpuRenderTarget.descriptor = descriptor; this._renderer.pipeline.setRenderTarget(gpuRenderTarget); this._renderer.encoder.beginRenderPass(gpuRenderTarget); this._renderer.encoder.setViewport(viewport); } }, { key: "finishRenderPass", value: function finishRenderPass() { this._renderer.encoder.endRenderPass(); } /** * returns the gpu texture for the first color texture in the render target * mainly used by the filter manager to get copy the texture for blending * @param renderTarget * @returns a gpu texture */ }, { key: "_getGpuColorTexture", value: function _getGpuColorTexture(renderTarget) { var gpuRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget); if (gpuRenderTarget.contexts[0]) { return gpuRenderTarget.contexts[0].getCurrentTexture(); } return this._renderer.texture.getGpuSource(renderTarget.colorTextures[0].source); } }, { key: "getDescriptor", value: function getDescriptor(renderTarget, clear, clearValue) { var _this = this; if (typeof clear === "boolean") { clear = clear ? _const.CLEAR.ALL : _const.CLEAR.NONE; } var renderTargetSystem = this._renderTargetSystem; var gpuRenderTarget = renderTargetSystem.getGpuRenderTarget(renderTarget); var colorAttachments = renderTarget.colorTextures.map(function (texture, i) { var context = gpuRenderTarget.contexts[i]; var view; var resolveTarget; if (context) { var currentTexture = context.getCurrentTexture(); var canvasTextureView = currentTexture.createView(); view = canvasTextureView; } else { view = _this._renderer.texture.getGpuSource(texture).createView({ mipLevelCount: 1 }); } if (gpuRenderTarget.msaaTextures[i]) { resolveTarget = view; view = _this._renderer.texture.getTextureView(gpuRenderTarget.msaaTextures[i]); } var loadOp = clear & _const.CLEAR.COLOR ? "clear" : "load"; clearValue !== null && clearValue !== void 0 ? clearValue : clearValue = renderTargetSystem.defaultClearColor; return { view: view, resolveTarget: resolveTarget, clearValue: clearValue, storeOp: "store", loadOp: loadOp }; }); var depthStencilAttachment; if ((renderTarget.stencil || renderTarget.depth) && !renderTarget.depthStencilTexture) { renderTarget.ensureDepthStencilTexture(); renderTarget.depthStencilTexture.source.sampleCount = gpuRenderTarget.msaa ? 4 : 1; } if (renderTarget.depthStencilTexture) { var stencilLoadOp = clear & _const.CLEAR.STENCIL ? "clear" : "load"; var depthLoadOp = clear & _const.CLEAR.DEPTH ? "clear" : "load"; depthStencilAttachment = { view: this._renderer.texture.getGpuSource(renderTarget.depthStencilTexture.source).createView(), stencilStoreOp: "store", stencilLoadOp: stencilLoadOp, depthClearValue: 1, depthLoadOp: depthLoadOp, depthStoreOp: "store" }; } var descriptor = { colorAttachments: colorAttachments, depthStencilAttachment: depthStencilAttachment }; return descriptor; } }, { key: "clear", value: function clear(renderTarget) { var _clear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var clearColor = arguments.length > 2 ? arguments[2] : undefined; var viewport = arguments.length > 3 ? arguments[3] : undefined; if (!_clear) return; var _this$_renderer = this._renderer, gpu = _this$_renderer.gpu, encoder = _this$_renderer.encoder; var device = gpu.device; var standAlone = encoder.commandEncoder === null; if (standAlone) { var commandEncoder = device.createCommandEncoder(); var renderPassDescriptor = this.getDescriptor(renderTarget, _clear, clearColor); var passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); passEncoder.setViewport(viewport.x, viewport.y, viewport.width, viewport.height, 0, 1); passEncoder.end(); var gpuCommands = commandEncoder.finish(); device.queue.submit([gpuCommands]); } else { this.startRenderPass(renderTarget, _clear, clearColor, viewport); } } }, { key: "initGpuRenderTarget", value: function initGpuRenderTarget(renderTarget) { var _this2 = this; renderTarget.isRoot = true; var gpuRenderTarget = new GpuRenderTarget.GpuRenderTarget(); renderTarget.colorTextures.forEach(function (colorTexture, i) { if (CanvasSource.CanvasSource.test(colorTexture.resource)) { var context = colorTexture.resource.getContext("webgpu"); var alphaMode = colorTexture.transparent ? "premultiplied" : "opaque"; try { context.configure({ device: _this2._renderer.gpu.device, usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC, format: "bgra8unorm", alphaMode: alphaMode }); } catch (e) { console.error(e); } gpuRenderTarget.contexts[i] = context; } gpuRenderTarget.msaa = colorTexture.source.antialias; if (colorTexture.source.antialias) { var msaaTexture = new TextureSource.TextureSource({ width: 0, height: 0, sampleCount: 4 }); gpuRenderTarget.msaaTextures[i] = msaaTexture; } }); if (gpuRenderTarget.msaa) { gpuRenderTarget.msaaSamples = 4; if (renderTarget.depthStencilTexture) { renderTarget.depthStencilTexture.source.sampleCount = 4; } } return gpuRenderTarget; } }, { key: "destroyGpuRenderTarget", value: function destroyGpuRenderTarget(gpuRenderTarget) { gpuRenderTarget.contexts.forEach(function (context) { context.unconfigure(); }); gpuRenderTarget.msaaTextures.forEach(function (texture) { texture.destroy(); }); gpuRenderTarget.msaaTextures.length = 0; gpuRenderTarget.contexts.length = 0; } }, { key: "ensureDepthStencilTexture", value: function ensureDepthStencilTexture(renderTarget) { var gpuRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget); if (renderTarget.depthStencilTexture && gpuRenderTarget.msaa) { renderTarget.depthStencilTexture.source.sampleCount = 4; } } }, { key: "resizeGpuRenderTarget", value: function resizeGpuRenderTarget(renderTarget) { var gpuRenderTarget = this._renderTargetSystem.getGpuRenderTarget(renderTarget); gpuRenderTarget.width = renderTarget.width; gpuRenderTarget.height = renderTarget.height; if (gpuRenderTarget.msaa) { renderTarget.colorTextures.forEach(function (colorTexture, i) { var msaaTexture = gpuRenderTarget.msaaTextures[i]; msaaTexture === null || msaaTexture === void 0 || msaaTexture.resize(colorTexture.source.width, colorTexture.source.height, colorTexture.source._resolution); }); } } }]); }(); exports.GpuRenderTargetAdaptor = GpuRenderTargetAdaptor; /***/ }), /***/ 64996: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var EventSystem = __webpack_require__(49556); var FederatedEvent = __webpack_require__(42961); "use strict"; var FederatedContainer = { /** * Property-based event handler for the `click` event. * @memberof scene.Container# * @default null * @example * this.onclick = (event) => { * //some function here that happens on click * } */ onclick: null, /** * Property-based event handler for the `mousedown` event. * @memberof scene.Container# * @default null * @example * this.onmousedown = (event) => { * //some function here that happens on mousedown * } */ onmousedown: null, /** * Property-based event handler for the `mouseenter` event. * @memberof scene.Container# * @default null * @example * this.onmouseenter = (event) => { * //some function here that happens on mouseenter * } */ onmouseenter: null, /** * Property-based event handler for the `mouseleave` event. * @memberof scene.Container# * @default null * @example * this.onmouseleave = (event) => { * //some function here that happens on mouseleave * } */ onmouseleave: null, /** * Property-based event handler for the `mousemove` event. * @memberof scene.Container# * @default null * @example * this.onmousemove = (event) => { * //some function here that happens on mousemove * } */ onmousemove: null, /** * Property-based event handler for the `globalmousemove` event. * @memberof scene.Container# * @default null * @example * this.onglobalmousemove = (event) => { * //some function here that happens on globalmousemove * } */ onglobalmousemove: null, /** * Property-based event handler for the `mouseout` event. * @memberof scene.Container# * @default null * @example * this.onmouseout = (event) => { * //some function here that happens on mouseout * } */ onmouseout: null, /** * Property-based event handler for the `mouseover` event. * @memberof scene.Container# * @default null * @example * this.onmouseover = (event) => { * //some function here that happens on mouseover * } */ onmouseover: null, /** * Property-based event handler for the `mouseup` event. * @memberof scene.Container# * @default null * @example * this.onmouseup = (event) => { * //some function here that happens on mouseup * } */ onmouseup: null, /** * Property-based event handler for the `mouseupoutside` event. * @memberof scene.Container# * @default null * @example * this.onmouseupoutside = (event) => { * //some function here that happens on mouseupoutside * } */ onmouseupoutside: null, /** * Property-based event handler for the `pointercancel` event. * @memberof scene.Container# * @default null * @example * this.onpointercancel = (event) => { * //some function here that happens on pointercancel * } */ onpointercancel: null, /** * Property-based event handler for the `pointerdown` event. * @memberof scene.Container# * @default null * @example * this.onpointerdown = (event) => { * //some function here that happens on pointerdown * } */ onpointerdown: null, /** * Property-based event handler for the `pointerenter` event. * @memberof scene.Container# * @default null * @example * this.onpointerenter = (event) => { * //some function here that happens on pointerenter * } */ onpointerenter: null, /** * Property-based event handler for the `pointerleave` event. * @memberof scene.Container# * @default null * @example * this.onpointerleave = (event) => { * //some function here that happens on pointerleave * } */ onpointerleave: null, /** * Property-based event handler for the `pointermove` event. * @memberof scene.Container# * @default null * @example * this.onpointermove = (event) => { * //some function here that happens on pointermove * } */ onpointermove: null, /** * Property-based event handler for the `globalpointermove` event. * @memberof scene.Container# * @default null * @example * this.onglobalpointermove = (event) => { * //some function here that happens on globalpointermove * } */ onglobalpointermove: null, /** * Property-based event handler for the `pointerout` event. * @memberof scene.Container# * @default null * @example * this.onpointerout = (event) => { * //some function here that happens on pointerout * } */ onpointerout: null, /** * Property-based event handler for the `pointerover` event. * @memberof scene.Container# * @default null * @example * this.onpointerover = (event) => { * //some function here that happens on pointerover * } */ onpointerover: null, /** * Property-based event handler for the `pointertap` event. * @memberof scene.Container# * @default null * @example * this.onpointertap = (event) => { * //some function here that happens on pointertap * } */ onpointertap: null, /** * Property-based event handler for the `pointerup` event. * @memberof scene.Container# * @default null * @example * this.onpointerup = (event) => { * //some function here that happens on pointerup * } */ onpointerup: null, /** * Property-based event handler for the `pointerupoutside` event. * @memberof scene.Container# * @default null * @example * this.onpointerupoutside = (event) => { * //some function here that happens on pointerupoutside * } */ onpointerupoutside: null, /** * Property-based event handler for the `rightclick` event. * @memberof scene.Container# * @default null * @example * this.onrightclick = (event) => { * //some function here that happens on rightclick * } */ onrightclick: null, /** * Property-based event handler for the `rightdown` event. * @memberof scene.Container# * @default null * @example * this.onrightdown = (event) => { * //some function here that happens on rightdown * } */ onrightdown: null, /** * Property-based event handler for the `rightup` event. * @memberof scene.Container# * @default null * @example * this.onrightup = (event) => { * //some function here that happens on rightup * } */ onrightup: null, /** * Property-based event handler for the `rightupoutside` event. * @memberof scene.Container# * @default null * @example * this.onrightupoutside = (event) => { * //some function here that happens on rightupoutside * } */ onrightupoutside: null, /** * Property-based event handler for the `tap` event. * @memberof scene.Container# * @default null * @example * this.ontap = (event) => { * //some function here that happens on tap * } */ ontap: null, /** * Property-based event handler for the `touchcancel` event. * @memberof scene.Container# * @default null * @example * this.ontouchcancel = (event) => { * //some function here that happens on touchcancel * } */ ontouchcancel: null, /** * Property-based event handler for the `touchend` event. * @memberof scene.Container# * @default null * @example * this.ontouchend = (event) => { * //some function here that happens on touchend * } */ ontouchend: null, /** * Property-based event handler for the `touchendoutside` event. * @memberof scene.Container# * @default null * @example * this.ontouchendoutside = (event) => { * //some function here that happens on touchendoutside * } */ ontouchendoutside: null, /** * Property-based event handler for the `touchmove` event. * @memberof scene.Container# * @default null * @example * this.ontouchmove = (event) => { * //some function here that happens on touchmove * } */ ontouchmove: null, /** * Property-based event handler for the `globaltouchmove` event. * @memberof scene.Container# * @default null * @example * this.onglobaltouchmove = (event) => { * //some function here that happens on globaltouchmove * } */ onglobaltouchmove: null, /** * Property-based event handler for the `touchstart` event. * @memberof scene.Container# * @default null * @example * this.ontouchstart = (event) => { * //some function here that happens on touchstart * } */ ontouchstart: null, /** * Property-based event handler for the `wheel` event. * @memberof scene.Container# * @default null * @example * this.onwheel = (event) => { * //some function here that happens on wheel * } */ onwheel: null, /** * Enable interaction events for the Container. Touch, pointer and mouse * @memberof scene.Container# */ get interactive() { return this.eventMode === "dynamic" || this.eventMode === "static"; }, set interactive(value) { this.eventMode = value ? "static" : "passive"; }, /** * @ignore */ _internalEventMode: void 0, /** * Enable interaction events for the Container. Touch, pointer and mouse. * There are 5 types of interaction settings: * - `'none'`: Ignores all interaction events, even on its children. * - `'passive'`: **(default)** Does not emit events and ignores all hit testing on itself and non-interactive children. * Interactive children will still emit events. * - `'auto'`: Does not emit events but is hit tested if parent is interactive. Same as `interactive = false` in v7 * - `'static'`: Emit events and is hit tested. Same as `interaction = true` in v7 * - `'dynamic'`: Emits events and is hit tested but will also receive mock interaction events fired from a ticker to * allow for interaction when the mouse isn't moving * @example * import { Sprite } from 'pixi.js'; * * const sprite = new Sprite(texture); * sprite.eventMode = 'static'; * sprite.on('tap', (event) => { * // Handle event * }); * @memberof scene.Container# * @since 7.2.0 */ get eventMode() { var _this$_internalEventM; return (_this$_internalEventM = this._internalEventMode) !== null && _this$_internalEventM !== void 0 ? _this$_internalEventM : EventSystem.EventSystem.defaultEventMode; }, set eventMode(value) { this._internalEventMode = value; }, /** * Determines if the container is interactive or not * @returns {boolean} Whether the container is interactive or not * @memberof scene.Container# * @since 7.2.0 * @example * import { Sprite } from 'pixi.js'; * * const sprite = new Sprite(texture); * sprite.eventMode = 'static'; * sprite.isInteractive(); // true * * sprite.eventMode = 'dynamic'; * sprite.isInteractive(); // true * * sprite.eventMode = 'none'; * sprite.isInteractive(); // false * * sprite.eventMode = 'passive'; * sprite.isInteractive(); // false * * sprite.eventMode = 'auto'; * sprite.isInteractive(); // false */ isInteractive: function isInteractive() { return this.eventMode === "static" || this.eventMode === "dynamic"; }, /** * Determines if the children to the container can be clicked/touched * Setting this to false allows PixiJS to bypass a recursive `hitTest` function * @memberof scene.Container# */ interactiveChildren: true, /** * Interaction shape. Children will be hit first, then this shape will be checked. * Setting this will cause this shape to be checked in hit tests rather than the container's bounds. * @example * import { Rectangle, Sprite } from 'pixi.js'; * * const sprite = new Sprite(texture); * sprite.interactive = true; * sprite.hitArea = new Rectangle(0, 0, 100, 100); * @member {IHitArea} * @memberof scene.Container# */ hitArea: null, /** * Unlike `on` or `addListener` which are methods from EventEmitter, `addEventListener` * seeks to be compatible with the DOM's `addEventListener` with support for options. * @memberof scene.Container * @param type - The type of event to listen to. * @param listener - The listener callback or object. * @param options - Listener options, used for capture phase. * @example * // Tell the user whether they did a single, double, triple, or nth click. * button.addEventListener('click', { * handleEvent(e): { * let prefix; * * switch (e.detail) { * case 1: prefix = 'single'; break; * case 2: prefix = 'double'; break; * case 3: prefix = 'triple'; break; * default: prefix = e.detail + 'th'; break; * } * * console.log('That was a ' + prefix + 'click'); * } * }); * * // But skip the first click! * button.parent.addEventListener('click', function blockClickOnce(e) { * e.stopImmediatePropagation(); * button.parent.removeEventListener('click', blockClickOnce, true); * }, { * capture: true, * }); */ addEventListener: function addEventListener(type, listener, options) { var capture = typeof options === "boolean" && options || _typeof(options) === "object" && options.capture; var signal = _typeof(options) === "object" ? options.signal : void 0; var once = _typeof(options) === "object" ? options.once === true : false; var context = typeof listener === "function" ? void 0 : listener; type = capture ? "".concat(type, "capture") : type; var listenerFn = typeof listener === "function" ? listener : listener.handleEvent; var emitter = this; if (signal) { signal.addEventListener("abort", function () { emitter.off(type, listenerFn, context); }); } if (once) { emitter.once(type, listenerFn, context); } else { emitter.on(type, listenerFn, context); } }, /** * Unlike `off` or `removeListener` which are methods from EventEmitter, `removeEventListener` * seeks to be compatible with the DOM's `removeEventListener` with support for options. * @memberof scene.Container * @param type - The type of event the listener is bound to. * @param listener - The listener callback or object. * @param options - The original listener options. This is required to deregister a capture phase listener. */ removeEventListener: function removeEventListener(type, listener, options) { var capture = typeof options === "boolean" && options || _typeof(options) === "object" && options.capture; var context = typeof listener === "function" ? void 0 : listener; type = capture ? "".concat(type, "capture") : type; listener = typeof listener === "function" ? listener : listener.handleEvent; this.off(type, listener, context); }, /** * Dispatch the event on this {@link Container} using the event's {@link EventBoundary}. * * The target of the event is set to `this` and the `defaultPrevented` flag is cleared before dispatch. * @memberof scene.Container * @param e - The event to dispatch. * @returns Whether the {@link FederatedEvent.preventDefault preventDefault}() method was not invoked. * @example * // Reuse a click event! * button.dispatchEvent(clickEvent); */ dispatchEvent: function dispatchEvent(e) { if (!(e instanceof FederatedEvent.FederatedEvent)) { throw new Error("Container cannot propagate events outside of the Federated Events API"); } e.defaultPrevented = false; e.path = null; e.target = this; e.manager.dispatchEvent(e); return !e.defaultPrevented; } }; exports.FederatedContainer = FederatedContainer; /***/ }), /***/ 65077: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AttachHook = AttachHook; exports["default"] = void 0; var _AElement = _interopRequireDefault(__webpack_require__(94278)); var _EventEmitter = _interopRequireDefault(__webpack_require__(35513)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } window.pendingAttachHooks = {}; var pendingId = 0; /*** * @extends AElement * @constructor */ function AttachHook() { this._attached = false; this._canceled = false; this._pendingId = ++pendingId; this._eventAdded = false; this.counter = 0; this.delayTime = 0; } AttachHook.prototype._addAttachedEvent = function () { if (this._eventAdded) return; this.addEventListener('error', function (event) { if (!this._attached && this.isDescendantOf(document.body)) { this._attached = true; if (this.waitTimeout > 0) clearTimeout(this.waitTimeout); delete pendingAttachHooks[this._pendingId]; if (this._canceled) return; this.emit('attached', event, this); } }); this._eventAdded = true; if (!this._canceled) { pendingAttachHooks[this._pendingId] = this; this.waitAttaching(); } }; AttachHook.prototype.eventEmittorOnWithTime = function (isOnce, arg0, arg1, arg2) { if (arg0 === 'attached') { this._addAttachedEvent(); return _AElement["default"].prototype.eventEmittorOnWithTime.apply(this, arguments); } else { return _AElement["default"].prototype.eventEmittorOnWithTime.apply(this, arguments); } }; /* AttachHook.prototype.on = function () { if (arguments[0] === 'attached') { this._addAttachedEvent(); AElement.prototype.on.apply(this, arguments); } else { AElement.prototype.on.apply(this, arguments); } return this; }; AttachHook.prototype.once = function () { if (arguments[0] === 'attached') { this._addAttachedEvent(); AElement.prototype.once.apply(this, arguments); } else { AElement.prototype.once.apply(this, arguments); } return this; };*/ AttachHook.render = function (data, option, domInstance) { var attributes = {}; var tag; if (domInstance.defaultTag === 'div') { attributes.src = ''; tag = 'img'; } else { tag = 'image'; attributes.href = ''; } return domInstance._({ tag: tag, "class": 'absol-attachhook', extendEvent: ['attached'], style: { display: 'none' }, attr: attributes, props: { domInstance: domInstance } }); }; AttachHook.prototype.waitAttaching = function () { if (this._canceled) return; var self = this; // if (BrowserDetector.browser.type.startsWith('chrome') && parseInt((BrowserDetector.browser.version || '').split('.').shift()) >= 113) { if (this.waitTimeout > 0) clearTimeout(this.waitTimeout); this.waitTimeout = setTimeout(function wait() { self.waitTimeout = -1; self.counter++; if (self.counter === 1) self.delayTime = 10;else if (self.counter === 5) self.delayTime = 30;else if (self.counter === 50) self.delayTime = 60;else if (self.counter === 100) self.delayTime = 100;else if (self.counter === 500) self.delayTime = 1000; if (!self._attached && self.isDescendantOf(document.body)) { self._attached = true; delete pendingAttachHooks[self._pendingId]; if (self._canceled) return; self.emit('attached', { target: this }, self); } else if (!self._attached && !self._canceled) { self.waitTimeout = setTimeout(wait, self.delayTime); } }, this.delayTime); // } }; AttachHook.prototype.cancelWaiting = function () { if (this.waitTimeout > 0) clearTimeout(this.waitTimeout); this._canceled = true; delete pendingAttachHooks[this._pendingId]; }; AttachHook.prototype.resetState = function () { if (this.waitTimeout > 0) clearTimeout(this.waitTimeout); this._attached = false; this._canceled = false; this.counter = 0; this.delayTime = 1; if (this.tagName.toLowerCase() === 'img') { this.attr('src', ''); } else { this.attr('href', ''); } pendingAttachHooks[this._pendingId] = this; this.waitAttaching(); }; AttachHook.property = { attached: { get: function get() { return !!this._attached; } }, canceled: { get: function get() { return !!this._canceled; } } }; var _default = exports["default"] = AttachHook; /***/ }), /***/ 65269: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 65278: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var warn = __webpack_require__(57371); var convertToList = __webpack_require__(28097); "use strict"; var CacheClass = /*#__PURE__*/function () { function CacheClass() { _classCallCheck(this, CacheClass); this._parsers = []; this._cache = /* @__PURE__ */new Map(); this._cacheMap = /* @__PURE__ */new Map(); } /** Clear all entries. */ return _createClass(CacheClass, [{ key: "reset", value: function reset() { this._cacheMap.clear(); this._cache.clear(); } /** * Check if the key exists * @param key - The key to check */ }, { key: "has", value: function has(key) { return this._cache.has(key); } /** * Fetch entry by key * @param key - The key of the entry to get */ }, { key: "get", value: function get(key) { var result = this._cache.get(key); if (!result) { warn.warn("[Assets] Asset id ".concat(key, " was not found in the Cache")); } return result; } /** * Set a value by key or keys name * @param key - The key or keys to set * @param value - The value to store in the cache or from which cacheable assets will be derived. */ }, { key: "set", value: function set(key, value) { var _this = this; var keys = convertToList.convertToList(key); var cacheableAssets; for (var i = 0; i < this.parsers.length; i++) { var parser = this.parsers[i]; if (parser.test(value)) { cacheableAssets = parser.getCacheableAssets(keys, value); break; } } var cacheableMap = new Map(Object.entries(cacheableAssets || {})); if (!cacheableAssets) { keys.forEach(function (key2) { cacheableMap.set(key2, value); }); } var cacheKeys = _toConsumableArray(cacheableMap.keys()); var cachedAssets = { cacheKeys: cacheKeys, keys: keys }; keys.forEach(function (key2) { _this._cacheMap.set(key2, cachedAssets); }); cacheKeys.forEach(function (key2) { var val = cacheableAssets ? cacheableAssets[key2] : value; if (_this._cache.has(key2) && _this._cache.get(key2) !== val) { warn.warn("[Cache] already has key:", key2); } _this._cache.set(key2, cacheableMap.get(key2)); }); } /** * Remove entry by key * * This function will also remove any associated alias from the cache also. * @param key - The key of the entry to remove */ }, { key: "remove", value: function remove(key) { var _this2 = this; if (!this._cacheMap.has(key)) { warn.warn("[Assets] Asset id ".concat(key, " was not found in the Cache")); return; } var cacheMap = this._cacheMap.get(key); var cacheKeys = cacheMap.cacheKeys; cacheKeys.forEach(function (key2) { _this2._cache["delete"](key2); }); cacheMap.keys.forEach(function (key2) { _this2._cacheMap["delete"](key2); }); } /** All loader parsers registered */ }, { key: "parsers", get: function get() { return this._parsers; } }]); }(); var Cache = new CacheClass(); exports.Cache = Cache; /***/ }), /***/ 66304: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Color = __webpack_require__(98828); var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var Rectangle = __webpack_require__(74731); var Bounds = __webpack_require__(76631); var getLocalBounds = __webpack_require__(81268); var Container = __webpack_require__(47719); var RenderTexture = __webpack_require__(37314); "use strict"; var tempRect = new Rectangle.Rectangle(); var tempBounds = new Bounds.Bounds(); var noColor = [0, 0, 0, 0]; var GenerateTextureSystem = /*#__PURE__*/function () { function GenerateTextureSystem(renderer) { _classCallCheck(this, GenerateTextureSystem); this._renderer = renderer; } /** * A Useful function that returns a texture of the display object that can then be used to create sprites * This can be quite useful if your container is complicated and needs to be reused multiple times. * @param {GenerateTextureOptions | Container} options - Generate texture options. * @param {Container} [options.container] - If not given, the renderer's resolution is used. * @param {Rectangle} options.region - The region of the container, that shall be rendered, * @param {number} [options.resolution] - The resolution of the texture being generated. * if no region is specified, defaults to the local bounds of the container. * @param {GenerateTextureSourceOptions} [options.textureSourceOptions] - Texture options for GPU. * @returns a shiny new texture of the container passed in */ return _createClass(GenerateTextureSystem, [{ key: "generateTexture", value: function generateTexture(options) { var _options$frame; if (options instanceof Container.Container) { options = { target: options, frame: void 0, textureSourceOptions: {}, resolution: void 0 }; } var resolution = options.resolution || this._renderer.resolution; var antialias = options.antialias || this._renderer.view.antialias; var container = options.target; var clearColor = options.clearColor; if (clearColor) { var isRGBAArray = Array.isArray(clearColor) && clearColor.length === 4; clearColor = isRGBAArray ? clearColor : Color.Color.shared.setValue(clearColor).toArray(); } else { clearColor = noColor; } var region = ((_options$frame = options.frame) === null || _options$frame === void 0 ? void 0 : _options$frame.copyTo(tempRect)) || getLocalBounds.getLocalBounds(container, tempBounds).rectangle; region.width = Math.max(region.width, 1 / resolution) | 0; region.height = Math.max(region.height, 1 / resolution) | 0; var target = RenderTexture.RenderTexture.create(_objectSpread(_objectSpread({}, options.textureSourceOptions), {}, { width: region.width, height: region.height, resolution: resolution, antialias: antialias })); var transform = Matrix.Matrix.shared.translate(-region.x, -region.y); this._renderer.render({ container: container, transform: transform, target: target, clearColor: clearColor }); target.source.updateMipmaps(); return target; } }, { key: "destroy", value: function destroy() { this._renderer = null; } }]); }(); /** @ignore */ GenerateTextureSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem], name: "textureGenerator" }; exports.GenerateTextureSystem = GenerateTextureSystem; /***/ }), /***/ 66702: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function addProgramDefines(src, isES300, isFragment) { if (isES300) return src; if (isFragment) { src = src.replace("out vec4 finalColor;", ""); return "\n \n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ".concat(src, "\n "); } return "\n \n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ".concat(src, "\n "); } exports.addProgramDefines = addProgramDefines; /***/ }), /***/ 66983: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); var GLhls = __webpack_require__(44064); var GPUhls = __webpack_require__(505); "use strict"; var ColorBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function ColorBlend() { _classCallCheck(this, ColorBlend); return _callSuper(this, ColorBlend, [{ gl: { functions: "\n ".concat(GLhls.hslgl, "\n\n vec3 blendColor(vec3 base, vec3 blend, float opacity)\n {\n return (setLuminosity(blend, getLuminosity(base)) * opacity + base * (1.0 - opacity));\n }\n "), main: "\n finalColor = vec4(blendColor(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n ".concat(GPUhls.hslgpu, "\n\n fn blendColorOpacity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n return (setLuminosity(blend, getLuminosity(base)) * opacity + base * (1.0 - opacity));\n }\n "), main: "\n out = vec4<f32>(blendColorOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(ColorBlend, _BlendModeFilter$Blen); return _createClass(ColorBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ ColorBlend.extension = { name: "color", type: Extensions.ExtensionType.BlendMode }; exports.ColorBlend = ColorBlend; /***/ }), /***/ 67073: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var adapter = __webpack_require__(72450); var AbstractRenderer = __webpack_require__(59158); "use strict"; var _isWebGLSupported; function isWebGLSupported(failIfMajorPerformanceCaveat) { if (_isWebGLSupported !== void 0) return _isWebGLSupported; _isWebGLSupported = function () { var contextOptions = { stencil: true, failIfMajorPerformanceCaveat: failIfMajorPerformanceCaveat !== null && failIfMajorPerformanceCaveat !== void 0 ? failIfMajorPerformanceCaveat : AbstractRenderer.AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat }; try { var _gl; if (!adapter.DOMAdapter.get().getWebGLRenderingContext()) { return false; } var canvas = adapter.DOMAdapter.get().createCanvas(); var gl = canvas.getContext("webgl", contextOptions); var success = !!((_gl = gl) !== null && _gl !== void 0 && (_gl = _gl.getContextAttributes()) !== null && _gl !== void 0 && _gl.stencil); if (gl) { var loseContext = gl.getExtension("WEBGL_lose_context"); if (loseContext) { loseContext.loseContext(); } } gl = null; return success; } catch (_e) { return false; } }(); return _isWebGLSupported; } exports.isWebGLSupported = isWebGLSupported; /***/ }), /***/ 67478: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var CanvasTextPipe = __webpack_require__(22572); var CanvasTextSystem = __webpack_require__(71581); "use strict"; Extensions.extensions.add(CanvasTextSystem.CanvasTextSystem); Extensions.extensions.add(CanvasTextPipe.CanvasTextPipe); /***/ }), /***/ 68216: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Rectangle = __webpack_require__(74731); var Texture = __webpack_require__(73782); "use strict"; var _Spritesheet = /*#__PURE__*/function () { /** * @param texture - Reference to the source BaseTexture object. * @param {object} data - Spritesheet image data. */ function _Spritesheet(texture, data) { _classCallCheck(this, _Spritesheet); /** For multi-packed spritesheets, this contains a reference to all the other spritesheets it depends on. */ this.linkedSheets = []; this._texture = texture instanceof Texture.Texture ? texture : null; this.textureSource = texture.source; this.textures = {}; this.animations = {}; this.data = data; var metaResolution = parseFloat(data.meta.scale); if (metaResolution) { this.resolution = metaResolution; texture.source.resolution = this.resolution; } else { this.resolution = texture.source._resolution; } this._frames = this.data.frames; this._frameKeys = Object.keys(this._frames); this._batchIndex = 0; this._callback = null; } /** * Parser spritesheet from loaded data. This is done asynchronously * to prevent creating too many Texture within a single process. */ return _createClass(_Spritesheet, [{ key: "parse", value: function parse() { var _this = this; return new Promise(function (resolve) { _this._callback = resolve; _this._batchIndex = 0; if (_this._frameKeys.length <= _Spritesheet.BATCH_SIZE) { _this._processFrames(0); _this._processAnimations(); _this._parseComplete(); } else { _this._nextBatch(); } }); } /** * Process a batch of frames * @param initialFrameIndex - The index of frame to start. */ }, { key: "_processFrames", value: function _processFrames(initialFrameIndex) { var frameIndex = initialFrameIndex; var maxFrames = _Spritesheet.BATCH_SIZE; while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) { var i = this._frameKeys[frameIndex]; var data = this._frames[i]; var rect = data.frame; if (rect) { var frame = null; var trim = null; var sourceSize = data.trimmed !== false && data.sourceSize ? data.sourceSize : data.frame; var orig = new Rectangle.Rectangle(0, 0, Math.floor(sourceSize.w) / this.resolution, Math.floor(sourceSize.h) / this.resolution); if (data.rotated) { frame = new Rectangle.Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.h) / this.resolution, Math.floor(rect.w) / this.resolution); } else { frame = new Rectangle.Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution); } if (data.trimmed !== false && data.spriteSourceSize) { trim = new Rectangle.Rectangle(Math.floor(data.spriteSourceSize.x) / this.resolution, Math.floor(data.spriteSourceSize.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution); } this.textures[i] = new Texture.Texture({ source: this.textureSource, frame: frame, orig: orig, trim: trim, rotate: data.rotated ? 2 : 0, defaultAnchor: data.anchor, defaultBorders: data.borders, label: i.toString() }); } frameIndex++; } } /** Parse animations config. */ }, { key: "_processAnimations", value: function _processAnimations() { var animations = this.data.animations || {}; for (var animName in animations) { this.animations[animName] = []; for (var i = 0; i < animations[animName].length; i++) { var frameName = animations[animName][i]; this.animations[animName].push(this.textures[frameName]); } } } /** The parse has completed. */ }, { key: "_parseComplete", value: function _parseComplete() { var callback = this._callback; this._callback = null; this._batchIndex = 0; callback.call(this, this.textures); } /** Begin the next batch of textures. */ }, { key: "_nextBatch", value: function _nextBatch() { var _this2 = this; this._processFrames(this._batchIndex * _Spritesheet.BATCH_SIZE); this._batchIndex++; setTimeout(function () { if (_this2._batchIndex * _Spritesheet.BATCH_SIZE < _this2._frameKeys.length) { _this2._nextBatch(); } else { _this2._processAnimations(); _this2._parseComplete(); } }, 0); } /** * Destroy Spritesheet and don't use after this. * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well */ }, { key: "destroy", value: function destroy() { var destroyBase = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; for (var i in this.textures) { this.textures[i].destroy(); } this._frames = null; this._frameKeys = null; this.data = null; this.textures = null; if (destroyBase) { var _this$_texture; (_this$_texture = this._texture) === null || _this$_texture === void 0 || _this$_texture.destroy(); this.textureSource.destroy(); } this._texture = null; this.textureSource = null; this.linkedSheets = []; } }]); }(); /** The maximum number of Textures to build per process. */ _Spritesheet.BATCH_SIZE = 1e3; var Spritesheet = _Spritesheet; exports.Spritesheet = Spritesheet; /***/ }), /***/ 68375: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var PrepareBase = __webpack_require__(87661); var PrepareQueue = __webpack_require__(2505); var PrepareSystem = __webpack_require__(10849); var PrepareUpload = __webpack_require__(75957); "use strict"; exports.PrepareBase = PrepareBase.PrepareBase; exports.PrepareQueue = PrepareQueue.PrepareQueue; exports.PrepareSystem = PrepareSystem.PrepareSystem; exports.PrepareUpload = PrepareUpload.PrepareUpload; /***/ }), /***/ 68520: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["texture", "points", "textureScale"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var definedProps = __webpack_require__(48629); var Mesh = __webpack_require__(60931); var RopeGeometry = __webpack_require__(72989); "use strict"; var _MeshRope = /*#__PURE__*/function (_Mesh$Mesh) { /** * Note: The wrap mode of the texture is set to REPEAT if `textureScale` is positive. * @param options * @param options.texture - The texture to use on the rope. * @param options.points - An array of {@link math.Point} objects to construct this rope. * @param {number} options.textureScale - Optional. Positive values scale rope texture * keeping its aspect ratio. You can reduce alpha channel artifacts by providing a larger texture * and downsampling here. If set to zero, texture will be stretched instead. */ function _MeshRope(options) { var _this; _classCallCheck(this, _MeshRope); var _MeshRope$defaultOpti = _objectSpread(_objectSpread({}, _MeshRope.defaultOptions), options), texture = _MeshRope$defaultOpti.texture, points = _MeshRope$defaultOpti.points, textureScale = _MeshRope$defaultOpti.textureScale, rest = _objectWithoutProperties(_MeshRope$defaultOpti, _excluded); var ropeGeometry = new RopeGeometry.RopeGeometry(definedProps.definedProps({ width: texture.height, points: points, textureScale: textureScale })); if (textureScale > 0) { texture.source.style.addressMode = "repeat"; } _this = _callSuper(this, _MeshRope, [definedProps.definedProps(_objectSpread(_objectSpread({}, rest), {}, { texture: texture, geometry: ropeGeometry }))]); _this.autoUpdate = true; _this.onRender = _this._render; return _this; } _inherits(_MeshRope, _Mesh$Mesh); return _createClass(_MeshRope, [{ key: "_render", value: function _render() { var geometry = this.geometry; if (this.autoUpdate || geometry._width !== this.texture.height) { geometry._width = this.texture.height; geometry.update(); } } }]); }(Mesh.Mesh); _MeshRope.defaultOptions = { textureScale: 0 }; var MeshRope = _MeshRope; exports.MeshRope = MeshRope; /***/ }), /***/ 68556: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var isWebGLSupported = __webpack_require__(67073); var isWebGPUSupported = __webpack_require__(50132); var AbstractRenderer = __webpack_require__(59158); "use strict"; var renderPriority = ["webgl", "webgpu", "canvas"]; function autoDetectRenderer(_x) { return _autoDetectRenderer.apply(this, arguments); } function _autoDetectRenderer() { _autoDetectRenderer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) { var preferredOrder, RendererClass, finalOptions, i, _options$failIfMajorP, rendererType, _yield$Promise$resolv, WebGPURenderer, _yield$Promise$resolv2, WebGLRenderer, renderer, _t; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: preferredOrder = []; if (options.preference) { preferredOrder.push(options.preference); renderPriority.forEach(function (item) { if (item !== options.preference) { preferredOrder.push(item); } }); } else { preferredOrder = renderPriority.slice(); } finalOptions = {}; i = 0; case 1: if (!(i < preferredOrder.length)) { _context.n = 9; break; } rendererType = preferredOrder[i]; _t = rendererType === "webgpu"; if (!_t) { _context.n = 3; break; } _context.n = 2; return isWebGPUSupported.isWebGPUSupported(); case 2: _t = _context.v; case 3: if (!_t) { _context.n = 5; break; } _context.n = 4; return Promise.resolve().then(function () { return __webpack_require__(98971); }); case 4: _yield$Promise$resolv = _context.v; WebGPURenderer = _yield$Promise$resolv.WebGPURenderer; RendererClass = WebGPURenderer; finalOptions = _objectSpread(_objectSpread({}, options), options.webgpu); return _context.a(3, 9); case 5: if (!(rendererType === "webgl" && isWebGLSupported.isWebGLSupported((_options$failIfMajorP = options.failIfMajorPerformanceCaveat) !== null && _options$failIfMajorP !== void 0 ? _options$failIfMajorP : AbstractRenderer.AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat))) { _context.n = 7; break; } _context.n = 6; return Promise.resolve().then(function () { return __webpack_require__(15973); }); case 6: _yield$Promise$resolv2 = _context.v; WebGLRenderer = _yield$Promise$resolv2.WebGLRenderer; RendererClass = WebGLRenderer; finalOptions = _objectSpread(_objectSpread({}, options), options.webgl); return _context.a(3, 9); case 7: if (!(rendererType === "canvas")) { _context.n = 8; break; } finalOptions = _objectSpread({}, options); throw new Error("CanvasRenderer is not yet implemented"); case 8: i++; _context.n = 1; break; case 9: delete finalOptions.webgpu; delete finalOptions.webgl; if (RendererClass) { _context.n = 10; break; } throw new Error("No available renderer for the current environment"); case 10: renderer = new RendererClass(); _context.n = 11; return renderer.init(finalOptions); case 11: return _context.a(2, renderer); } }, _callee); })); return _autoDetectRenderer.apply(this, arguments); } exports.autoDetectRenderer = autoDetectRenderer; /***/ }), /***/ 68618: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function extractFontFamilies(text, style) { var fontFamily = style.fontFamily; var fontFamilies = []; var dedupe = {}; var regex = /font-family:([^;"\s]+)/g; var matches = text.match(regex); function addFontFamily(fontFamily2) { if (!dedupe[fontFamily2]) { fontFamilies.push(fontFamily2); dedupe[fontFamily2] = true; } } if (Array.isArray(fontFamily)) { for (var i = 0; i < fontFamily.length; i++) { addFontFamily(fontFamily[i]); } } else { addFontFamily(fontFamily); } if (matches) { matches.forEach(function (match) { var fontFamily2 = match.split(":")[1].trim(); addFontFamily(fontFamily2); }); } for (var _i in style.tagStyles) { var fontFamily2 = style.tagStyles[_i].fontFamily; addFontFamily(fontFamily2); } return fontFamilies; } exports.extractFontFamilies = extractFontFamilies; /***/ }), /***/ 68951: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var UboSystem = __webpack_require__(50626); var createUboElementsSTD40 = __webpack_require__(86754); var createUboSyncSTD40 = __webpack_require__(2187); "use strict"; var GlUboSystem = /*#__PURE__*/function (_UboSystem$UboSystem) { function GlUboSystem() { _classCallCheck(this, GlUboSystem); return _callSuper(this, GlUboSystem, [{ createUboElements: createUboElementsSTD40.createUboElementsSTD40, generateUboSync: createUboSyncSTD40.createUboSyncFunctionSTD40 }]); } _inherits(GlUboSystem, _UboSystem$UboSystem); return _createClass(GlUboSystem); }(UboSystem.UboSystem); /** @ignore */ GlUboSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "ubo" }; exports.GlUboSystem = GlUboSystem; /***/ }), /***/ 69095: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function assignWithIgnore(target, options) { var ignore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; for (var key in options) { if (!ignore[key] && options[key] !== void 0) { target[key] = options[key]; } } } exports.assignWithIgnore = assignWithIgnore; /***/ }), /***/ 69177: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var GpuProgram = __webpack_require__(57974); var _const = __webpack_require__(59249); var blurTemplate = __webpack_require__(82422); "use strict"; function generateBlurProgram(horizontal, kernelSize) { var kernel = _const.GAUSSIAN_VALUES[kernelSize]; var halfLength = kernel.length; var blurStructSource = []; var blurOutSource = []; var blurSamplingSource = []; for (var i = 0; i < kernelSize; i++) { blurStructSource[i] = "@location(".concat(i, ") offset").concat(i, ": vec2<f32>,"); if (horizontal) { blurOutSource[i] = "filteredCord + vec2(".concat(i - halfLength + 1, " * pixelStrength, 0.0),"); } else { blurOutSource[i] = "filteredCord + vec2(0.0, ".concat(i - halfLength + 1, " * pixelStrength),"); } var kernelIndex = i < halfLength ? i : kernelSize - i - 1; var kernelValue = kernel[kernelIndex].toString(); blurSamplingSource[i] = "finalColor += textureSample(uTexture, uSampler, offset".concat(i, ") * ").concat(kernelValue, ";"); } var blurStruct = blurStructSource.join("\n"); var blurOut = blurOutSource.join("\n"); var blurSampling = blurSamplingSource.join("\n"); var finalSource = blurTemplate["default"].replace("%blur-struct%", blurStruct).replace("%blur-vertex-out%", blurOut).replace("%blur-fragment-in%", blurStruct).replace("%blur-sampling%", blurSampling).replace("%dimension%", horizontal ? "z" : "w"); return GpuProgram.GpuProgram.from({ vertex: { source: finalSource, entryPoint: "mainVertex" }, fragment: { source: finalSource, entryPoint: "mainFragment" } }); } exports.generateBlurProgram = generateBlurProgram; /***/ }), /***/ 69288: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var FederatedMouseEvent = __webpack_require__(73616); "use strict"; var FederatedWheelEvent = /*#__PURE__*/function (_FederatedMouseEvent$) { function FederatedWheelEvent() { var _this; _classCallCheck(this, FederatedWheelEvent); _this = _callSuper(this, FederatedWheelEvent, arguments); /** Units specified in pixels. */ _this.DOM_DELTA_PIXEL = 0; /** Units specified in lines. */ _this.DOM_DELTA_LINE = 1; /** Units specified in pages. */ _this.DOM_DELTA_PAGE = 2; return _this; } _inherits(FederatedWheelEvent, _FederatedMouseEvent$); return _createClass(FederatedWheelEvent); }(FederatedMouseEvent.FederatedMouseEvent); /** Units specified in pixels. */ FederatedWheelEvent.DOM_DELTA_PIXEL = 0; /** Units specified in lines. */ FederatedWheelEvent.DOM_DELTA_LINE = 1; /** Units specified in pages. */ FederatedWheelEvent.DOM_DELTA_PAGE = 2; exports.FederatedWheelEvent = FederatedWheelEvent; /***/ }), /***/ 69344: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 69633: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var dom = __webpack_require__(5433); exports.DOMImplementation = dom.DOMImplementation; exports.XMLSerializer = dom.XMLSerializer; exports.DOMParser = __webpack_require__(81033).DOMParser; /***/ }), /***/ 69802: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["texture", "verticesX", "verticesY"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropSet(t, e, o, r, p, f) { return _set(_getPrototypeOf(f ? t.prototype : t), e, o, r, p); } function set(e, r, t, o) { return set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) { var f, i = _superPropBase(e, r); if (i) { if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), !0; if (!f.writable) return !1; } if (f = Object.getOwnPropertyDescriptor(o, r)) { if (!f.writable) return !1; f.value = t, Object.defineProperty(o, r, f); } else _defineProperty(o, r, t); return !0; }, set(e, r, t, o); } function _set(e, r, t, o, f) { if (!set(e, r, t, o || e) && f) throw new TypeError("failed to set property"); return t; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var definedProps = __webpack_require__(48629); var Mesh = __webpack_require__(60931); var PlaneGeometry = __webpack_require__(45301); "use strict"; var MeshPlane = /*#__PURE__*/function (_Mesh$Mesh) { /** * @param options - Options to be applied to MeshPlane */ function MeshPlane(options) { var _this; _classCallCheck(this, MeshPlane); var texture = options.texture, verticesX = options.verticesX, verticesY = options.verticesY, rest = _objectWithoutProperties(options, _excluded); var planeGeometry = new PlaneGeometry.PlaneGeometry(definedProps.definedProps({ width: texture.width, height: texture.height, verticesX: verticesX, verticesY: verticesY })); _this = _callSuper(this, MeshPlane, [definedProps.definedProps(_objectSpread(_objectSpread({}, rest), {}, { geometry: planeGeometry, texture: texture }))]); _this.texture = texture; _this.autoResize = true; return _this; } /** * Method used for overrides, to do something in case texture frame was changed. * Meshes based on plane can override it and change more details based on texture. */ _inherits(MeshPlane, _Mesh$Mesh); return _createClass(MeshPlane, [{ key: "textureUpdated", value: function textureUpdated() { var geometry = this.geometry; var _this$texture = this.texture, width = _this$texture.width, height = _this$texture.height; if (this.autoResize && (geometry.width !== width || geometry.height !== height)) { geometry.width = width; geometry.height = height; geometry.build({}); } } }, { key: "texture", get: /** The texture of the MeshPlane */ function get() { return this._texture; } /** * Destroys this sprite renderable and optionally its texture. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the current texture of the renderable as well * @param {boolean} [options.textureSource=false] - Should it destroy the textureSource of the renderable as well */, set: function set(value) { var _this$_texture; (_this$_texture = this._texture) === null || _this$_texture === void 0 || _this$_texture.off("update", this.textureUpdated, this); _superPropSet(MeshPlane, "texture", value, this, 1, 1); value.on("update", this.textureUpdated, this); this.textureUpdated(); } }, { key: "destroy", value: function destroy(options) { this.texture.off("update", this.textureUpdated, this); _superPropGet(MeshPlane, "destroy", this, 3)([options]); } }]); }(Mesh.Mesh); exports.MeshPlane = MeshPlane; /***/ }), /***/ 69840: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var Container = __webpack_require__(47719); var AccessibilitySystem = __webpack_require__(21353); var accessibilityTarget = __webpack_require__(58669); "use strict"; Extensions.extensions.add(AccessibilitySystem.AccessibilitySystem); Extensions.extensions.mixin(Container.Container, accessibilityTarget.accessibilityTarget); /***/ }), /***/ 69968: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var uidCount = 0; function generateUID() { return uidCount++; } exports.generateUID = generateUID; /***/ }), /***/ 70001: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = __webpack_require__(59832); var _const = __webpack_require__(33843); "use strict"; function GpuReadBuffer(buffer, renderer) { var bufferSize = buffer.descriptor.size; var device = renderer.gpu.device; var stagingBuffer = new Buffer.Buffer({ data: new Float32Array(24e5), usage: _const.BufferUsage.MAP_READ | _const.BufferUsage.COPY_DST }); var stagingGPUBuffer = renderer.buffer.createGPUBuffer(stagingBuffer); var commandEncoder = device.createCommandEncoder(); commandEncoder.copyBufferToBuffer(renderer.buffer.getGPUBuffer(buffer), 0, // Source offset stagingGPUBuffer, 0, // Destination offset bufferSize); device.queue.submit([commandEncoder.finish()]); void stagingGPUBuffer.mapAsync(GPUMapMode.READ, 0, // Offset bufferSize // Length ).then(function () { stagingGPUBuffer.getMappedRange(0, bufferSize); stagingGPUBuffer.unmap(); }); } exports.GpuReadBuffer = GpuReadBuffer; /***/ }), /***/ 70026: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Color = __webpack_require__(98828); var Matrix = __webpack_require__(20764); var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var Shader = __webpack_require__(27866); var Texture = __webpack_require__(73782); var TextureStyle = __webpack_require__(62881); var particles$1 = __webpack_require__(92718); var particles = __webpack_require__(10453); var particles$2 = __webpack_require__(27563); "use strict"; var ParticleShader = /*#__PURE__*/function (_Shader$Shader) { function ParticleShader() { _classCallCheck(this, ParticleShader); var glProgram = GlProgram.GlProgram.from({ vertex: particles["default"], fragment: particles$1["default"] }); var gpuProgram = GpuProgram.GpuProgram.from({ fragment: { source: particles$2["default"], entryPoint: "mainFragment" }, vertex: { source: particles$2["default"], entryPoint: "mainVertex" } }); return _callSuper(this, ParticleShader, [{ glProgram: glProgram, gpuProgram: gpuProgram, resources: { // this will be replaced with the texture from the particle container uTexture: Texture.Texture.WHITE.source, // this will be replaced with the texture style from the particle container uSampler: new TextureStyle.TextureStyle({}), // this will be replaced with the local uniforms from the particle container uniforms: { uTranslationMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uColor: { value: new Color.Color(16777215), type: "vec4<f32>" }, uRound: { value: 1, type: "f32" }, uResolution: { value: [0, 0], type: "vec2<f32>" } } } }]); } _inherits(ParticleShader, _Shader$Shader); return _createClass(ParticleShader); }(Shader.Shader); exports.ParticleShader = ParticleShader; /***/ }), /***/ 70652: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var SystemRunner = /*#__PURE__*/function () { /** * @param name - The function name that will be executed on the listeners added to this Runner. */ function SystemRunner(name) { _classCallCheck(this, SystemRunner); this.items = []; this._name = name; } /* jsdoc/check-param-names */ /** * Dispatch/Broadcast Runner to all listeners added to the queue. * @param {...any} params - (optional) parameters to pass to each listener */ /* jsdoc/check-param-names */ return _createClass(SystemRunner, [{ key: "emit", value: function emit(a0, a1, a2, a3, a4, a5, a6, a7) { var name = this.name, items = this.items; for (var i = 0, len = items.length; i < len; i++) { items[i][name](a0, a1, a2, a3, a4, a5, a6, a7); } return this; } /** * Add a listener to the Runner * * Runners do not need to have scope or functions passed to them. * All that is required is to pass the listening object and ensure that it has contains a function that has the same name * as the name provided to the Runner when it was created. * * Eg A listener passed to this Runner will require a 'complete' function. * * ``` * import { Runner } from 'pixi.js'; * * const complete = new Runner('complete'); * ``` * * The scope used will be the object itself. * @param {any} item - The object that will be listening. */ }, { key: "add", value: function add(item) { if (item[this._name]) { this.remove(item); this.items.push(item); } return this; } /** * Remove a single listener from the dispatch queue. * @param {any} item - The listener that you would like to remove. */ }, { key: "remove", value: function remove(item) { var index = this.items.indexOf(item); if (index !== -1) { this.items.splice(index, 1); } return this; } /** * Check to see if the listener is already in the Runner * @param {any} item - The listener that you would like to check. */ }, { key: "contains", value: function contains(item) { return this.items.indexOf(item) !== -1; } /** Remove all listeners from the Runner */ }, { key: "removeAll", value: function removeAll() { this.items.length = 0; return this; } /** Remove all references, don't use after this. */ }, { key: "destroy", value: function destroy() { this.removeAll(); this.items = null; this._name = null; } /** * `true` if there are no this Runner contains no listeners * @readonly */ }, { key: "empty", get: function get() { return this.items.length === 0; } /** * The name of the runner. * @readonly */ }, { key: "name", get: function get() { return this._name; } }]); }(); exports.SystemRunner = SystemRunner; /***/ }), /***/ 70688: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var unsafeEval; function unsafeEvalSupported() { if (typeof unsafeEval === "boolean") { return unsafeEval; } try { var func = new Function("param1", "param2", "param3", "return param1[param2] === param3;"); unsafeEval = func({ a: "b" }, "a", "b") === true; } catch (_e) { unsafeEval = false; } return unsafeEval; } exports.unsafeEvalSupported = unsafeEvalSupported; /***/ }), /***/ 70784: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var TilingSpritePipe = __webpack_require__(38468); "use strict"; Extensions.extensions.add(TilingSpritePipe.TilingSpritePipe); /***/ }), /***/ 70809: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var BufferResource = __webpack_require__(1484); var UniformGroup = __webpack_require__(34400); var TextureSource = __webpack_require__(55406); "use strict"; function generateShaderSyncCode(shader, shaderSystem) { var funcFragments = []; var headerFragments = ["\n var g = s.groups;\n var sS = r.shader;\n var p = s.glProgram;\n var ugS = r.uniformGroup;\n var resources;\n "]; var addedTextreSystem = false; var textureCount = 0; var programData = shaderSystem._getProgramData(shader.glProgram); for (var i in shader.groups) { var group = shader.groups[i]; funcFragments.push("\n resources = g[".concat(i, "].resources;\n ")); for (var j in group.resources) { var resource = group.resources[j]; if (resource instanceof UniformGroup.UniformGroup) { if (resource.ubo) { var resName = shader._uniformBindMap[i][Number(j)]; funcFragments.push("\n sS.bindUniformBlock(\n resources[".concat(j, "],\n '").concat(resName, "',\n ").concat(shader.glProgram._uniformBlockData[resName].index, "\n );\n ")); } else { funcFragments.push("\n ugS.updateUniformGroup(resources[".concat(j, "], p, sD);\n ")); } } else if (resource instanceof BufferResource.BufferResource) { var _resName = shader._uniformBindMap[i][Number(j)]; funcFragments.push("\n sS.bindUniformBlock(\n resources[".concat(j, "],\n '").concat(_resName, "',\n ").concat(shader.glProgram._uniformBlockData[_resName].index, "\n );\n ")); } else if (resource instanceof TextureSource.TextureSource) { var uniformName = shader._uniformBindMap[i][j]; var uniformData = programData.uniformData[uniformName]; if (uniformData) { if (!addedTextreSystem) { addedTextreSystem = true; headerFragments.push("\n var tS = r.texture;\n "); } shaderSystem._gl.uniform1i(uniformData.location, textureCount); funcFragments.push("\n tS.bind(resources[".concat(j, "], ").concat(textureCount, ");\n ")); textureCount++; } } } } var functionSource = [].concat(headerFragments, funcFragments).join("\n"); return new Function("r", "s", "sD", functionSource); } exports.generateShaderSyncCode = generateShaderSyncCode; /***/ }), /***/ 70818: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var source = "\nstruct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct DisplacementUniforms {\n uFilterMatrix:mat3x3<f32>,\n uScale:vec2<f32>,\n uRotation:mat2x2<f32>\n};\n\n\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> filterUniforms : DisplacementUniforms;\n@group(1) @binding(1) var uMapTexture: texture_2d<f32>;\n@group(1) @binding(2) var uMapSampler : sampler;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) filterUv : vec2<f32>,\n };\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \n}\n\nfn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>\n{\n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n}\n\nfn getSize() -> vec2<f32>\n{\n\n \n return gfu.uGlobalFrame.zw;\n}\n \n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition),\n getFilterCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) filterUv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n\n var map = textureSample(uMapTexture, uMapSampler, filterUv);\n\n var offset = gfu.uInputSize.zw * (filterUniforms.uRotation * (map.xy - 0.5)) * filterUniforms.uScale; \n \n return textureSample(uTexture, uSampler, clamp(uv + offset, gfu.uInputClamp.xy, gfu.uInputClamp.zw));\n}"; exports["default"] = source; /***/ }), /***/ 70823: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function generateLayoutHash(_ref) { var groups = _ref.groups; var layout = []; for (var i = 0; i < groups.length; i++) { var group = groups[i]; if (!layout[group.group]) { layout[group.group] = {}; } layout[group.group][group.name] = group.binding; } return layout; } exports.generateLayoutHash = generateLayoutHash; /***/ }), /***/ 70854: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var addMaskBounds = __webpack_require__(30597); var addMaskLocalBounds = __webpack_require__(82132); "use strict"; var ScissorMask = /*#__PURE__*/function () { function ScissorMask(mask) { _classCallCheck(this, ScissorMask); this.priority = 0; this.pipe = "scissorMask"; this.mask = mask; this.mask.renderable = false; this.mask.measurable = false; } return _createClass(ScissorMask, [{ key: "addBounds", value: function addBounds(bounds, skipUpdateTransform) { addMaskBounds.addMaskBounds(this.mask, bounds, skipUpdateTransform); } }, { key: "addLocalBounds", value: function addLocalBounds(bounds, localRoot) { addMaskLocalBounds.addMaskLocalBounds(this.mask, bounds, localRoot); } }, { key: "containsPoint", value: function containsPoint(point, hitTestFn) { var mask = this.mask; return hitTestFn(mask, point); } }, { key: "reset", value: function reset() { this.mask.measurable = true; this.mask = null; } }, { key: "destroy", value: function destroy() { this.reset(); } }]); }(); exports.ScissorMask = ScissorMask; /***/ }), /***/ 70868: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var adapter = __webpack_require__(72450); var bitmapFontXMLParser = __webpack_require__(75037); "use strict"; var bitmapFontXMLStringParser = { test: function test(data) { if (typeof data === "string" && data.includes("<font>")) { return bitmapFontXMLParser.bitmapFontXMLParser.test(adapter.DOMAdapter.get().parseXML(data)); } return false; }, parse: function parse(data) { return bitmapFontXMLParser.bitmapFontXMLParser.parse(adapter.DOMAdapter.get().parseXML(data)); } }; exports.bitmapFontXMLStringParser = bitmapFontXMLStringParser; /***/ }), /***/ 71012: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Circle = __webpack_require__(37764); var Ellipse = __webpack_require__(10816); var Polygon = __webpack_require__(53932); var Rectangle = __webpack_require__(74731); var RoundedRectangle = __webpack_require__(54122); var Bounds = __webpack_require__(76631); var buildAdaptiveBezier = __webpack_require__(80556); var buildAdaptiveQuadratic = __webpack_require__(6417); var buildArc = __webpack_require__(52165); var buildArcTo = __webpack_require__(64564); var buildArcToSvg = __webpack_require__(32680); var _roundShape = __webpack_require__(6721); "use strict"; var tempRectangle = new Rectangle.Rectangle(); var ShapePath = /*#__PURE__*/function () { function ShapePath(graphicsPath2D) { _classCallCheck(this, ShapePath); /** The list of shape primitives that make up the path. */ this.shapePrimitives = []; this._currentPoly = null; this._bounds = new Bounds.Bounds(); this._graphicsPath2D = graphicsPath2D; this.signed = graphicsPath2D.checkForHoles; } /** * Sets the starting point for a new sub-path. Any subsequent drawing commands are considered part of this path. * @param x - The x-coordinate for the starting point. * @param y - The y-coordinate for the starting point. * @returns The instance of the current object for chaining. */ return _createClass(ShapePath, [{ key: "moveTo", value: function moveTo(x, y) { this.startPoly(x, y); return this; } /** * Connects the current point to a new point with a straight line. This method updates the current path. * @param x - The x-coordinate of the new point to connect to. * @param y - The y-coordinate of the new point to connect to. * @returns The instance of the current object for chaining. */ }, { key: "lineTo", value: function lineTo(x, y) { this._ensurePoly(); var points = this._currentPoly.points; var fromX = points[points.length - 2]; var fromY = points[points.length - 1]; if (fromX !== x || fromY !== y) { points.push(x, y); } return this; } /** * Adds an arc to the path. The arc is centered at (x, y) * position with radius `radius` starting at `startAngle` and ending at `endAngle`. * @param x - The x-coordinate of the arc's center. * @param y - The y-coordinate of the arc's center. * @param radius - The radius of the arc. * @param startAngle - The starting angle of the arc, in radians. * @param endAngle - The ending angle of the arc, in radians. * @param counterclockwise - Specifies whether the arc should be drawn in the anticlockwise direction. False by default. * @returns The instance of the current object for chaining. */ }, { key: "arc", value: function arc(x, y, radius, startAngle, endAngle, counterclockwise) { this._ensurePoly(false); var points = this._currentPoly.points; buildArc.buildArc(points, x, y, radius, startAngle, endAngle, counterclockwise); return this; } /** * Adds an arc to the path with the arc tangent to the line joining two specified points. * The arc radius is specified by `radius`. * @param x1 - The x-coordinate of the first point. * @param y1 - The y-coordinate of the first point. * @param x2 - The x-coordinate of the second point. * @param y2 - The y-coordinate of the second point. * @param radius - The radius of the arc. * @returns The instance of the current object for chaining. */ }, { key: "arcTo", value: function arcTo(x1, y1, x2, y2, radius) { this._ensurePoly(); var points = this._currentPoly.points; buildArcTo.buildArcTo(points, x1, y1, x2, y2, radius); return this; } /** * Adds an SVG-style arc to the path, allowing for elliptical arcs based on the SVG spec. * @param rx - The x-radius of the ellipse. * @param ry - The y-radius of the ellipse. * @param xAxisRotation - The rotation of the ellipse's x-axis relative * to the x-axis of the coordinate system, in degrees. * @param largeArcFlag - Determines if the arc should be greater than or less than 180 degrees. * @param sweepFlag - Determines if the arc should be swept in a positive angle direction. * @param x - The x-coordinate of the arc's end point. * @param y - The y-coordinate of the arc's end point. * @returns The instance of the current object for chaining. */ }, { key: "arcToSvg", value: function arcToSvg(rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y) { var points = this._currentPoly.points; buildArcToSvg.buildArcToSvg(points, this._currentPoly.lastX, this._currentPoly.lastY, x, y, rx, ry, xAxisRotation, largeArcFlag, sweepFlag); return this; } /** * Adds a cubic Bezier curve to the path. * It requires three points: the first two are control points and the third one is the end point. * The starting point is the last point in the current path. * @param cp1x - The x-coordinate of the first control point. * @param cp1y - The y-coordinate of the first control point. * @param cp2x - The x-coordinate of the second control point. * @param cp2y - The y-coordinate of the second control point. * @param x - The x-coordinate of the end point. * @param y - The y-coordinate of the end point. * @param smoothness - Optional parameter to adjust the smoothness of the curve. * @returns The instance of the current object for chaining. */ }, { key: "bezierCurveTo", value: function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) { this._ensurePoly(); var currentPoly = this._currentPoly; buildAdaptiveBezier.buildAdaptiveBezier(this._currentPoly.points, currentPoly.lastX, currentPoly.lastY, cp1x, cp1y, cp2x, cp2y, x, y, smoothness); return this; } /** * Adds a quadratic curve to the path. It requires two points: the control point and the end point. * The starting point is the last point in the current path. * @param cp1x - The x-coordinate of the control point. * @param cp1y - The y-coordinate of the control point. * @param x - The x-coordinate of the end point. * @param y - The y-coordinate of the end point. * @param smoothing - Optional parameter to adjust the smoothness of the curve. * @returns The instance of the current object for chaining. */ }, { key: "quadraticCurveTo", value: function quadraticCurveTo(cp1x, cp1y, x, y, smoothing) { this._ensurePoly(); var currentPoly = this._currentPoly; buildAdaptiveQuadratic.buildAdaptiveQuadratic(this._currentPoly.points, currentPoly.lastX, currentPoly.lastY, cp1x, cp1y, x, y, smoothing); return this; } /** * Closes the current path by drawing a straight line back to the start. * If the shape is already closed or there are no points in the path, this method does nothing. * @returns The instance of the current object for chaining. */ }, { key: "closePath", value: function closePath() { this.endPoly(true); return this; } /** * Adds another path to the current path. This method allows for the combination of multiple paths into one. * @param path - The `GraphicsPath` object representing the path to add. * @param transform - An optional `Matrix` object to apply a transformation to the path before adding it. * @returns The instance of the current object for chaining. */ }, { key: "addPath", value: function addPath(path, transform) { this.endPoly(); if (transform && !transform.isIdentity()) { path = path.clone(true); path.transform(transform); } var shapePrimitives = this.shapePrimitives; var start = shapePrimitives.length; for (var i = 0; i < path.instructions.length; i++) { var instruction = path.instructions[i]; this[instruction.action].apply(this, _toConsumableArray(instruction.data)); } if (path.checkForHoles && shapePrimitives.length - start > 1) { var mainShape = null; for (var _i = start; _i < shapePrimitives.length; _i++) { var shapePrimitive = shapePrimitives[_i]; if (shapePrimitive.shape.type === "polygon") { var _mainShape; var polygon = shapePrimitive.shape; var mainPolygon = (_mainShape = mainShape) === null || _mainShape === void 0 ? void 0 : _mainShape.shape; if (mainPolygon && mainPolygon.containsPolygon(polygon)) { mainShape.holes || (mainShape.holes = []); mainShape.holes.push(shapePrimitive); shapePrimitives.copyWithin(_i, _i + 1); shapePrimitives.length--; _i--; } else { mainShape = shapePrimitive; } } } } return this; } /** * Finalizes the drawing of the current path. Optionally, it can close the path. * @param closePath - A boolean indicating whether to close the path after finishing. False by default. */ }, { key: "finish", value: function finish() { var closePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this.endPoly(closePath); } /** * Draws a rectangle shape. This method adds a new rectangle path to the current drawing. * @param x - The x-coordinate of the top-left corner of the rectangle. * @param y - The y-coordinate of the top-left corner of the rectangle. * @param w - The width of the rectangle. * @param h - The height of the rectangle. * @param transform - An optional `Matrix` object to apply a transformation to the rectangle. * @returns The instance of the current object for chaining. */ }, { key: "rect", value: function rect(x, y, w, h, transform) { this.drawShape(new Rectangle.Rectangle(x, y, w, h), transform); return this; } /** * Draws a circle shape. This method adds a new circle path to the current drawing. * @param x - The x-coordinate of the center of the circle. * @param y - The y-coordinate of the center of the circle. * @param radius - The radius of the circle. * @param transform - An optional `Matrix` object to apply a transformation to the circle. * @returns The instance of the current object for chaining. */ }, { key: "circle", value: function circle(x, y, radius, transform) { this.drawShape(new Circle.Circle(x, y, radius), transform); return this; } /** * Draws a polygon shape. This method allows for the creation of complex polygons by specifying a sequence of points. * @param points - An array of numbers, or or an array of PointData objects eg [{x,y}, {x,y}, {x,y}] * representing the x and y coordinates of the polygon's vertices, in sequence. * @param close - A boolean indicating whether to close the polygon path. True by default. * @param transform - An optional `Matrix` object to apply a transformation to the polygon. * @returns The instance of the current object for chaining. */ }, { key: "poly", value: function poly(points, close, transform) { var polygon = new Polygon.Polygon(points); polygon.closePath = close; this.drawShape(polygon, transform); return this; } /** * Draws a regular polygon with a specified number of sides. All sides and angles are equal. * @param x - The x-coordinate of the center of the polygon. * @param y - The y-coordinate of the center of the polygon. * @param radius - The radius of the circumscribed circle of the polygon. * @param sides - The number of sides of the polygon. Must be 3 or more. * @param rotation - The rotation angle of the polygon, in radians. Zero by default. * @param transform - An optional `Matrix` object to apply a transformation to the polygon. * @returns The instance of the current object for chaining. */ }, { key: "regularPoly", value: function regularPoly(x, y, radius, sides) { var rotation = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; var transform = arguments.length > 5 ? arguments[5] : undefined; sides = Math.max(sides | 0, 3); var startAngle = -1 * Math.PI / 2 + rotation; var delta = Math.PI * 2 / sides; var polygon = []; for (var i = 0; i < sides; i++) { var angle = startAngle - i * delta; polygon.push(x + radius * Math.cos(angle), y + radius * Math.sin(angle)); } this.poly(polygon, true, transform); return this; } /** * Draws a polygon with rounded corners. * Similar to `regularPoly` but with the ability to round the corners of the polygon. * @param x - The x-coordinate of the center of the polygon. * @param y - The y-coordinate of the center of the polygon. * @param radius - The radius of the circumscribed circle of the polygon. * @param sides - The number of sides of the polygon. Must be 3 or more. * @param corner - The radius of the rounding of the corners. * @param rotation - The rotation angle of the polygon, in radians. Zero by default. * @param smoothness - Optional parameter to adjust the smoothness of the rounding. * @returns The instance of the current object for chaining. */ }, { key: "roundPoly", value: function roundPoly(x, y, radius, sides, corner) { var rotation = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; var smoothness = arguments.length > 6 ? arguments[6] : undefined; sides = Math.max(sides | 0, 3); if (corner <= 0) { return this.regularPoly(x, y, radius, sides, rotation); } var sideLength = radius * Math.sin(Math.PI / sides) - 1e-3; corner = Math.min(corner, sideLength); var startAngle = -1 * Math.PI / 2 + rotation; var delta = Math.PI * 2 / sides; var internalAngle = (sides - 2) * Math.PI / sides / 2; for (var i = 0; i < sides; i++) { var angle = i * delta + startAngle; var x0 = x + radius * Math.cos(angle); var y0 = y + radius * Math.sin(angle); var a1 = angle + Math.PI + internalAngle; var a2 = angle - Math.PI - internalAngle; var x1 = x0 + corner * Math.cos(a1); var y1 = y0 + corner * Math.sin(a1); var x3 = x0 + corner * Math.cos(a2); var y3 = y0 + corner * Math.sin(a2); if (i === 0) { this.moveTo(x1, y1); } else { this.lineTo(x1, y1); } this.quadraticCurveTo(x0, y0, x3, y3, smoothness); } return this.closePath(); } /** * Draws a shape with rounded corners. This function supports custom radius for each corner of the shape. * Optionally, corners can be rounded using a quadratic curve instead of an arc, providing a different aesthetic. * @param points - An array of `RoundedPoint` representing the corners of the shape to draw. * A minimum of 3 points is required. * @param radius - The default radius for the corners. * This radius is applied to all corners unless overridden in `points`. * @param useQuadratic - If set to true, rounded corners are drawn using a quadraticCurve * method instead of an arc method. Defaults to false. * @param smoothness - Specifies the smoothness of the curve when `useQuadratic` is true. * Higher values make the curve smoother. * @returns The instance of the current object for chaining. */ }, { key: "roundShape", value: function roundShape(points, radius) { var useQuadratic = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var smoothness = arguments.length > 3 ? arguments[3] : undefined; if (points.length < 3) { return this; } if (useQuadratic) { _roundShape.roundedShapeQuadraticCurve(this, points, radius, smoothness); } else { _roundShape.roundedShapeArc(this, points, radius); } return this.closePath(); } /** * Draw Rectangle with fillet corners. This is much like rounded rectangle * however it support negative numbers as well for the corner radius. * @param x - Upper left corner of rect * @param y - Upper right corner of rect * @param width - Width of rect * @param height - Height of rect * @param fillet - accept negative or positive values */ }, { key: "filletRect", value: function filletRect(x, y, width, height, fillet) { if (fillet === 0) { return this.rect(x, y, width, height); } var maxFillet = Math.min(width, height) / 2; var inset = Math.min(maxFillet, Math.max(-maxFillet, fillet)); var right = x + width; var bottom = y + height; var dir = inset < 0 ? -inset : 0; var size = Math.abs(inset); return this.moveTo(x, y + size).arcTo(x + dir, y + dir, x + size, y, size).lineTo(right - size, y).arcTo(right - dir, y + dir, right, y + size, size).lineTo(right, bottom - size).arcTo(right - dir, bottom - dir, x + width - size, bottom, size).lineTo(x + size, bottom).arcTo(x + dir, bottom - dir, x, bottom - size, size).closePath(); } /** * Draw Rectangle with chamfer corners. These are angled corners. * @param x - Upper left corner of rect * @param y - Upper right corner of rect * @param width - Width of rect * @param height - Height of rect * @param chamfer - non-zero real number, size of corner cutout * @param transform */ }, { key: "chamferRect", value: function chamferRect(x, y, width, height, chamfer, transform) { if (chamfer <= 0) { return this.rect(x, y, width, height); } var inset = Math.min(chamfer, Math.min(width, height) / 2); var right = x + width; var bottom = y + height; var points = [x + inset, y, right - inset, y, right, y + inset, right, bottom - inset, right - inset, bottom, x + inset, bottom, x, bottom - inset, x, y + inset]; for (var i = points.length - 1; i >= 2; i -= 2) { if (points[i] === points[i - 2] && points[i - 1] === points[i - 3]) { points.splice(i - 1, 2); } } return this.poly(points, true, transform); } /** * Draws an ellipse at the specified location and with the given x and y radii. * An optional transformation can be applied, allowing for rotation, scaling, and translation. * @param x - The x-coordinate of the center of the ellipse. * @param y - The y-coordinate of the center of the ellipse. * @param radiusX - The horizontal radius of the ellipse. * @param radiusY - The vertical radius of the ellipse. * @param transform - An optional `Matrix` object to apply a transformation to the ellipse. This can include rotations. * @returns The instance of the current object for chaining. */ }, { key: "ellipse", value: function ellipse(x, y, radiusX, radiusY, transform) { this.drawShape(new Ellipse.Ellipse(x, y, radiusX, radiusY), transform); return this; } /** * Draws a rectangle with rounded corners. * The corner radius can be specified to determine how rounded the corners should be. * An optional transformation can be applied, which allows for rotation, scaling, and translation of the rectangle. * @param x - The x-coordinate of the top-left corner of the rectangle. * @param y - The y-coordinate of the top-left corner of the rectangle. * @param w - The width of the rectangle. * @param h - The height of the rectangle. * @param radius - The radius of the rectangle's corners. If not specified, corners will be sharp. * @param transform - An optional `Matrix` object to apply a transformation to the rectangle. * @returns The instance of the current object for chaining. */ }, { key: "roundRect", value: function roundRect(x, y, w, h, radius, transform) { this.drawShape(new RoundedRectangle.RoundedRectangle(x, y, w, h, radius), transform); return this; } /** * Draws a given shape on the canvas. * This is a generic method that can draw any type of shape specified by the `ShapePrimitive` parameter. * An optional transformation matrix can be applied to the shape, allowing for complex transformations. * @param shape - The shape to draw, defined as a `ShapePrimitive` object. * @param matrix - An optional `Matrix` for transforming the shape. This can include rotations, * scaling, and translations. * @returns The instance of the current object for chaining. */ }, { key: "drawShape", value: function drawShape(shape, matrix) { this.endPoly(); this.shapePrimitives.push({ shape: shape, transform: matrix }); return this; } /** * Starts a new polygon path from the specified starting point. * This method initializes a new polygon or ends the current one if it exists. * @param x - The x-coordinate of the starting point of the new polygon. * @param y - The y-coordinate of the starting point of the new polygon. * @returns The instance of the current object for chaining. */ }, { key: "startPoly", value: function startPoly(x, y) { var currentPoly = this._currentPoly; if (currentPoly) { this.endPoly(); } currentPoly = new Polygon.Polygon(); currentPoly.points.push(x, y); this._currentPoly = currentPoly; return this; } /** * Ends the current polygon path. If `closePath` is set to true, * the path is closed by connecting the last point to the first one. * This method finalizes the current polygon and prepares it for drawing or adding to the shape primitives. * @param closePath - A boolean indicating whether to close the polygon by connecting the last point * back to the starting point. False by default. * @returns The instance of the current object for chaining. */ }, { key: "endPoly", value: function endPoly() { var closePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var shape = this._currentPoly; if (shape && shape.points.length > 2) { shape.closePath = closePath; this.shapePrimitives.push({ shape: shape }); } this._currentPoly = null; return this; } }, { key: "_ensurePoly", value: function _ensurePoly() { var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (this._currentPoly) return; this._currentPoly = new Polygon.Polygon(); if (start) { var lastShape = this.shapePrimitives[this.shapePrimitives.length - 1]; if (lastShape) { var lx = lastShape.shape.x; var ly = lastShape.shape.y; if (lastShape.transform && !lastShape.transform.isIdentity()) { var t = lastShape.transform; var tempX = lx; lx = t.a * lx + t.c * ly + t.tx; ly = t.b * tempX + t.d * ly + t.ty; } this._currentPoly.points.push(lx, ly); } else { this._currentPoly.points.push(0, 0); } } } /** Builds the path. */ }, { key: "buildPath", value: function buildPath() { var path = this._graphicsPath2D; this.shapePrimitives.length = 0; this._currentPoly = null; for (var i = 0; i < path.instructions.length; i++) { var instruction = path.instructions[i]; this[instruction.action].apply(this, _toConsumableArray(instruction.data)); } this.finish(); } /** Gets the bounds of the path. */ }, { key: "bounds", get: function get() { var bounds = this._bounds; bounds.clear(); var shapePrimitives = this.shapePrimitives; for (var i = 0; i < shapePrimitives.length; i++) { var shapePrimitive = shapePrimitives[i]; var boundsRect = shapePrimitive.shape.getBounds(tempRectangle); if (shapePrimitive.transform) { bounds.addRect(boundsRect, shapePrimitive.transform); } else { bounds.addRect(boundsRect); } } return bounds; } }]); }(); exports.ShapePath = ShapePath; /***/ }), /***/ 71075: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var createUboElementsSTD40 = __webpack_require__(86754); "use strict"; function generateArraySyncSTD40(uboElement, offsetToAdd) { var rowSize = Math.max(createUboElementsSTD40.WGSL_TO_STD40_SIZE[uboElement.data.type] / 16, 1); var elementSize = uboElement.data.value.length / uboElement.data.size; var remainder = (4 - elementSize % 4) % 4; var data = uboElement.data.type.indexOf("i32") >= 0 ? "dataInt32" : "data"; return "\n v = uv.".concat(uboElement.data.name, ";\n offset += ").concat(offsetToAdd, ";\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ").concat(uboElement.data.size * rowSize, "; i++)\n {\n for(var j = 0; j < ").concat(elementSize, "; j++)\n {\n ").concat(data, "[arrayOffset++] = v[t++];\n }\n ").concat(remainder !== 0 ? "arrayOffset += ".concat(remainder, ";") : "", "\n }\n "); } exports.generateArraySyncSTD40 = generateArraySyncSTD40; /***/ }), /***/ 71085: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _noop = _interopRequireDefault(__webpack_require__(37530)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } function Context() { /**** * * @type {"CREATE"|"PAUSE"|"RUNNING"|"STANDBY"|"DIE"|"STOP"} */ this.state = "CREATE"; /** * @type {Context} */ this.parent = null; /*** * * @type {null|ContextManager} */ this.ctxMng = null; } /** * @returns {*} */ Context.prototype.getContext = function (key) { var ctx = this; var res; while (ctx && !res) { if (ctx.ctxMng) { res = ctx.ctxMng.get(key); } ctx = ctx.parent; } return res; }; /** * @param {string} key * @param {*} value * @returns {*} */ Context.prototype.setContext = function (key, value) { return this.getContextManager().set(key, value); }; /** * @returns {ContextManager} */ Context.prototype.getContextManager = function () { var ctx = this; var res; while (ctx && !res) { if (ctx.ctxMng) { res = ctx.ctxMng; } ctx = ctx.parent; } return res; }; /** * @param {Context} parent */ Context.prototype.attach = function (parent) { //stop before attach to new context this.stop(); /** * @type {Application} */ this.parent = parent; this.onAttached && this.onAttached(); }; Context.prototype.detach = function () { this.stop(); this.onDetached && this.onDetached(); this.parent = null; }; Context.prototype.pause = function () { if (this.state.match(/RUNNING|PAUSE/)) { if (this.state === "RUNNING") { this.state = "PAUSE"; this.onPause && this.onPause(); } } else { // console.warn(this, "NOT RUNNING"); } }; Context.prototype.resume = function () { if (!this.state.match(/STANDBY|PAUSE|RUNNING/)) { // console.warn(this, 'NOT READY!', this.state); return; } if (this.state === "RUNNING") return; this.state = "RUNNING"; this.onResume && this.onResume(); }; /*** * @param {boolean=} standBy start but waiting for resume() */ Context.prototype.start = function (standBy) { if (this.state.match(/DIE/)) { // console.warn(this, 'DIED!'); return; } if (this.state.match(/RUNNING/)) return; if (this.state.match(/STOP|CREATE/)) { this.state = "STANDBY"; this.onStart && this.onStart(); } if (!standBy && this.state.match(/STANDBY|PAUSE/)) { this.resume(); } }; Context.prototype.stop = function () { if (this.state.match(/STOP|DIE|CREATE/)) return; if (this.state.match(/RUNNING/)) this.pause(); this.state = "STOP"; this.onStop && this.onStop(); }; Context.prototype.destroy = function () { if (this.state.match(/DIE/)) return; if (this.state.match(/RUNNING|PAUSE/)) this.stop(); this.state = "DIE"; this.onDestroy && this.onDestroy(); }; Context.prototype.onDestroy = _noop["default"]; Context.prototype.onStop = _noop["default"]; Context.prototype.onStart = _noop["default"]; Context.prototype.onResume = _noop["default"]; Context.prototype.onPause = _noop["default"]; Context.prototype.onDetached = _noop["default"]; Context.prototype.onAttached = _noop["default"]; var _default = exports["default"] = Context; /***/ }), /***/ 71172: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 71514: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var BitmapTextPipe = __webpack_require__(74164); "use strict"; Extensions.extensions.add(BitmapTextPipe.BitmapTextPipe); /***/ }), /***/ 71581: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Color = __webpack_require__(98828); var Extensions = __webpack_require__(86890); var pow2 = __webpack_require__(52878); var CanvasPool = __webpack_require__(88699); var TexturePool = __webpack_require__(53248); var getCanvasBoundingBox = __webpack_require__(82525); var deprecation = __webpack_require__(11225); var TextStyle = __webpack_require__(55858); var getPo2TextureFromSource = __webpack_require__(41701); var CanvasTextMetrics = __webpack_require__(1635); var fontStringFromTextStyle = __webpack_require__(30145); var getCanvasFillStyle = __webpack_require__(52179); "use strict"; var CanvasTextSystem = /*#__PURE__*/function () { function CanvasTextSystem(_renderer) { _classCallCheck(this, CanvasTextSystem); this._activeTextures = {}; this._renderer = _renderer; } return _createClass(CanvasTextSystem, [{ key: "getTextureSize", value: function getTextureSize(text, resolution, style) { var measured = CanvasTextMetrics.CanvasTextMetrics.measureText(text || " ", style); var width = Math.ceil(Math.ceil(Math.max(1, measured.width) + style.padding * 2) * resolution); var height = Math.ceil(Math.ceil(Math.max(1, measured.height) + style.padding * 2) * resolution); width = Math.ceil(width - 1e-6); height = Math.ceil(height - 1e-6); width = pow2.nextPow2(width); height = pow2.nextPow2(height); return { width: width, height: height }; } }, { key: "getTexture", value: function getTexture(options, resolution, style, _textKey) { if (typeof options === "string") { deprecation.deprecation("8.0.0", "CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"); options = { text: options, style: style, resolution: resolution }; } if (!(options.style instanceof TextStyle.TextStyle)) { options.style = new TextStyle.TextStyle(options.style); } var _this$createTextureAn = this.createTextureAndCanvas(options), texture = _this$createTextureAn.texture, canvasAndContext = _this$createTextureAn.canvasAndContext; this._renderer.texture.initSource(texture._source); CanvasPool.CanvasPool.returnCanvasAndContext(canvasAndContext); return texture; } }, { key: "createTextureAndCanvas", value: function createTextureAndCanvas(options) { var _options$resolution; var text = options.text, style = options.style; var resolution = (_options$resolution = options.resolution) !== null && _options$resolution !== void 0 ? _options$resolution : this._renderer.resolution; var measured = CanvasTextMetrics.CanvasTextMetrics.measureText(text || " ", style); var width = Math.ceil(Math.ceil(Math.max(1, measured.width) + style.padding * 2) * resolution); var height = Math.ceil(Math.ceil(Math.max(1, measured.height) + style.padding * 2) * resolution); var canvasAndContext = CanvasPool.CanvasPool.getOptimalCanvasAndContext(width, height); var canvas = canvasAndContext.canvas; this.renderTextToCanvas(text, style, resolution, canvasAndContext); var texture = getPo2TextureFromSource.getPo2TextureFromSource(canvas, width, height, resolution); if (style.trim) { var trimmed = getCanvasBoundingBox.getCanvasBoundingBox(canvas, resolution); texture.frame.copyFrom(trimmed); texture.updateUvs(); } return { texture: texture, canvasAndContext: canvasAndContext }; } }, { key: "getManagedTexture", value: function getManagedTexture(text) { text._resolution = text._autoResolution ? this._renderer.resolution : text.resolution; var textKey = text._getKey(); if (this._activeTextures[textKey]) { this._increaseReferenceCount(textKey); return this._activeTextures[textKey].texture; } var _this$createTextureAn2 = this.createTextureAndCanvas(text), texture = _this$createTextureAn2.texture, canvasAndContext = _this$createTextureAn2.canvasAndContext; this._activeTextures[textKey] = { canvasAndContext: canvasAndContext, texture: texture, usageCount: 1 }; return texture; } }, { key: "_increaseReferenceCount", value: function _increaseReferenceCount(textKey) { this._activeTextures[textKey].usageCount++; } /** * Returns a texture that was created wit the above `getTexture` function. * Handy if you are done with a texture and want to return it to the pool. * @param texture - The texture to be returned. */ }, { key: "returnTexture", value: function returnTexture(texture) { var source = texture.source; source.resource = null; source.uploadMethodId = "unknown"; source.alphaMode = "no-premultiply-alpha"; TexturePool.TexturePool.returnTexture(texture); } }, { key: "decreaseReferenceCount", value: function decreaseReferenceCount(textKey) { var activeTexture = this._activeTextures[textKey]; activeTexture.usageCount--; if (activeTexture.usageCount === 0) { CanvasPool.CanvasPool.returnCanvasAndContext(activeTexture.canvasAndContext); this.returnTexture(activeTexture.texture); this._activeTextures[textKey] = null; } } }, { key: "getReferenceCount", value: function getReferenceCount(textKey) { return this._activeTextures[textKey].usageCount; } /** * Renders text to its canvas, and updates its texture. * * By default this is used internally to ensure the texture is correct before rendering, * but it can be used called externally, for example from this class to 'pre-generate' the texture from a piece of text, * and then shared across multiple Sprites. * @param text * @param style * @param resolution * @param canvasAndContext */ }, { key: "renderTextToCanvas", value: function renderTextToCanvas(text, style, resolution, canvasAndContext) { var _style$_stroke; var canvas = canvasAndContext.canvas, context = canvasAndContext.context; var font = fontStringFromTextStyle.fontStringFromTextStyle(style); var measured = CanvasTextMetrics.CanvasTextMetrics.measureText(text || " ", style); var lines = measured.lines; var lineHeight = measured.lineHeight; var lineWidths = measured.lineWidths; var maxLineWidth = measured.maxLineWidth; var fontProperties = measured.fontProperties; var height = canvas.height; context.resetTransform(); context.scale(resolution, resolution); context.textBaseline = style.textBaseline; if ((_style$_stroke = style._stroke) !== null && _style$_stroke !== void 0 && _style$_stroke.width) { var strokeStyle = style._stroke; context.lineWidth = strokeStyle.width; context.miterLimit = strokeStyle.miterLimit; context.lineJoin = strokeStyle.join; context.lineCap = strokeStyle.cap; } context.font = font; var linePositionX; var linePositionY; var passesCount = style.dropShadow ? 2 : 1; for (var i = 0; i < passesCount; ++i) { var _style$_stroke$width, _style$_stroke3; var isShadowPass = style.dropShadow && i === 0; var dsOffsetText = isShadowPass ? Math.ceil(Math.max(1, height) + style.padding * 2) : 0; var dsOffsetShadow = dsOffsetText * resolution; if (isShadowPass) { context.fillStyle = "black"; context.strokeStyle = "black"; var shadowOptions = style.dropShadow; var dropShadowColor = shadowOptions.color; var dropShadowAlpha = shadowOptions.alpha; context.shadowColor = Color.Color.shared.setValue(dropShadowColor).setAlpha(dropShadowAlpha).toRgbaString(); var dropShadowBlur = shadowOptions.blur * resolution; var dropShadowDistance = shadowOptions.distance * resolution; context.shadowBlur = dropShadowBlur; context.shadowOffsetX = Math.cos(shadowOptions.angle) * dropShadowDistance; context.shadowOffsetY = Math.sin(shadowOptions.angle) * dropShadowDistance + dsOffsetShadow; } else { var _style$_stroke2; context.fillStyle = style._fill ? getCanvasFillStyle.getCanvasFillStyle(style._fill, context, measured) : null; if ((_style$_stroke2 = style._stroke) !== null && _style$_stroke2 !== void 0 && _style$_stroke2.width) { var padding = style._stroke.width * style._stroke.alignment; context.strokeStyle = getCanvasFillStyle.getCanvasFillStyle(style._stroke, context, measured, padding); } context.shadowColor = "black"; } var linePositionYShift = (lineHeight - fontProperties.fontSize) / 2; if (lineHeight - fontProperties.fontSize < 0) { linePositionYShift = 0; } var strokeWidth = (_style$_stroke$width = (_style$_stroke3 = style._stroke) === null || _style$_stroke3 === void 0 ? void 0 : _style$_stroke3.width) !== null && _style$_stroke$width !== void 0 ? _style$_stroke$width : 0; for (var i2 = 0; i2 < lines.length; i2++) { var _style$_stroke4; linePositionX = strokeWidth / 2; linePositionY = strokeWidth / 2 + i2 * lineHeight + fontProperties.ascent + linePositionYShift; if (style.align === "right") { linePositionX += maxLineWidth - lineWidths[i2]; } else if (style.align === "center") { linePositionX += (maxLineWidth - lineWidths[i2]) / 2; } if ((_style$_stroke4 = style._stroke) !== null && _style$_stroke4 !== void 0 && _style$_stroke4.width) { this._drawLetterSpacing(lines[i2], style, canvasAndContext, linePositionX + style.padding, linePositionY + style.padding - dsOffsetText, true); } if (style._fill !== void 0) { this._drawLetterSpacing(lines[i2], style, canvasAndContext, linePositionX + style.padding, linePositionY + style.padding - dsOffsetText); } } } } /** * Render the text with letter-spacing. * @param text - The text to draw * @param style * @param canvasAndContext * @param x - Horizontal position to draw the text * @param y - Vertical position to draw the text * @param isStroke - Is this drawing for the outside stroke of the * text? If not, it's for the inside fill */ }, { key: "_drawLetterSpacing", value: function _drawLetterSpacing(text, style, canvasAndContext, x, y) { var isStroke = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; var context = canvasAndContext.context; var letterSpacing = style.letterSpacing; var useExperimentalLetterSpacing = false; if (CanvasTextMetrics.CanvasTextMetrics.experimentalLetterSpacingSupported) { if (CanvasTextMetrics.CanvasTextMetrics.experimentalLetterSpacing) { context.letterSpacing = "".concat(letterSpacing, "px"); context.textLetterSpacing = "".concat(letterSpacing, "px"); useExperimentalLetterSpacing = true; } else { context.letterSpacing = "0px"; context.textLetterSpacing = "0px"; } } if (letterSpacing === 0 || useExperimentalLetterSpacing) { if (isStroke) { context.strokeText(text, x, y); } else { context.fillText(text, x, y); } return; } var currentPosition = x; var stringArray = CanvasTextMetrics.CanvasTextMetrics.graphemeSegmenter(text); var previousWidth = context.measureText(text).width; var currentWidth = 0; for (var i = 0; i < stringArray.length; ++i) { var currentChar = stringArray[i]; if (isStroke) { context.strokeText(currentChar, currentPosition, y); } else { context.fillText(currentChar, currentPosition, y); } var textStr = ""; for (var j = i + 1; j < stringArray.length; ++j) { textStr += stringArray[j]; } currentWidth = context.measureText(textStr).width; currentPosition += previousWidth - currentWidth + letterSpacing; previousWidth = currentWidth; } } }, { key: "destroy", value: function destroy() { this._activeTextures = null; } }]); }(); /** @ignore */ CanvasTextSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "canvasText" }; exports.CanvasTextSystem = CanvasTextSystem; /***/ }), /***/ 71717: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var maxRecommendedTextures = __webpack_require__(6899); var getTextureBatchBindGroup = __webpack_require__(62340); var compileHighShaderToProgram = __webpack_require__(97754); var colorBit = __webpack_require__(78786); var generateTextureBatchBit = __webpack_require__(96847); var localUniformBit = __webpack_require__(21654); var roundPixelsBit = __webpack_require__(35268); var Shader = __webpack_require__(27866); var UniformGroup = __webpack_require__(34400); "use strict"; var GpuGraphicsAdaptor = /*#__PURE__*/function () { function GpuGraphicsAdaptor() { _classCallCheck(this, GpuGraphicsAdaptor); } return _createClass(GpuGraphicsAdaptor, [{ key: "init", value: function init() { var localUniforms = new UniformGroup.UniformGroup({ uTransformMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" }, uRound: { value: 0, type: "f32" } }); var gpuProgram = compileHighShaderToProgram.compileHighShaderGpuProgram({ name: "graphics", bits: [colorBit.colorBit, generateTextureBatchBit.generateTextureBatchBit(maxRecommendedTextures.getMaxTexturesPerBatch()), localUniformBit.localUniformBitGroup2, roundPixelsBit.roundPixelsBit] }); this.shader = new Shader.Shader({ gpuProgram: gpuProgram, resources: { // added on the fly! localUniforms: localUniforms } }); } }, { key: "execute", value: function execute(graphicsPipe, renderable) { var context = renderable.context; var shader = context.customShader || this.shader; var renderer = graphicsPipe.renderer; var contextSystem = renderer.graphicsContext; var _contextSystem$getCon = contextSystem.getContextRenderData(context), batcher = _contextSystem$getCon.batcher, instructions = _contextSystem$getCon.instructions; var encoder = renderer.encoder; encoder.setGeometry(batcher.geometry, shader.gpuProgram); var globalUniformsBindGroup = renderer.globalUniforms.bindGroup; encoder.setBindGroup(0, globalUniformsBindGroup, shader.gpuProgram); var localBindGroup = renderer.renderPipes.uniformBatch.getUniformBindGroup(shader.resources.localUniforms, true); encoder.setBindGroup(2, localBindGroup, shader.gpuProgram); var batches = instructions.instructions; var topology = null; for (var i = 0; i < instructions.instructionSize; i++) { var batch = batches[i]; if (batch.topology !== topology) { topology = batch.topology; encoder.setPipelineFromGeometryProgramAndState(batcher.geometry, shader.gpuProgram, graphicsPipe.state, batch.topology); } shader.groups[1] = batch.bindGroup; if (!batch.gpuBindGroup) { var textureBatch = batch.textures; batch.bindGroup = getTextureBatchBindGroup.getTextureBatchBindGroup(textureBatch.textures, textureBatch.count); batch.gpuBindGroup = renderer.bindGroup.getBindGroup(batch.bindGroup, shader.gpuProgram, 1); } encoder.setBindGroup(1, batch.bindGroup, shader.gpuProgram); encoder.renderPassEncoder.drawIndexed(batch.size, 1, batch.start); } } }, { key: "destroy", value: function destroy() { this.shader.destroy(true); this.shader = null; } }]); }(); /** @ignore */ GpuGraphicsAdaptor.extension = { type: [Extensions.ExtensionType.WebGPUPipesAdaptor], name: "graphics" }; exports.GpuGraphicsAdaptor = GpuGraphicsAdaptor; /***/ }), /***/ 72059: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var UniformGroup = __webpack_require__(34400); "use strict"; var batchSamplersUniformGroupHash = {}; function getBatchSamplersUniformGroup(maxTextures) { var batchSamplersUniformGroup = batchSamplersUniformGroupHash[maxTextures]; if (batchSamplersUniformGroup) return batchSamplersUniformGroup; var sampleValues = new Int32Array(maxTextures); for (var i = 0; i < maxTextures; i++) { sampleValues[i] = i; } batchSamplersUniformGroup = batchSamplersUniformGroupHash[maxTextures] = new UniformGroup.UniformGroup({ uTextures: { value: sampleValues, type: "i32", size: maxTextures } }, { isStatic: true }); return batchSamplersUniformGroup; } exports.getBatchSamplersUniformGroup = getBatchSamplersUniformGroup; /***/ }), /***/ 72076: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Spritesheet = __webpack_require__(68216); var spritesheetAsset = __webpack_require__(44622); "use strict"; exports.Spritesheet = Spritesheet.Spritesheet; exports.spritesheetAsset = spritesheetAsset.spritesheetAsset; /***/ }), /***/ 72360: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var generateUniformsSync = __webpack_require__(19114); "use strict"; var GlUniformGroupSystem = /*#__PURE__*/function () { /** @param renderer - The renderer this System works for. */ function GlUniformGroupSystem(renderer) { _classCallCheck(this, GlUniformGroupSystem); /** Cache to holds the generated functions. Stored against UniformObjects unique signature. */ this._cache = {}; this._uniformGroupSyncHash = {}; this._renderer = renderer; this.gl = null; this._cache = {}; } return _createClass(GlUniformGroupSystem, [{ key: "contextChange", value: function contextChange(gl) { this.gl = gl; } /** * Uploads the uniforms values to the currently bound shader. * @param group - the uniforms values that be applied to the current shader * @param program * @param syncData * @param syncData.textureCount */ }, { key: "updateUniformGroup", value: function updateUniformGroup(group, program, syncData) { var programData = this._renderer.shader._getProgramData(program); if (!group.isStatic || group._dirtyId !== programData.uniformDirtyGroups[group.uid]) { programData.uniformDirtyGroups[group.uid] = group._dirtyId; var syncFunc = this._getUniformSyncFunction(group, program); syncFunc(programData.uniformData, group.uniforms, this._renderer, syncData); } } /** * Overridable by the pixi.js/unsafe-eval package to use static syncUniforms instead. * @param group * @param program */ }, { key: "_getUniformSyncFunction", value: function _getUniformSyncFunction(group, program) { var _this$_uniformGroupSy; return ((_this$_uniformGroupSy = this._uniformGroupSyncHash[group._signature]) === null || _this$_uniformGroupSy === void 0 ? void 0 : _this$_uniformGroupSy[program._key]) || this._createUniformSyncFunction(group, program); } }, { key: "_createUniformSyncFunction", value: function _createUniformSyncFunction(group, program) { var uniformGroupSyncHash = this._uniformGroupSyncHash[group._signature] || (this._uniformGroupSyncHash[group._signature] = {}); var id = this._getSignature(group, program._uniformData, "u"); if (!this._cache[id]) { this._cache[id] = this._generateUniformsSync(group, program._uniformData); } uniformGroupSyncHash[program._key] = this._cache[id]; return uniformGroupSyncHash[program._key]; } }, { key: "_generateUniformsSync", value: function _generateUniformsSync(group, uniformData) { return generateUniformsSync.generateUniformsSync(group, uniformData); } /** * Takes a uniform group and data and generates a unique signature for them. * @param group - The uniform group to get signature of * @param group.uniforms * @param uniformData - Uniform information generated by the shader * @param preFix * @returns Unique signature of the uniform group */ }, { key: "_getSignature", value: function _getSignature(group, uniformData, preFix) { var uniforms = group.uniforms; var strings = ["".concat(preFix, "-")]; for (var i in uniforms) { strings.push(i); if (uniformData[i]) { strings.push(uniformData[i].type); } } return strings.join("-"); } /** Destroys this System and removes all its textures. */ }, { key: "destroy", value: function destroy() { this._renderer = null; this._cache = null; } }]); }(); /** @ignore */ GlUniformGroupSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "uniformGroup" }; exports.GlUniformGroupSystem = GlUniformGroupSystem; /***/ }), /***/ 72450: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var BrowserAdapter = __webpack_require__(24509); "use strict"; var currentAdapter = BrowserAdapter.BrowserAdapter; var DOMAdapter = { /** * Returns the current adapter. * @returns {environment.Adapter} The current adapter. */ get: function get() { return currentAdapter; }, /** * Sets the current adapter. * @param adapter - The new adapter. */ set: function set(adapter) { currentAdapter = adapter; } }; exports.DOMAdapter = DOMAdapter; /***/ }), /***/ 72521: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var vertex = "in vec2 aPosition;\n\nout vec2 vTextureCoord;\nout vec2 vMaskCoord;\n\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\nuniform mat3 uFilterMatrix;\n\nvec4 filterVertexPosition( vec2 aPosition )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( vec2 aPosition )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvec2 getFilterCoord( vec2 aPosition )\n{\n return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n} \n\nvoid main(void)\n{\n gl_Position = filterVertexPosition(aPosition);\n vTextureCoord = filterTextureCoord(aPosition);\n vMaskCoord = getFilterCoord(aPosition);\n}\n"; exports["default"] = vertex; /***/ }), /***/ 72989: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var MeshGeometry = __webpack_require__(56451); "use strict"; var _RopeGeometry = /*#__PURE__*/function (_MeshGeometry$MeshGeo) { /** * @param options - Options to be applied to rope geometry */ function _RopeGeometry(options) { var _this; _classCallCheck(this, _RopeGeometry); var _RopeGeometry$default = _objectSpread(_objectSpread({}, _RopeGeometry.defaultOptions), options), width = _RopeGeometry$default.width, points = _RopeGeometry$default.points, textureScale = _RopeGeometry$default.textureScale; _this = _callSuper(this, _RopeGeometry, [{ positions: new Float32Array(points.length * 4), uvs: new Float32Array(points.length * 4), indices: new Uint32Array((points.length - 1) * 6) }]); _this.points = points; _this._width = width; _this.textureScale = textureScale; _this._build(); return _this; } /** * The width (i.e., thickness) of the rope. * @readonly */ _inherits(_RopeGeometry, _MeshGeometry$MeshGeo); return _createClass(_RopeGeometry, [{ key: "width", get: function get() { return this._width; } /** Refreshes Rope indices and uvs */ }, { key: "_build", value: function _build() { var points = this.points; if (!points) return; var vertexBuffer = this.getBuffer("aPosition"); var uvBuffer = this.getBuffer("aUV"); var indexBuffer = this.getIndex(); if (points.length < 1) { return; } if (vertexBuffer.data.length / 4 !== points.length) { vertexBuffer.data = new Float32Array(points.length * 4); uvBuffer.data = new Float32Array(points.length * 4); indexBuffer.data = new Uint16Array((points.length - 1) * 6); } var uvs = uvBuffer.data; var indices = indexBuffer.data; uvs[0] = 0; uvs[1] = 0; uvs[2] = 0; uvs[3] = 1; var amount = 0; var prev = points[0]; var textureWidth = this._width * this.textureScale; var total = points.length; for (var i = 0; i < total; i++) { var index = i * 4; if (this.textureScale > 0) { var dx = prev.x - points[i].x; var dy = prev.y - points[i].y; var distance = Math.sqrt(dx * dx + dy * dy); prev = points[i]; amount += distance / textureWidth; } else { amount = i / (total - 1); } uvs[index] = amount; uvs[index + 1] = 0; uvs[index + 2] = amount; uvs[index + 3] = 1; } var indexCount = 0; for (var _i = 0; _i < total - 1; _i++) { var _index = _i * 2; indices[indexCount++] = _index; indices[indexCount++] = _index + 1; indices[indexCount++] = _index + 2; indices[indexCount++] = _index + 2; indices[indexCount++] = _index + 1; indices[indexCount++] = _index + 3; } uvBuffer.update(); indexBuffer.update(); this.updateVertices(); } /** refreshes vertices of Rope mesh */ }, { key: "updateVertices", value: function updateVertices() { var points = this.points; if (points.length < 1) { return; } var lastPoint = points[0]; var nextPoint; var perpX = 0; var perpY = 0; var vertices = this.buffers[0].data; var total = points.length; var halfWidth = this.textureScale > 0 ? this.textureScale * this._width / 2 : this._width / 2; for (var i = 0; i < total; i++) { var point = points[i]; var index = i * 4; if (i < points.length - 1) { nextPoint = points[i + 1]; } else { nextPoint = point; } perpY = -(nextPoint.x - lastPoint.x); perpX = nextPoint.y - lastPoint.y; var ratio = (1 - i / (total - 1)) * 10; if (ratio > 1) { ratio = 1; } var perpLength = Math.sqrt(perpX * perpX + perpY * perpY); if (perpLength < 1e-6) { perpX = 0; perpY = 0; } else { perpX /= perpLength; perpY /= perpLength; perpX *= halfWidth; perpY *= halfWidth; } vertices[index] = point.x + perpX; vertices[index + 1] = point.y + perpY; vertices[index + 2] = point.x - perpX; vertices[index + 3] = point.y - perpY; lastPoint = point; } this.buffers[0].update(); } /** Refreshes Rope indices and uvs */ }, { key: "update", value: function update() { if (this.textureScale > 0) { this._build(); } else { this.updateVertices(); } } }]); }(MeshGeometry.MeshGeometry); /** Default options for RopeGeometry constructor. */ _RopeGeometry.defaultOptions = { /** The width (i.e., thickness) of the rope. */ width: 200, /** An array of points that determine the rope. */ points: [], /** Rope texture scale, if zero then the rope texture is stretched. */ textureScale: 0 }; var RopeGeometry = _RopeGeometry; exports.RopeGeometry = RopeGeometry; /***/ }), /***/ 73155: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var FilterEffect = __webpack_require__(51856); var warn = __webpack_require__(57371); "use strict"; var BLEND_MODE_FILTERS = {}; Extensions.extensions.handle(Extensions.ExtensionType.BlendMode, function (value) { if (!value.name) { throw new Error("BlendMode extension must have a name property"); } BLEND_MODE_FILTERS[value.name] = value.ref; }, function (value) { delete BLEND_MODE_FILTERS[value.name]; }); var BlendModePipe = /*#__PURE__*/function () { function BlendModePipe(renderer) { _classCallCheck(this, BlendModePipe); this._isAdvanced = false; this._filterHash = /* @__PURE__ */Object.create(null); this._renderer = renderer; this._renderer.runners.prerender.add(this); } return _createClass(BlendModePipe, [{ key: "prerender", value: function prerender() { this._activeBlendMode = "normal"; this._isAdvanced = false; } /** * This ensures that a blendMode switch is added to the instruction set if the blend mode has changed. * @param renderable - The renderable we are adding to the instruction set * @param blendMode - The blend mode of the renderable * @param instructionSet - The instruction set we are adding to */ }, { key: "setBlendMode", value: function setBlendMode(renderable, blendMode, instructionSet) { if (this._activeBlendMode === blendMode) { if (this._isAdvanced) this._renderableList.push(renderable); return; } this._activeBlendMode = blendMode; if (this._isAdvanced) { this._endAdvancedBlendMode(instructionSet); } this._isAdvanced = !!BLEND_MODE_FILTERS[blendMode]; if (this._isAdvanced) { this._beginAdvancedBlendMode(instructionSet); this._renderableList.push(renderable); } } }, { key: "_beginAdvancedBlendMode", value: function _beginAdvancedBlendMode(instructionSet) { this._renderer.renderPipes.batch["break"](instructionSet); var blendMode = this._activeBlendMode; if (!BLEND_MODE_FILTERS[blendMode]) { warn.warn("Unable to assign BlendMode: '".concat(blendMode, "'. You may want to include: import 'pixi.js/advanced-blend-modes'")); return; } var filterEffect = this._filterHash[blendMode]; if (!filterEffect) { filterEffect = this._filterHash[blendMode] = new FilterEffect.FilterEffect(); filterEffect.filters = [new BLEND_MODE_FILTERS[blendMode]()]; } var instruction = { renderPipeId: "filter", action: "pushFilter", renderables: [], filterEffect: filterEffect, canBundle: false }; this._renderableList = instruction.renderables; instructionSet.add(instruction); } }, { key: "_endAdvancedBlendMode", value: function _endAdvancedBlendMode(instructionSet) { this._renderableList = null; this._renderer.renderPipes.batch["break"](instructionSet); instructionSet.add({ renderPipeId: "filter", action: "popFilter", canBundle: false }); } /** * called when the instruction build process is starting this will reset internally to the default blend mode * @internal * @ignore */ }, { key: "buildStart", value: function buildStart() { this._isAdvanced = false; } /** * called when the instruction build process is finished, ensuring that if there is an advanced blend mode * active, we add the final render instructions added to the instruction set * @param instructionSet - The instruction set we are adding to * @internal * @ignore */ }, { key: "buildEnd", value: function buildEnd(instructionSet) { if (this._isAdvanced) { this._endAdvancedBlendMode(instructionSet); } } /** * @internal * @ignore */ }, { key: "destroy", value: function destroy() { this._renderer = null; this._renderableList = null; for (var i in this._filterHash) { this._filterHash[i].destroy(); } this._filterHash = null; } }]); }(); /** @ignore */ BlendModePipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "blendMode" }; exports.BlendModePipe = BlendModePipe; /***/ }), /***/ 73169: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Resolver = __webpack_require__(54080); var checkExtension = __webpack_require__(59230); var Extensions = __webpack_require__(86890); "use strict"; var validFormats = ["basis", "bc7", "bc6h", "astc", "etc2", "bc5", "bc4", "bc3", "bc2", "bc1", "eac"]; var resolveCompressedTextureUrl = { extension: Extensions.ExtensionType.ResolveParser, test: function test(value) { return checkExtension.checkExtension(value, [".ktx", ".ktx2", ".dds"]); }, parse: function parse(value) { var _Resolver$Resolver$RE, _Resolver$Resolver$RE2; var format; var splitValue = value.split("."); if (splitValue.length > 2) { var newFormat = splitValue[splitValue.length - 2]; if (validFormats.includes(newFormat)) { format = newFormat; } } else { format = splitValue[splitValue.length - 1]; } return { resolution: parseFloat((_Resolver$Resolver$RE = (_Resolver$Resolver$RE2 = Resolver.Resolver.RETINA_PREFIX.exec(value)) === null || _Resolver$Resolver$RE2 === void 0 ? void 0 : _Resolver$Resolver$RE2[1]) !== null && _Resolver$Resolver$RE !== void 0 ? _Resolver$Resolver$RE : "1"), format: format, src: value }; } }; exports.resolveCompressedTextureUrl = resolveCompressedTextureUrl; exports.validFormats = validFormats; /***/ }), /***/ 73616: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Point = __webpack_require__(75544); var FederatedEvent = __webpack_require__(42961); "use strict"; var FederatedMouseEvent = /*#__PURE__*/function (_FederatedEvent$Feder) { function FederatedMouseEvent() { var _this; _classCallCheck(this, FederatedMouseEvent); _this = _callSuper(this, FederatedMouseEvent, arguments); /** The coordinates of the mouse event relative to the canvas. */ _this.client = new Point.Point(); /** The movement in this pointer relative to the last `mousemove` event. */ _this.movement = new Point.Point(); /** The offset of the pointer coordinates w.r.t. target Container in world space. This is not supported at the moment. */ _this.offset = new Point.Point(); /** The pointer coordinates in world space. */ _this.global = new Point.Point(); /** * The pointer coordinates in the renderer's {@link Renderer.screen screen}. This has slightly * different semantics than native PointerEvent screenX/screenY. */ _this.screen = new Point.Point(); return _this; } /** @readonly */ _inherits(FederatedMouseEvent, _FederatedEvent$Feder); return _createClass(FederatedMouseEvent, [{ key: "clientX", get: function get() { return this.client.x; } /** @readonly */ }, { key: "clientY", get: function get() { return this.client.y; } /** * Alias for {@link FederatedMouseEvent.clientX this.clientX}. * @readonly */ }, { key: "x", get: function get() { return this.clientX; } /** * Alias for {@link FederatedMouseEvent.clientY this.clientY}. * @readonly */ }, { key: "y", get: function get() { return this.clientY; } /** @readonly */ }, { key: "movementX", get: function get() { return this.movement.x; } /** @readonly */ }, { key: "movementY", get: function get() { return this.movement.y; } /** @readonly */ }, { key: "offsetX", get: function get() { return this.offset.x; } /** @readonly */ }, { key: "offsetY", get: function get() { return this.offset.y; } /** @readonly */ }, { key: "globalX", get: function get() { return this.global.x; } /** @readonly */ }, { key: "globalY", get: function get() { return this.global.y; } /** * The pointer coordinates in the renderer's screen. Alias for {@code screen.x}. * @readonly */ }, { key: "screenX", get: function get() { return this.screen.x; } /** * The pointer coordinates in the renderer's screen. Alias for {@code screen.y}. * @readonly */ }, { key: "screenY", get: function get() { return this.screen.y; } /** * This will return the local coordinates of the specified container for this InteractionData * @param {Container} container - The Container that you would like the local * coords off * @param {PointData} point - A Point object in which to store the value, optional (otherwise * will create a new point) * @param {PointData} globalPos - A Point object containing your custom global coords, optional * (otherwise will use the current global coords) * @returns - A point containing the coordinates of the InteractionData position relative * to the Container */ }, { key: "getLocalPosition", value: function getLocalPosition(container, point, globalPos) { return container.worldTransform.applyInverse(globalPos || this.global, point); } /** * Whether the modifier key was pressed when this event natively occurred. * @param key - The modifier key. */ }, { key: "getModifierState", value: function getModifierState(key) { return "getModifierState" in this.nativeEvent && this.nativeEvent.getModifierState(key); } /** * Not supported. * @param _typeArg * @param _canBubbleArg * @param _cancelableArg * @param _viewArg * @param _detailArg * @param _screenXArg * @param _screenYArg * @param _clientXArg * @param _clientYArg * @param _ctrlKeyArg * @param _altKeyArg * @param _shiftKeyArg * @param _metaKeyArg * @param _buttonArg * @param _relatedTargetArg * @deprecated since 7.0.0 */ // eslint-disable-next-line max-params }, { key: "initMouseEvent", value: function initMouseEvent(_typeArg, _canBubbleArg, _cancelableArg, _viewArg, _detailArg, _screenXArg, _screenYArg, _clientXArg, _clientYArg, _ctrlKeyArg, _altKeyArg, _shiftKeyArg, _metaKeyArg, _buttonArg, _relatedTargetArg) { throw new Error("Method not implemented."); } }]); }(FederatedEvent.FederatedEvent); exports.FederatedMouseEvent = FederatedMouseEvent; /***/ }), /***/ 73707: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var PoolGroup = __webpack_require__(47505); var BatchableSprite = __webpack_require__(42517); "use strict"; var SpritePipe = /*#__PURE__*/function () { function SpritePipe(renderer) { _classCallCheck(this, SpritePipe); this._gpuSpriteHash = /* @__PURE__ */Object.create(null); this._destroyRenderableBound = this.destroyRenderable.bind(this); this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_gpuSpriteHash"); } return _createClass(SpritePipe, [{ key: "addRenderable", value: function addRenderable(sprite, instructionSet) { var gpuSprite = this._getGpuSprite(sprite); if (sprite.didViewUpdate) this._updateBatchableSprite(sprite, gpuSprite); this._renderer.renderPipes.batch.addToBatch(gpuSprite, instructionSet); } }, { key: "updateRenderable", value: function updateRenderable(sprite) { var gpuSprite = this._gpuSpriteHash[sprite.uid]; if (sprite.didViewUpdate) this._updateBatchableSprite(sprite, gpuSprite); gpuSprite._batcher.updateElement(gpuSprite); } }, { key: "validateRenderable", value: function validateRenderable(sprite) { var gpuSprite = this._getGpuSprite(sprite); return !gpuSprite._batcher.checkAndUpdateTexture(gpuSprite, sprite._texture); } }, { key: "destroyRenderable", value: function destroyRenderable(sprite) { var batchableSprite = this._gpuSpriteHash[sprite.uid]; PoolGroup.BigPool["return"](batchableSprite); this._gpuSpriteHash[sprite.uid] = null; sprite.off("destroyed", this._destroyRenderableBound); } }, { key: "_updateBatchableSprite", value: function _updateBatchableSprite(sprite, batchableSprite) { batchableSprite.bounds = sprite.visualBounds; batchableSprite.texture = sprite._texture; } }, { key: "_getGpuSprite", value: function _getGpuSprite(sprite) { return this._gpuSpriteHash[sprite.uid] || this._initGPUSprite(sprite); } }, { key: "_initGPUSprite", value: function _initGPUSprite(sprite) { var batchableSprite = PoolGroup.BigPool.get(BatchableSprite.BatchableSprite); batchableSprite.renderable = sprite; batchableSprite.transform = sprite.groupTransform; batchableSprite.texture = sprite._texture; batchableSprite.bounds = sprite.visualBounds; batchableSprite.roundPixels = this._renderer._roundPixels | sprite._roundPixels; this._gpuSpriteHash[sprite.uid] = batchableSprite; sprite.on("destroyed", this._destroyRenderableBound); return batchableSprite; } }, { key: "destroy", value: function destroy() { for (var i in this._gpuSpriteHash) { PoolGroup.BigPool["return"](this._gpuSpriteHash[i]); } this._gpuSpriteHash = null; this._renderer = null; } }]); }(); /** @ignore */ SpritePipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "sprite" }; exports.SpritePipe = SpritePipe; /***/ }), /***/ 73782: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var EventEmitter = __webpack_require__(19497); var groupD8 = __webpack_require__(56018); var Rectangle = __webpack_require__(74731); var uid = __webpack_require__(90844); var deprecation = __webpack_require__(11225); var NOOP = __webpack_require__(6036); var BufferImageSource = __webpack_require__(56634); var TextureSource = __webpack_require__(55406); var TextureMatrix = __webpack_require__(82467); "use strict"; var Texture = /*#__PURE__*/function (_EventEmitter) { /** * @param {rendering.TextureOptions} options - Options for the texture */ function Texture() { var _source$source; var _this; var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, source = _ref.source, label = _ref.label, frame = _ref.frame, orig = _ref.orig, trim = _ref.trim, defaultAnchor = _ref.defaultAnchor, defaultBorders = _ref.defaultBorders, rotate = _ref.rotate, dynamic = _ref.dynamic; _classCallCheck(this, Texture); _this = _callSuper(this, Texture); /** unique id for this texture */ _this.uid = uid.uid("texture"); /** A uvs object based on the given frame and the texture source */ _this.uvs = { x0: 0, y0: 0, x1: 0, y1: 0, x2: 0, y2: 0, x3: 0, y3: 0 }; /** * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) */ _this.frame = new Rectangle.Rectangle(); /** * Does this Texture have any frame data assigned to it? * * This mode is enabled automatically if no frame was passed inside constructor. * * In this mode texture is subscribed to baseTexture events, and fires `update` on any change. * * Beware, after loading or resize of baseTexture event can fired two times! * If you want more control, subscribe on baseTexture itself. * @example * texture.on('update', () => {}); */ _this.noFrame = false; /** * Set to true if you plan on modifying the uvs of this texture. * When this is the case, sprites and other objects using the texture will * make sure to listen for changes to the uvs and update their vertices accordingly. */ _this.dynamic = false; /** is it a texture? yes! used for type checking */ _this.isTexture = true; _this.label = label; _this.source = (_source$source = source === null || source === void 0 ? void 0 : source.source) !== null && _source$source !== void 0 ? _source$source : new TextureSource.TextureSource(); _this.noFrame = !frame; if (frame) { _this.frame.copyFrom(frame); } else { var _this$_source = _this._source, width = _this$_source.width, height = _this$_source.height; _this.frame.width = width; _this.frame.height = height; } _this.orig = orig || _this.frame; _this.trim = trim; _this.rotate = rotate !== null && rotate !== void 0 ? rotate : 0; _this.defaultAnchor = defaultAnchor; _this.defaultBorders = defaultBorders; _this.destroyed = false; _this.dynamic = dynamic || false; _this.updateUvs(); return _this; } _inherits(Texture, _EventEmitter); return _createClass(Texture, [{ key: "source", get: /** the underlying source of the texture (equivalent of baseTexture in v7) */ function get() { return this._source; } /** returns a TextureMatrix instance for this texture. By default, that object is not created because its heavy. */, set: function set(value) { if (this._source) { this._source.off("resize", this.update, this); } this._source = value; value.on("resize", this.update, this); this.emit("update", this); } }, { key: "textureMatrix", get: function get() { if (!this._textureMatrix) { this._textureMatrix = new TextureMatrix.TextureMatrix(this); } return this._textureMatrix; } /** The width of the Texture in pixels. */ }, { key: "width", get: function get() { return this.orig.width; } /** The height of the Texture in pixels. */ }, { key: "height", get: function get() { return this.orig.height; } /** Call this function when you have modified the frame of this texture. */ }, { key: "updateUvs", value: function updateUvs() { var uvs = this.uvs, frame = this.frame; var _this$_source2 = this._source, width = _this$_source2.width, height = _this$_source2.height; var nX = frame.x / width; var nY = frame.y / height; var nW = frame.width / width; var nH = frame.height / height; var rotate = this.rotate; if (rotate) { var w2 = nW / 2; var h2 = nH / 2; var cX = nX + w2; var cY = nY + h2; rotate = groupD8.groupD8.add(rotate, groupD8.groupD8.NW); uvs.x0 = cX + w2 * groupD8.groupD8.uX(rotate); uvs.y0 = cY + h2 * groupD8.groupD8.uY(rotate); rotate = groupD8.groupD8.add(rotate, 2); uvs.x1 = cX + w2 * groupD8.groupD8.uX(rotate); uvs.y1 = cY + h2 * groupD8.groupD8.uY(rotate); rotate = groupD8.groupD8.add(rotate, 2); uvs.x2 = cX + w2 * groupD8.groupD8.uX(rotate); uvs.y2 = cY + h2 * groupD8.groupD8.uY(rotate); rotate = groupD8.groupD8.add(rotate, 2); uvs.x3 = cX + w2 * groupD8.groupD8.uX(rotate); uvs.y3 = cY + h2 * groupD8.groupD8.uY(rotate); } else { uvs.x0 = nX; uvs.y0 = nY; uvs.x1 = nX + nW; uvs.y1 = nY; uvs.x2 = nX + nW; uvs.y2 = nY + nH; uvs.x3 = nX; uvs.y3 = nY + nH; } } /** * Destroys this texture * @param destroySource - Destroy the source when the texture is destroyed. */ }, { key: "destroy", value: function destroy() { var destroySource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (this._source) { if (destroySource) { this._source.destroy(); this._source = null; } } this._textureMatrix = null; this.destroyed = true; this.emit("destroy", this); this.removeAllListeners(); } /** * Call this if you have modified the `texture outside` of the constructor. * * If you have modified this texture's source, you must separately call `texture.source.update()` to see those changes. */ }, { key: "update", value: function update() { if (this.noFrame) { this.frame.width = this._source.width; this.frame.height = this._source.height; } this.updateUvs(); this.emit("update", this); } /** @deprecated since 8.0.0 */ }, { key: "baseTexture", get: function get() { deprecation.deprecation(deprecation.v8_0_0, "Texture.baseTexture is now Texture.source"); return this._source; } }]); }(EventEmitter); Texture.EMPTY = new Texture({ label: "EMPTY", source: new TextureSource.TextureSource({ label: "EMPTY" }) }); Texture.EMPTY.destroy = NOOP.NOOP; Texture.WHITE = new Texture({ source: new BufferImageSource.BufferImageSource({ resource: new Uint8Array([255, 255, 255, 255]), width: 1, height: 1, alphaMode: "premultiply-alpha-on-upload", label: "WHITE" }), label: "WHITE" }); Texture.WHITE.destroy = NOOP.NOOP; exports.Texture = Texture; /***/ }), /***/ 73803: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var ViewableBuffer = /*#__PURE__*/function () { function ViewableBuffer(sizeOrBuffer) { _classCallCheck(this, ViewableBuffer); if (typeof sizeOrBuffer === "number") { this.rawBinaryData = new ArrayBuffer(sizeOrBuffer); } else if (sizeOrBuffer instanceof Uint8Array) { this.rawBinaryData = sizeOrBuffer.buffer; } else { this.rawBinaryData = sizeOrBuffer; } this.uint32View = new Uint32Array(this.rawBinaryData); this.float32View = new Float32Array(this.rawBinaryData); this.size = this.rawBinaryData.byteLength; } /** View on the raw binary data as a `Int8Array`. */ return _createClass(ViewableBuffer, [{ key: "int8View", get: function get() { if (!this._int8View) { this._int8View = new Int8Array(this.rawBinaryData); } return this._int8View; } /** View on the raw binary data as a `Uint8Array`. */ }, { key: "uint8View", get: function get() { if (!this._uint8View) { this._uint8View = new Uint8Array(this.rawBinaryData); } return this._uint8View; } /** View on the raw binary data as a `Int16Array`. */ }, { key: "int16View", get: function get() { if (!this._int16View) { this._int16View = new Int16Array(this.rawBinaryData); } return this._int16View; } /** View on the raw binary data as a `Int32Array`. */ }, { key: "int32View", get: function get() { if (!this._int32View) { this._int32View = new Int32Array(this.rawBinaryData); } return this._int32View; } /** View on the raw binary data as a `Float64Array`. */ }, { key: "float64View", get: function get() { if (!this._float64Array) { this._float64Array = new Float64Array(this.rawBinaryData); } return this._float64Array; } /** View on the raw binary data as a `BigUint64Array`. */ }, { key: "bigUint64View", get: function get() { if (!this._bigUint64Array) { this._bigUint64Array = new BigUint64Array(this.rawBinaryData); } return this._bigUint64Array; } /** * Returns the view of the given type. * @param type - One of `int8`, `uint8`, `int16`, * `uint16`, `int32`, `uint32`, and `float32`. * @returns - typed array of given type */ }, { key: "view", value: function view(type) { return this["".concat(type, "View")]; } /** Destroys all buffer references. Do not use after calling this. */ }, { key: "destroy", value: function destroy() { this.rawBinaryData = null; this._int8View = null; this._uint8View = null; this._int16View = null; this.uint16View = null; this._int32View = null; this.uint32View = null; this.float32View = null; } /** * Returns the size of the given type in bytes. * @param type - One of `int8`, `uint8`, `int16`, * `uint16`, `int32`, `uint32`, and `float32`. * @returns - size of the type in bytes */ }], [{ key: "sizeOf", value: function sizeOf(type) { switch (type) { case "int8": case "uint8": return 1; case "int16": case "uint16": return 2; case "int32": case "uint32": case "float32": return 4; default: throw new Error("".concat(type, " isn't a valid view type")); } } }]); }(); exports.ViewableBuffer = ViewableBuffer; /***/ }), /***/ 73893: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var gpuFormatToBasisTranscoderFormatMap = { "bc3-rgba-unorm": 3, // cTFBC3_RGBA "bc7-rgba-unorm": 6, // cTFBC7_RGBA, "etc2-rgba8unorm": 1, // cTFETC2_RGBA, "astc-4x4-unorm": 10, // cTFASTC_4x4_RGBA, // Uncompressed rgba8unorm: 13, // cTFRGBA32, rgba4unorm: 16 // cTFRGBA4444, }; function gpuFormatToBasisTranscoderFormat(transcoderFormat) { var format = gpuFormatToBasisTranscoderFormatMap[transcoderFormat]; if (format) { return format; } throw new Error("Unsupported transcoderFormat: ".concat(transcoderFormat)); } exports.gpuFormatToBasisTranscoderFormat = gpuFormatToBasisTranscoderFormat; /***/ }), /***/ 74164: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Cache = __webpack_require__(65278); var Extensions = __webpack_require__(86890); var PoolGroup = __webpack_require__(47505); var Graphics = __webpack_require__(82323); var SdfShader = __webpack_require__(10377); var BitmapFontManager = __webpack_require__(30815); var getBitmapTextLayout = __webpack_require__(41914); "use strict"; var BitmapTextPipe = /*#__PURE__*/function () { function BitmapTextPipe(renderer) { _classCallCheck(this, BitmapTextPipe); this._gpuBitmapText = {}; this._destroyRenderableBound = this.destroyRenderable.bind(this); this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_gpuBitmapText"); } return _createClass(BitmapTextPipe, [{ key: "validateRenderable", value: function validateRenderable(bitmapText) { var graphicsRenderable = this._getGpuBitmapText(bitmapText); if (bitmapText._didTextUpdate) { bitmapText._didTextUpdate = false; this._updateContext(bitmapText, graphicsRenderable); } return this._renderer.renderPipes.graphics.validateRenderable(graphicsRenderable); } }, { key: "addRenderable", value: function addRenderable(bitmapText, instructionSet) { var graphicsRenderable = this._getGpuBitmapText(bitmapText); syncWithProxy(bitmapText, graphicsRenderable); if (bitmapText._didTextUpdate) { bitmapText._didTextUpdate = false; this._updateContext(bitmapText, graphicsRenderable); } this._renderer.renderPipes.graphics.addRenderable(graphicsRenderable, instructionSet); if (graphicsRenderable.context.customShader) { this._updateDistanceField(bitmapText); } } }, { key: "destroyRenderable", value: function destroyRenderable(bitmapText) { bitmapText.off("destroyed", this._destroyRenderableBound); this._destroyRenderableByUid(bitmapText.uid); } }, { key: "_destroyRenderableByUid", value: function _destroyRenderableByUid(renderableUid) { var context = this._gpuBitmapText[renderableUid].context; if (context.customShader) { PoolGroup.BigPool["return"](context.customShader); context.customShader = null; } PoolGroup.BigPool["return"](this._gpuBitmapText[renderableUid]); this._gpuBitmapText[renderableUid] = null; } }, { key: "updateRenderable", value: function updateRenderable(bitmapText) { var graphicsRenderable = this._getGpuBitmapText(bitmapText); syncWithProxy(bitmapText, graphicsRenderable); this._renderer.renderPipes.graphics.updateRenderable(graphicsRenderable); if (graphicsRenderable.context.customShader) { this._updateDistanceField(bitmapText); } } }, { key: "_updateContext", value: function _updateContext(bitmapText, proxyGraphics) { var context = proxyGraphics.context; var bitmapFont = BitmapFontManager.BitmapFontManager.getFont(bitmapText.text, bitmapText._style); context.clear(); if (bitmapFont.distanceField.type !== "none") { if (!context.customShader) { context.customShader = PoolGroup.BigPool.get(SdfShader.SdfShader); } } var chars = Array.from(bitmapText.text); var style = bitmapText._style; var currentY = bitmapFont.baseLineOffset; var bitmapTextLayout = getBitmapTextLayout.getBitmapTextLayout(chars, style, bitmapFont, true); var index = 0; var padding = style.padding; var scale = bitmapTextLayout.scale; var tx = bitmapTextLayout.width; var ty = bitmapTextLayout.height + bitmapTextLayout.offsetY; if (style._stroke) { tx += style._stroke.width / scale; ty += style._stroke.width / scale; } context.translate(-bitmapText._anchor._x * tx - padding, -bitmapText._anchor._y * ty - padding).scale(scale, scale); var tint = bitmapFont.applyFillAsTint ? style._fill.color : 16777215; for (var i = 0; i < bitmapTextLayout.lines.length; i++) { var line = bitmapTextLayout.lines[i]; for (var j = 0; j < line.charPositions.length; j++) { var _char = chars[index++]; var charData = bitmapFont.chars[_char]; if (charData !== null && charData !== void 0 && charData.texture) { context.texture(charData.texture, tint ? tint : "black", Math.round(line.charPositions[j] + charData.xOffset), Math.round(currentY + charData.yOffset)); } } currentY += bitmapFont.lineHeight; } } }, { key: "_getGpuBitmapText", value: function _getGpuBitmapText(bitmapText) { return this._gpuBitmapText[bitmapText.uid] || this.initGpuText(bitmapText); } }, { key: "initGpuText", value: function initGpuText(bitmapText) { var proxyRenderable = PoolGroup.BigPool.get(Graphics.Graphics); this._gpuBitmapText[bitmapText.uid] = proxyRenderable; this._updateContext(bitmapText, proxyRenderable); bitmapText.on("destroyed", this._destroyRenderableBound); return this._gpuBitmapText[bitmapText.uid]; } }, { key: "_updateDistanceField", value: function _updateDistanceField(bitmapText) { var context = this._getGpuBitmapText(bitmapText).context; var fontFamily = bitmapText._style.fontFamily; var dynamicFont = Cache.Cache.get("".concat(fontFamily, "-bitmap")); var _bitmapText$groupTran = bitmapText.groupTransform, a = _bitmapText$groupTran.a, b = _bitmapText$groupTran.b, c = _bitmapText$groupTran.c, d = _bitmapText$groupTran.d; var dx = Math.sqrt(a * a + b * b); var dy = Math.sqrt(c * c + d * d); var worldScale = (Math.abs(dx) + Math.abs(dy)) / 2; var fontScale = dynamicFont.baseRenderedFontSize / bitmapText._style.fontSize; var distance = worldScale * dynamicFont.distanceField.range * (1 / fontScale); context.customShader.resources.localUniforms.uniforms.uDistance = distance; } }, { key: "destroy", value: function destroy() { for (var uid in this._gpuBitmapText) { this._destroyRenderableByUid(uid); } this._gpuBitmapText = null; this._renderer = null; } }]); }(); /** @ignore */ BitmapTextPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "bitmapText" }; function syncWithProxy(container, proxy) { proxy.groupTransform = container.groupTransform; proxy.groupColorAlpha = container.groupColorAlpha; proxy.groupColor = container.groupColor; proxy.groupBlendMode = container.groupBlendMode; proxy.globalDisplayStatus = container.globalDisplayStatus; proxy.groupTransform = container.groupTransform; proxy.localDisplayStatus = container.localDisplayStatus; proxy.groupAlpha = container.groupAlpha; proxy._roundPixels = container._roundPixels; } exports.BitmapTextPipe = BitmapTextPipe; /***/ }), /***/ 74199: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var State = __webpack_require__(84938); var PoolGroup = __webpack_require__(47505); var colorToUniform = __webpack_require__(6455); var BatchableGraphics = __webpack_require__(84305); "use strict"; var GraphicsPipe = /*#__PURE__*/function () { function GraphicsPipe(renderer, adaptor) { _classCallCheck(this, GraphicsPipe); this.state = State.State.for2d(); // batchable graphics list, used to render batches this._graphicsBatchesHash = /* @__PURE__ */Object.create(null); this._destroyRenderableBound = this.destroyRenderable.bind(this); this.renderer = renderer; this._adaptor = adaptor; this._adaptor.init(); this.renderer.renderableGC.addManagedHash(this, "_graphicsBatchesHash"); } return _createClass(GraphicsPipe, [{ key: "validateRenderable", value: function validateRenderable(graphics) { var context = graphics.context; var wasBatched = !!this._graphicsBatchesHash[graphics.uid]; var gpuContext = this.renderer.graphicsContext.updateGpuContext(context); if (gpuContext.isBatchable || wasBatched !== gpuContext.isBatchable) { return true; } return false; } }, { key: "addRenderable", value: function addRenderable(graphics, instructionSet) { var gpuContext = this.renderer.graphicsContext.updateGpuContext(graphics.context); if (graphics.didViewUpdate) { this._rebuild(graphics); } if (gpuContext.isBatchable) { this._addToBatcher(graphics, instructionSet); } else { this.renderer.renderPipes.batch["break"](instructionSet); instructionSet.add(graphics); } } }, { key: "updateRenderable", value: function updateRenderable(graphics) { var batches = this._graphicsBatchesHash[graphics.uid]; if (batches) { for (var i = 0; i < batches.length; i++) { var batch = batches[i]; batch._batcher.updateElement(batch); } } } }, { key: "destroyRenderable", value: function destroyRenderable(graphics) { if (this._graphicsBatchesHash[graphics.uid]) { this._removeBatchForRenderable(graphics.uid); } graphics.off("destroyed", this._destroyRenderableBound); } }, { key: "execute", value: function execute(graphics) { if (!graphics.isRenderable) return; var renderer = this.renderer; var context = graphics.context; var contextSystem = renderer.graphicsContext; if (!contextSystem.getGpuContext(context).batches.length) { return; } var shader = context.customShader || this._adaptor.shader; this.state.blendMode = graphics.groupBlendMode; var localUniforms = shader.resources.localUniforms.uniforms; localUniforms.uTransformMatrix = graphics.groupTransform; localUniforms.uRound = renderer._roundPixels | graphics._roundPixels; colorToUniform.color32BitToUniform(graphics.groupColorAlpha, localUniforms.uColor, 0); this._adaptor.execute(this, graphics); } }, { key: "_rebuild", value: function _rebuild(graphics) { var wasBatched = !!this._graphicsBatchesHash[graphics.uid]; var gpuContext = this.renderer.graphicsContext.updateGpuContext(graphics.context); if (wasBatched) { this._removeBatchForRenderable(graphics.uid); } if (gpuContext.isBatchable) { this._initBatchesForRenderable(graphics); } graphics.batched = gpuContext.isBatchable; } }, { key: "_addToBatcher", value: function _addToBatcher(graphics, instructionSet) { var batchPipe = this.renderer.renderPipes.batch; var batches = this._getBatchesForRenderable(graphics); for (var i = 0; i < batches.length; i++) { var batch = batches[i]; batchPipe.addToBatch(batch, instructionSet); } } }, { key: "_getBatchesForRenderable", value: function _getBatchesForRenderable(graphics) { return this._graphicsBatchesHash[graphics.uid] || this._initBatchesForRenderable(graphics); } }, { key: "_initBatchesForRenderable", value: function _initBatchesForRenderable(graphics) { var context = graphics.context; var gpuContext = this.renderer.graphicsContext.getGpuContext(context); var roundPixels = this.renderer._roundPixels | graphics._roundPixels; var batches = gpuContext.batches.map(function (batch) { var batchClone = PoolGroup.BigPool.get(BatchableGraphics.BatchableGraphics); batch.copyTo(batchClone); batchClone.renderable = graphics; batchClone.roundPixels = roundPixels; return batchClone; }); if (this._graphicsBatchesHash[graphics.uid] === void 0) { graphics.on("destroyed", this._destroyRenderableBound); } this._graphicsBatchesHash[graphics.uid] = batches; return batches; } }, { key: "_removeBatchForRenderable", value: function _removeBatchForRenderable(graphicsUid) { this._graphicsBatchesHash[graphicsUid].forEach(function (batch) { PoolGroup.BigPool["return"](batch); }); this._graphicsBatchesHash[graphicsUid] = null; } }, { key: "destroy", value: function destroy() { this.renderer = null; this._adaptor.destroy(); this._adaptor = null; this.state = null; for (var i in this._graphicsBatchesHash) { this._removeBatchForRenderable(i); } this._graphicsBatchesHash = null; } }]); }(); /** @ignore */ GraphicsPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "graphics" }; exports.GraphicsPipe = GraphicsPipe; /***/ }), /***/ 74374: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(80176); "use strict"; var infoMap = { uint8x2: _const.GL_TYPES.UNSIGNED_BYTE, uint8x4: _const.GL_TYPES.UNSIGNED_BYTE, sint8x2: _const.GL_TYPES.BYTE, sint8x4: _const.GL_TYPES.BYTE, unorm8x2: _const.GL_TYPES.UNSIGNED_BYTE, unorm8x4: _const.GL_TYPES.UNSIGNED_BYTE, snorm8x2: _const.GL_TYPES.BYTE, snorm8x4: _const.GL_TYPES.BYTE, uint16x2: _const.GL_TYPES.UNSIGNED_SHORT, uint16x4: _const.GL_TYPES.UNSIGNED_SHORT, sint16x2: _const.GL_TYPES.SHORT, sint16x4: _const.GL_TYPES.SHORT, unorm16x2: _const.GL_TYPES.UNSIGNED_SHORT, unorm16x4: _const.GL_TYPES.UNSIGNED_SHORT, snorm16x2: _const.GL_TYPES.SHORT, snorm16x4: _const.GL_TYPES.SHORT, float16x2: _const.GL_TYPES.HALF_FLOAT, float16x4: _const.GL_TYPES.HALF_FLOAT, float32: _const.GL_TYPES.FLOAT, float32x2: _const.GL_TYPES.FLOAT, float32x3: _const.GL_TYPES.FLOAT, float32x4: _const.GL_TYPES.FLOAT, uint32: _const.GL_TYPES.UNSIGNED_INT, uint32x2: _const.GL_TYPES.UNSIGNED_INT, uint32x3: _const.GL_TYPES.UNSIGNED_INT, uint32x4: _const.GL_TYPES.UNSIGNED_INT, sint32: _const.GL_TYPES.INT, sint32x2: _const.GL_TYPES.INT, sint32x3: _const.GL_TYPES.INT, sint32x4: _const.GL_TYPES.INT }; function getGlTypeFromFormat(format) { var _infoMap$format; return (_infoMap$format = infoMap[format]) !== null && _infoMap$format !== void 0 ? _infoMap$format : infoMap.float32; } exports.getGlTypeFromFormat = getGlTypeFromFormat; /***/ }), /***/ 74486: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var hsl = "fn getLuminosity(c: vec3<f32>) -> f32 {\n return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;\n}\n\nfn setLuminosity(c: vec3<f32>, lum: f32) -> vec3<f32> {\n let d: f32 = lum - getLuminosity(c);\n let newColor: vec3<f32> = c.rgb + vec3<f32>(d, d, d);\n\n // clip back into legal range\n let newLum: f32 = getLuminosity(newColor);\n let cMin: f32 = min(newColor.r, min(newColor.g, newColor.b));\n let cMax: f32 = max(newColor.r, max(newColor.g, newColor.b));\n\n let t1: f32 = newLum / (newLum - cMin);\n let t2: f32 = (1.0 - newLum) / (cMax - newLum);\n\n let finalColor = mix(vec3<f32>(newLum, newLum, newLum), newColor, select(select(1.0, t2, cMax > 1.0), t1, cMin < 0.0));\n\n return finalColor;\n}\n\nfn getSaturation(c: vec3<f32>) -> f32 {\n return max(c.r, max(c.g, c.b)) - min(c.r, min(c.g, c.b));\n}\n\n// Set saturation if color components are sorted in ascending order.\nfn setSaturationMinMidMax(cSorted: vec3<f32>, s: f32) -> vec3<f32> {\n var result: vec3<f32>;\n if (cSorted.z > cSorted.x) {\n let newY = (((cSorted.y - cSorted.x) * s) / (cSorted.z - cSorted.x));\n result = vec3<f32>(0.0, newY, s);\n } else {\n result = vec3<f32>(0.0, 0.0, 0.0);\n }\n return vec3<f32>(result.x, result.y, result.z);\n}\n\nfn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {\n var result: vec3<f32> = c;\n\n if (c.r <= c.g && c.r <= c.b) {\n if (c.g <= c.b) {\n result = setSaturationMinMidMax(result, s);\n } else {\n var temp: vec3<f32> = vec3<f32>(result.r, result.b, result.g);\n temp = setSaturationMinMidMax(temp, s);\n result = vec3<f32>(temp.r, temp.b, temp.g);\n }\n } else if (c.g <= c.r && c.g <= c.b) {\n if (c.r <= c.b) {\n var temp: vec3<f32> = vec3<f32>(result.g, result.r, result.b);\n temp = setSaturationMinMidMax(temp, s);\n result = vec3<f32>(temp.g, temp.r, temp.b);\n } else {\n var temp: vec3<f32> = vec3<f32>(result.g, result.b, result.r);\n temp = setSaturationMinMidMax(temp, s);\n result = vec3<f32>(temp.g, temp.b, temp.r);\n }\n } else {\n if (c.r <= c.g) {\n var temp: vec3<f32> = vec3<f32>(result.b, result.r, result.g);\n temp = setSaturationMinMidMax(temp, s);\n result = vec3<f32>(temp.b, temp.r, temp.g);\n } else {\n var temp: vec3<f32> = vec3<f32>(result.b, result.g, result.r);\n temp = setSaturationMinMidMax(temp, s);\n result = vec3<f32>(temp.b, temp.g, temp.r);\n }\n }\n\n return result;\n}"; exports["default"] = hsl; /***/ }), /***/ 74704: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var warn = __webpack_require__(57371); var GraphicsPath = __webpack_require__(91058); var parseSVGDefinitions = __webpack_require__(51274); var parseSVGFloatAttribute = __webpack_require__(99836); var parseSVGStyle = __webpack_require__(24185); "use strict"; function SVGParser(svg, graphicsContext) { if (typeof svg === "string") { var div = document.createElement("div"); div.innerHTML = svg.trim(); svg = div.querySelector("svg"); } var session = { context: graphicsContext, defs: {}, path: new GraphicsPath.GraphicsPath() }; parseSVGDefinitions.parseSVGDefinitions(svg, session); var children = svg.children; var _parseSVGStyle$parseS = parseSVGStyle.parseSVGStyle(svg, session), fillStyle = _parseSVGStyle$parseS.fillStyle, strokeStyle = _parseSVGStyle$parseS.strokeStyle; for (var i = 0; i < children.length; i++) { var child = children[i]; if (child.nodeName.toLowerCase() === "defs") continue; renderChildren(child, session, fillStyle, strokeStyle); } return graphicsContext; } function renderChildren(svg, session, fillStyle, strokeStyle) { var children = svg.children; var _parseSVGStyle$parseS2 = parseSVGStyle.parseSVGStyle(svg, session), f1 = _parseSVGStyle$parseS2.fillStyle, s1 = _parseSVGStyle$parseS2.strokeStyle; if (f1 && fillStyle) { fillStyle = _objectSpread(_objectSpread({}, fillStyle), f1); } else if (f1) { fillStyle = f1; } if (s1 && strokeStyle) { strokeStyle = _objectSpread(_objectSpread({}, strokeStyle), s1); } else if (s1) { strokeStyle = s1; } var noStyle = !fillStyle && !strokeStyle; if (noStyle) { fillStyle = { color: 0 }; } var x; var y; var x1; var y1; var x2; var y2; var cx; var cy; var r; var rx; var ry; var points; var pointsString; var d; var graphicsPath; var width; var height; switch (svg.nodeName.toLowerCase()) { case "path": d = svg.getAttribute("d"); if (svg.getAttribute("fill-rule") === "evenodd") { warn.warn("SVG Evenodd fill rule not supported, your svg may render incorrectly"); } graphicsPath = new GraphicsPath.GraphicsPath(d, true); session.context.path(graphicsPath); if (fillStyle) session.context.fill(fillStyle); if (strokeStyle) session.context.stroke(strokeStyle); break; case "circle": cx = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "cx", 0); cy = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "cy", 0); r = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "r", 0); session.context.ellipse(cx, cy, r, r); if (fillStyle) session.context.fill(fillStyle); if (strokeStyle) session.context.stroke(strokeStyle); break; case "rect": x = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "x", 0); y = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "y", 0); width = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "width", 0); height = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "height", 0); rx = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "rx", 0); ry = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "ry", 0); if (rx || ry) { session.context.roundRect(x, y, width, height, rx || ry); } else { session.context.rect(x, y, width, height); } if (fillStyle) session.context.fill(fillStyle); if (strokeStyle) session.context.stroke(strokeStyle); break; case "ellipse": cx = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "cx", 0); cy = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "cy", 0); rx = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "rx", 0); ry = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "ry", 0); session.context.beginPath(); session.context.ellipse(cx, cy, rx, ry); if (fillStyle) session.context.fill(fillStyle); if (strokeStyle) session.context.stroke(strokeStyle); break; case "line": x1 = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "x1", 0); y1 = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "y1", 0); x2 = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "x2", 0); y2 = parseSVGFloatAttribute.parseSVGFloatAttribute(svg, "y2", 0); session.context.beginPath(); session.context.moveTo(x1, y1); session.context.lineTo(x2, y2); if (strokeStyle) session.context.stroke(strokeStyle); break; case "polygon": pointsString = svg.getAttribute("points"); points = pointsString.match(/\d+/g).map(function (n) { return parseInt(n, 10); }); session.context.poly(points, true); if (fillStyle) session.context.fill(fillStyle); if (strokeStyle) session.context.stroke(strokeStyle); break; case "polyline": pointsString = svg.getAttribute("points"); points = pointsString.match(/\d+/g).map(function (n) { return parseInt(n, 10); }); session.context.poly(points, false); if (strokeStyle) session.context.stroke(strokeStyle); break; case "g": case "svg": break; default: { warn.warn("[SVG parser] <".concat(svg.nodeName, "> elements unsupported")); break; } } if (noStyle) { fillStyle = null; } for (var i = 0; i < children.length; i++) { renderChildren(children[i], session, fillStyle, strokeStyle); } } exports.SVGParser = SVGParser; /***/ }), /***/ 74731: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Point = __webpack_require__(75544); "use strict"; var tempPoints = [new Point.Point(), new Point.Point(), new Point.Point(), new Point.Point()]; var Rectangle = /*#__PURE__*/function () { /** * @param x - The X coordinate of the upper-left corner of the rectangle * @param y - The Y coordinate of the upper-left corner of the rectangle * @param width - The overall width of the rectangle * @param height - The overall height of the rectangle */ function Rectangle() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; _classCallCheck(this, Rectangle); /** * The type of the object, mainly used to avoid `instanceof` checks * @default 'rectangle' */ this.type = "rectangle"; this.x = Number(x); this.y = Number(y); this.width = Number(width); this.height = Number(height); } /** Returns the left edge of the rectangle. */ return _createClass(Rectangle, [{ key: "left", get: function get() { return this.x; } /** Returns the right edge of the rectangle. */ }, { key: "right", get: function get() { return this.x + this.width; } /** Returns the top edge of the rectangle. */ }, { key: "top", get: function get() { return this.y; } /** Returns the bottom edge of the rectangle. */ }, { key: "bottom", get: function get() { return this.y + this.height; } /** Determines whether the Rectangle is empty. */ }, { key: "isEmpty", value: function isEmpty() { return this.left === this.right || this.top === this.bottom; } /** A constant empty rectangle. This is a new object every time the property is accessed */ }, { key: "clone", value: /** * Creates a clone of this Rectangle * @returns a copy of the rectangle */ function clone() { return new Rectangle(this.x, this.y, this.width, this.height); } /** * Converts a Bounds object to a Rectangle object. * @param bounds - The bounds to copy and convert to a rectangle. * @returns Returns itself. */ }, { key: "copyFromBounds", value: function copyFromBounds(bounds) { this.x = bounds.minX; this.y = bounds.minY; this.width = bounds.maxX - bounds.minX; this.height = bounds.maxY - bounds.minY; return this; } /** * Copies another rectangle to this one. * @param rectangle - The rectangle to copy from. * @returns Returns itself. */ }, { key: "copyFrom", value: function copyFrom(rectangle) { this.x = rectangle.x; this.y = rectangle.y; this.width = rectangle.width; this.height = rectangle.height; return this; } /** * Copies this rectangle to another one. * @param rectangle - The rectangle to copy to. * @returns Returns given parameter. */ }, { key: "copyTo", value: function copyTo(rectangle) { rectangle.copyFrom(this); return rectangle; } /** * Checks whether the x and y coordinates given are contained within this Rectangle * @param x - The X coordinate of the point to test * @param y - The Y coordinate of the point to test * @returns Whether the x/y coordinates are within this Rectangle */ }, { key: "contains", value: function contains(x, y) { if (this.width <= 0 || this.height <= 0) { return false; } if (x >= this.x && x < this.x + this.width) { if (y >= this.y && y < this.y + this.height) { return true; } } return false; } /** * Checks whether the x and y coordinates given are contained within this rectangle including the stroke. * @param x - The X coordinate of the point to test * @param y - The Y coordinate of the point to test * @param strokeWidth - The width of the line to check * @param alignment - The alignment of the stroke, 0.5 by default * @returns Whether the x/y coordinates are within this rectangle */ }, { key: "strokeContains", value: function strokeContains(x, y, strokeWidth) { var alignment = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5; var width = this.width, height = this.height; if (width <= 0 || height <= 0) return false; var _x = this.x; var _y = this.y; var strokeWidthOuter = strokeWidth * (1 - alignment); var strokeWidthInner = strokeWidth - strokeWidthOuter; var outerLeft = _x - strokeWidthOuter; var outerRight = _x + width + strokeWidthOuter; var outerTop = _y - strokeWidthOuter; var outerBottom = _y + height + strokeWidthOuter; var innerLeft = _x + strokeWidthInner; var innerRight = _x + width - strokeWidthInner; var innerTop = _y + strokeWidthInner; var innerBottom = _y + height - strokeWidthInner; return x >= outerLeft && x <= outerRight && y >= outerTop && y <= outerBottom && !(x > innerLeft && x < innerRight && y > innerTop && y < innerBottom); } /** * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object. * Returns true only if the area of the intersection is >0, this means that Rectangles * sharing a side are not overlapping. Another side effect is that an arealess rectangle * (width or height equal to zero) can't intersect any other rectangle. * @param {Rectangle} other - The Rectangle to intersect with `this`. * @param {Matrix} transform - The transformation matrix of `other`. * @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`. */ }, { key: "intersects", value: function intersects(other, transform) { if (!transform) { var x02 = this.x < other.x ? other.x : this.x; var x12 = this.right > other.right ? other.right : this.right; if (x12 <= x02) { return false; } var y02 = this.y < other.y ? other.y : this.y; var y12 = this.bottom > other.bottom ? other.bottom : this.bottom; return y12 > y02; } var x0 = this.left; var x1 = this.right; var y0 = this.top; var y1 = this.bottom; if (x1 <= x0 || y1 <= y0) { return false; } var lt = tempPoints[0].set(other.left, other.top); var lb = tempPoints[1].set(other.left, other.bottom); var rt = tempPoints[2].set(other.right, other.top); var rb = tempPoints[3].set(other.right, other.bottom); if (rt.x <= lt.x || lb.y <= lt.y) { return false; } var s = Math.sign(transform.a * transform.d - transform.b * transform.c); if (s === 0) { return false; } transform.apply(lt, lt); transform.apply(lb, lb); transform.apply(rt, rt); transform.apply(rb, rb); if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0 || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1 || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0 || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1) { return false; } var nx = s * (lb.y - lt.y); var ny = s * (lt.x - lb.x); var n00 = nx * x0 + ny * y0; var n10 = nx * x1 + ny * y0; var n01 = nx * x0 + ny * y1; var n11 = nx * x1 + ny * y1; if (Math.max(n00, n10, n01, n11) <= nx * lt.x + ny * lt.y || Math.min(n00, n10, n01, n11) >= nx * rb.x + ny * rb.y) { return false; } var mx = s * (lt.y - rt.y); var my = s * (rt.x - lt.x); var m00 = mx * x0 + my * y0; var m10 = mx * x1 + my * y0; var m01 = mx * x0 + my * y1; var m11 = mx * x1 + my * y1; if (Math.max(m00, m10, m01, m11) <= mx * lt.x + my * lt.y || Math.min(m00, m10, m01, m11) >= mx * rb.x + my * rb.y) { return false; } return true; } /** * Pads the rectangle making it grow in all directions. * If paddingY is omitted, both paddingX and paddingY will be set to paddingX. * @param paddingX - The horizontal padding amount. * @param paddingY - The vertical padding amount. * @returns Returns itself. */ }, { key: "pad", value: function pad() { var paddingX = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var paddingY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : paddingX; this.x -= paddingX; this.y -= paddingY; this.width += paddingX * 2; this.height += paddingY * 2; return this; } /** * Fits this rectangle around the passed one. * @param rectangle - The rectangle to fit. * @returns Returns itself. */ }, { key: "fit", value: function fit(rectangle) { var x1 = Math.max(this.x, rectangle.x); var x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width); var y1 = Math.max(this.y, rectangle.y); var y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height); this.x = x1; this.width = Math.max(x2 - x1, 0); this.y = y1; this.height = Math.max(y2 - y1, 0); return this; } /** * Enlarges rectangle that way its corners lie on grid * @param resolution - resolution * @param eps - precision * @returns Returns itself. */ }, { key: "ceil", value: function ceil() { var resolution = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; var eps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1e-3; var x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution; var y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution; this.x = Math.floor((this.x + eps) * resolution) / resolution; this.y = Math.floor((this.y + eps) * resolution) / resolution; this.width = x2 - this.x; this.height = y2 - this.y; return this; } /** * Enlarges this rectangle to include the passed rectangle. * @param rectangle - The rectangle to include. * @returns Returns itself. */ }, { key: "enlarge", value: function enlarge(rectangle) { var x1 = Math.min(this.x, rectangle.x); var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width); var y1 = Math.min(this.y, rectangle.y); var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height); this.x = x1; this.width = x2 - x1; this.y = y1; this.height = y2 - y1; return this; } /** * Returns the framing rectangle of the rectangle as a Rectangle object * @param out - optional rectangle to store the result * @returns The framing rectangle */ }, { key: "getBounds", value: function getBounds(out) { out || (out = new Rectangle()); out.copyFrom(this); return out; } /** * Checks if this rectangle fully contains another rectangle. * * A rectangle contains another rectangle if all four corners of the other rectangle * lie within the bounds of this rectangle. * * ```ts * const container = new Rectangle(0, 0, 100, 100); * const inside = new Rectangle(25, 25, 50, 50); * const partial = new Rectangle(75, 75, 50, 50); * * container.containsRect(inside); // Returns true * container.containsRect(partial); // Returns false - partial overlap * ``` * * Note: If either rectangle has a width or height of 0, this method returns false * since a zero-area rectangle cannot meaningfully contain another rectangle. * @param other - The rectangle to check if it is contained within this one * @returns True if the other rectangle is fully contained within this one */ }, { key: "containsRect", value: function containsRect(other) { if (this.width <= 0 || this.height <= 0) return false; var x1 = other.x; var y1 = other.y; var x2 = other.x + other.width; var y2 = other.y + other.height; return x1 >= this.x && x1 < this.x + this.width && y1 >= this.y && y1 < this.y + this.height && x2 >= this.x && x2 < this.x + this.width && y2 >= this.y && y2 < this.y + this.height; } }, { key: "toString", value: function toString() { return "[pixi.js/math:Rectangle x=".concat(this.x, " y=").concat(this.y, " width=").concat(this.width, " height=").concat(this.height, "]"); } }], [{ key: "EMPTY", get: function get() { return new Rectangle(0, 0, 0, 0); } }]); }(); exports.Rectangle = Rectangle; /***/ }), /***/ 74977: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var ktxTranscoderUrls = { jsUrl: "https://files.pixijs.download/transcoders/ktx/libktx.js", wasmUrl: "https://files.pixijs.download/transcoders/ktx/libktx.wasm" }; function setKTXTranscoderPath(config) { Object.assign(ktxTranscoderUrls, config); } exports.ktxTranscoderUrls = ktxTranscoderUrls; exports.setKTXTranscoderPath = setKTXTranscoderPath; /***/ }), /***/ 75037: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var bitmapFontXMLParser = { test: function test(data) { var xml = data; return typeof xml !== "string" && "getElementsByTagName" in xml && xml.getElementsByTagName("page").length && xml.getElementsByTagName("info")[0].getAttribute("face") !== null; }, parse: function parse(xml) { var data = { chars: {}, pages: [], lineHeight: 0, fontSize: 0, fontFamily: "", distanceField: null, baseLineOffset: 0 }; var info = xml.getElementsByTagName("info")[0]; var common = xml.getElementsByTagName("common")[0]; var distanceField = xml.getElementsByTagName("distanceField")[0]; if (distanceField) { data.distanceField = { type: distanceField.getAttribute("fieldType"), range: parseInt(distanceField.getAttribute("distanceRange"), 10) }; } var page = xml.getElementsByTagName("page"); var _char = xml.getElementsByTagName("char"); var kerning = xml.getElementsByTagName("kerning"); data.fontSize = parseInt(info.getAttribute("size"), 10); data.fontFamily = info.getAttribute("face"); data.lineHeight = parseInt(common.getAttribute("lineHeight"), 10); for (var i = 0; i < page.length; i++) { data.pages.push({ id: parseInt(page[i].getAttribute("id"), 10) || 0, file: page[i].getAttribute("file") }); } var map = {}; data.baseLineOffset = data.lineHeight - parseInt(common.getAttribute("base"), 10); for (var _i = 0; _i < _char.length; _i++) { var _ref, _charNode$getAttribut; var charNode = _char[_i]; var id = parseInt(charNode.getAttribute("id"), 10); var letter = (_ref = (_charNode$getAttribut = charNode.getAttribute("letter")) !== null && _charNode$getAttribut !== void 0 ? _charNode$getAttribut : charNode.getAttribute("char")) !== null && _ref !== void 0 ? _ref : String.fromCharCode(id); if (letter === "space") letter = " "; map[id] = letter; data.chars[letter] = { id: id, // texture deets.. page: parseInt(charNode.getAttribute("page"), 10) || 0, x: parseInt(charNode.getAttribute("x"), 10), y: parseInt(charNode.getAttribute("y"), 10), width: parseInt(charNode.getAttribute("width"), 10), height: parseInt(charNode.getAttribute("height"), 10), // render deets.. xOffset: parseInt(charNode.getAttribute("xoffset"), 10), yOffset: parseInt(charNode.getAttribute("yoffset"), 10), // + baseLineOffset, xAdvance: parseInt(charNode.getAttribute("xadvance"), 10), kerning: {} }; } for (var _i2 = 0; _i2 < kerning.length; _i2++) { var first = parseInt(kerning[_i2].getAttribute("first"), 10); var second = parseInt(kerning[_i2].getAttribute("second"), 10); var amount = parseInt(kerning[_i2].getAttribute("amount"), 10); data.chars[map[second]].kerning[map[first]] = amount; } return data; } }; exports.bitmapFontXMLParser = bitmapFontXMLParser; /***/ }), /***/ 75313: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Color = __webpack_require__(98828); var Texture = __webpack_require__(73782); var getGlobalMixin = __webpack_require__(62461); var assignWithIgnore = __webpack_require__(69095); "use strict"; var _Particle = /*#__PURE__*/function () { function _Particle(options) { _classCallCheck(this, _Particle); if (options instanceof Texture.Texture) { this.texture = options; assignWithIgnore.assignWithIgnore(this, _Particle.defaultOptions, {}); } else { var combined = _objectSpread(_objectSpread({}, _Particle.defaultOptions), options); assignWithIgnore.assignWithIgnore(this, combined, {}); } } /** Gets or sets the alpha value of the particle. */ return _createClass(_Particle, [{ key: "alpha", get: function get() { return this._alpha; }, set: function set(value) { this._alpha = Math.min(Math.max(value, 0), 1); this._updateColor(); } /** Gets or sets the tint color of the particle. */ }, { key: "tint", get: function get() { return getGlobalMixin.bgr2rgb(this._tint); }, set: function set(value) { if (typeof value === "number") { this._tint = value; } else { this._tint = Color.Color.shared.setValue(value !== null && value !== void 0 ? value : 16777215).toBgrNumber(); } this._updateColor(); } }, { key: "_updateColor", value: function _updateColor() { this.color = this._tint + ((this._alpha * 255 | 0) << 24); } }]); }(); /** Default options for constructing with options */ _Particle.defaultOptions = { anchorX: 0, anchorY: 0, x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0, tint: 16777215, alpha: 1 }; var Particle = _Particle; exports.Particle = Particle; /***/ }), /***/ 75315: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Container = __webpack_require__(47719); var clearList = __webpack_require__(56643); var multiplyColors = __webpack_require__(79904); "use strict"; var tempContainer = new Container.Container(); var UPDATE_BLEND_COLOR_VISIBLE = Container.UPDATE_VISIBLE | Container.UPDATE_COLOR | Container.UPDATE_BLEND; function updateRenderGroupTransforms(renderGroup) { var updateChildRenderGroups = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; updateRenderGroupTransform(renderGroup); var childrenToUpdate = renderGroup.childrenToUpdate; var updateTick = renderGroup.updateTick++; for (var j in childrenToUpdate) { var renderGroupDepth = Number(j); var childrenAtDepth = childrenToUpdate[j]; var list = childrenAtDepth.list; var index = childrenAtDepth.index; for (var i = 0; i < index; i++) { var child = list[i]; if (child.parentRenderGroup === renderGroup && child.relativeRenderGroupDepth === renderGroupDepth) { updateTransformAndChildren(child, updateTick, 0); } } clearList.clearList(list, index); childrenAtDepth.index = 0; } if (updateChildRenderGroups) { for (var _i = 0; _i < renderGroup.renderGroupChildren.length; _i++) { updateRenderGroupTransforms(renderGroup.renderGroupChildren[_i], updateChildRenderGroups); } } } function updateRenderGroupTransform(renderGroup) { var root = renderGroup.root; var worldAlpha; if (renderGroup.renderGroupParent) { var renderGroupParent = renderGroup.renderGroupParent; renderGroup.worldTransform.appendFrom(root.relativeGroupTransform, renderGroupParent.worldTransform); renderGroup.worldColor = multiplyColors.multiplyColors(root.groupColor, renderGroupParent.worldColor); worldAlpha = root.groupAlpha * renderGroupParent.worldAlpha; } else { renderGroup.worldTransform.copyFrom(root.localTransform); renderGroup.worldColor = root.localColor; worldAlpha = root.localAlpha; } worldAlpha = worldAlpha < 0 ? 0 : worldAlpha > 1 ? 1 : worldAlpha; renderGroup.worldAlpha = worldAlpha; renderGroup.worldColorAlpha = renderGroup.worldColor + ((worldAlpha * 255 | 0) << 24); } function updateTransformAndChildren(container, updateTick, updateFlags) { if (updateTick === container.updateTick) return; container.updateTick = updateTick; container.didChange = false; var localTransform = container.localTransform; container.updateLocalTransform(); var parent = container.parent; if (parent && !parent.renderGroup) { updateFlags |= container._updateFlags; container.relativeGroupTransform.appendFrom(localTransform, parent.relativeGroupTransform); if (updateFlags & UPDATE_BLEND_COLOR_VISIBLE) { updateColorBlendVisibility(container, parent, updateFlags); } } else { updateFlags = container._updateFlags; container.relativeGroupTransform.copyFrom(localTransform); if (updateFlags & UPDATE_BLEND_COLOR_VISIBLE) { updateColorBlendVisibility(container, tempContainer, updateFlags); } } if (!container.renderGroup) { var children = container.children; var length = children.length; for (var i = 0; i < length; i++) { updateTransformAndChildren(children[i], updateTick, updateFlags); } var renderGroup = container.parentRenderGroup; var renderable = container; if (renderable.renderPipeId && !renderGroup.structureDidChange) { renderGroup.updateRenderable(renderable); } } } function updateColorBlendVisibility(container, parent, updateFlags) { if (updateFlags & Container.UPDATE_COLOR) { container.groupColor = multiplyColors.multiplyColors(container.localColor, parent.groupColor); var groupAlpha = container.localAlpha * parent.groupAlpha; groupAlpha = groupAlpha < 0 ? 0 : groupAlpha > 1 ? 1 : groupAlpha; container.groupAlpha = groupAlpha; container.groupColorAlpha = container.groupColor + ((groupAlpha * 255 | 0) << 24); } if (updateFlags & Container.UPDATE_BLEND) { container.groupBlendMode = container.localBlendMode === "inherit" ? parent.groupBlendMode : container.localBlendMode; } if (updateFlags & Container.UPDATE_VISIBLE) { container.globalDisplayStatus = container.localDisplayStatus & parent.globalDisplayStatus; } container._updateFlags = 0; } exports.updateRenderGroupTransform = updateRenderGroupTransform; exports.updateRenderGroupTransforms = updateRenderGroupTransforms; exports.updateTransformAndChildren = updateTransformAndChildren; /***/ }), /***/ 75327: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var onRenderMixin = { _onRender: null, set onRender(func) { var renderGroup = this.renderGroup || this.parentRenderGroup; if (!func) { if (this._onRender) { renderGroup === null || renderGroup === void 0 || renderGroup.removeOnRender(this); } this._onRender = null; return; } if (!this._onRender) { renderGroup === null || renderGroup === void 0 || renderGroup.addOnRender(this); } this._onRender = func; }, /** * This callback is used when the container is rendered. This is where you should add your custom * logic that is needed to be run every frame. * * In v7 many users used `updateTransform` for this, however the way v8 renders objects is different * and "updateTransform" is no longer called every frame * @example * const container = new Container(); * container.onRender = () => { * container.rotation += 0.01; * }; * @memberof scene.Container# */ get onRender() { return this._onRender; } }; exports.onRenderMixin = onRenderMixin; /***/ }), /***/ 75544: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Point = /*#__PURE__*/function () { /** * Creates a new `Point` * @param {number} [x=0] - position of the point on the x axis * @param {number} [y=0] - position of the point on the y axis */ function Point() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; _classCallCheck(this, Point); /** Position of the point on the x axis */ this.x = 0; /** Position of the point on the y axis */ this.y = 0; this.x = x; this.y = y; } /** * Creates a clone of this point * @returns A clone of this point */ return _createClass(Point, [{ key: "clone", value: function clone() { return new Point(this.x, this.y); } /** * Copies `x` and `y` from the given point into this point * @param p - The point to copy from * @returns The point instance itself */ }, { key: "copyFrom", value: function copyFrom(p) { this.set(p.x, p.y); return this; } /** * Copies this point's x and y into the given point (`p`). * @param p - The point to copy to. Can be any of type that is or extends `PointData` * @returns The point (`p`) with values updated */ }, { key: "copyTo", value: function copyTo(p) { p.set(this.x, this.y); return p; } /** * Accepts another point (`p`) and returns `true` if the given point is equal to this point * @param p - The point to check * @returns Returns `true` if both `x` and `y` are equal */ }, { key: "equals", value: function equals(p) { return p.x === this.x && p.y === this.y; } /** * Sets the point to a new `x` and `y` position. * If `y` is omitted, both `x` and `y` will be set to `x`. * @param {number} [x=0] - position of the point on the `x` axis * @param {number} [y=x] - position of the point on the `y` axis * @returns The point instance itself */ }, { key: "set", value: function set() { var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; this.x = x; this.y = y; return this; } }, { key: "toString", value: function toString() { return "[pixi.js/math:Point x=".concat(this.x, " y=").concat(this.y, "]"); } /** * A static Point object with `x` and `y` values of `0`. Can be used to avoid creating new objects multiple times. * @readonly */ }], [{ key: "shared", get: function get() { tempPoint.x = 0; tempPoint.y = 0; return tempPoint; } }]); }(); var tempPoint = new Point(); exports.Point = Point; /***/ }), /***/ 75957: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var TextureSource = __webpack_require__(55406); var GraphicsContext = __webpack_require__(59244); var Text = __webpack_require__(61787); var BitmapText = __webpack_require__(84968); var HTMLText = __webpack_require__(7888); var PrepareQueue = __webpack_require__(2505); "use strict"; var PrepareUpload = /*#__PURE__*/function (_PrepareQueue$Prepare) { function PrepareUpload() { _classCallCheck(this, PrepareUpload); return _callSuper(this, PrepareUpload, arguments); } _inherits(PrepareUpload, _PrepareQueue$Prepare); return _createClass(PrepareUpload, [{ key: "uploadQueueItem", value: /** * Upload the given queue item * @param item */ function uploadQueueItem(item) { if (item instanceof TextureSource.TextureSource) { this.uploadTextureSource(item); } else if (item instanceof Text.Text) { this.uploadText(item); } else if (item instanceof HTMLText.HTMLText) { this.uploadHTMLText(item); } else if (item instanceof BitmapText.BitmapText) { this.uploadBitmapText(item); } else if (item instanceof GraphicsContext.GraphicsContext) { this.uploadGraphicsContext(item); } } }, { key: "uploadTextureSource", value: function uploadTextureSource(textureSource) { this.renderer.texture.initSource(textureSource); } }, { key: "uploadText", value: function uploadText(_text) { this.renderer.renderPipes.text.initGpuText(_text); } }, { key: "uploadBitmapText", value: function uploadBitmapText(_text) { this.renderer.renderPipes.bitmapText.initGpuText(_text); } }, { key: "uploadHTMLText", value: function uploadHTMLText(_text) { this.renderer.renderPipes.htmlText.initGpuText(_text); } /** * Resolve the given graphics context and return an item for the queue * @param graphicsContext */ }, { key: "uploadGraphicsContext", value: function uploadGraphicsContext(graphicsContext) { this.renderer.graphicsContext.getGpuContext(graphicsContext); var instructions = graphicsContext.instructions; var _iterator = _createForOfIteratorHelper(instructions), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var instruction = _step.value; if (instruction.action === "texture") { var image = instruction.data.image; this.uploadTextureSource(image.source); } else if (instruction.action === "fill") { var texture = instruction.data.style.texture; this.uploadTextureSource(texture.source); } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } return null; } }]); }(PrepareQueue.PrepareQueue); exports.PrepareUpload = PrepareUpload; /***/ }), /***/ 76421: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _const = __webpack_require__(59249); "use strict"; var fragTemplate = ["in vec2 vBlurTexCoords[%size%];", "uniform sampler2D uTexture;", "out vec4 finalColor;", "void main(void)", "{", " finalColor = vec4(0.0);", " %blur%", "}"].join("\n"); function generateBlurFragSource(kernelSize) { var kernel = _const.GAUSSIAN_VALUES[kernelSize]; var halfLength = kernel.length; var fragSource = fragTemplate; var blurLoop = ""; var template = "finalColor += texture(uTexture, vBlurTexCoords[%index%]) * %value%;"; var value; for (var i = 0; i < kernelSize; i++) { var blur = template.replace("%index%", i.toString()); value = i; if (i >= halfLength) { value = kernelSize - i - 1; } blur = blur.replace("%value%", kernel[value].toString()); blurLoop += blur; blurLoop += "\n"; } fragSource = fragSource.replace("%blur%", blurLoop); fragSource = fragSource.replace("%size%", kernelSize.toString()); return fragSource; } exports.generateBlurFragSource = generateBlurFragSource; /***/ }), /***/ 76431: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 76631: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Matrix = __webpack_require__(20764); var Rectangle = __webpack_require__(74731); "use strict"; var defaultMatrix = new Matrix.Matrix(); var Bounds = /*#__PURE__*/function () { function Bounds() { var minX = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Infinity; var minY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; var maxX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -Infinity; var maxY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -Infinity; _classCallCheck(this, Bounds); /** @default Infinity */ this.minX = Infinity; /** @default Infinity */ this.minY = Infinity; /** @default -Infinity */ this.maxX = -Infinity; /** @default -Infinity */ this.maxY = -Infinity; this.matrix = defaultMatrix; this.minX = minX; this.minY = minY; this.maxX = maxX; this.maxY = maxY; } /** * Checks if bounds are empty. * @returns - True if empty. */ return _createClass(Bounds, [{ key: "isEmpty", value: function isEmpty() { return this.minX > this.maxX || this.minY > this.maxY; } /** The bounding rectangle of the bounds. */ }, { key: "rectangle", get: function get() { if (!this._rectangle) { this._rectangle = new Rectangle.Rectangle(); } var rectangle = this._rectangle; if (this.minX > this.maxX || this.minY > this.maxY) { rectangle.x = 0; rectangle.y = 0; rectangle.width = 0; rectangle.height = 0; } else { rectangle.copyFromBounds(this); } return rectangle; } /** Clears the bounds and resets. */ }, { key: "clear", value: function clear() { this.minX = Infinity; this.minY = Infinity; this.maxX = -Infinity; this.maxY = -Infinity; this.matrix = defaultMatrix; return this; } /** * Sets the bounds. * @param x0 - left X of frame * @param y0 - top Y of frame * @param x1 - right X of frame * @param y1 - bottom Y of frame */ }, { key: "set", value: function set(x0, y0, x1, y1) { this.minX = x0; this.minY = y0; this.maxX = x1; this.maxY = y1; } /** * Adds sprite frame * @param x0 - left X of frame * @param y0 - top Y of frame * @param x1 - right X of frame * @param y1 - bottom Y of frame * @param matrix */ }, { key: "addFrame", value: function addFrame(x0, y0, x1, y1, matrix) { matrix || (matrix = this.matrix); var a = matrix.a; var b = matrix.b; var c = matrix.c; var d = matrix.d; var tx = matrix.tx; var ty = matrix.ty; var minX = this.minX; var minY = this.minY; var maxX = this.maxX; var maxY = this.maxY; var x = a * x0 + c * y0 + tx; var y = b * x0 + d * y0 + ty; if (x < minX) minX = x; if (y < minY) minY = y; if (x > maxX) maxX = x; if (y > maxY) maxY = y; x = a * x1 + c * y0 + tx; y = b * x1 + d * y0 + ty; if (x < minX) minX = x; if (y < minY) minY = y; if (x > maxX) maxX = x; if (y > maxY) maxY = y; x = a * x0 + c * y1 + tx; y = b * x0 + d * y1 + ty; if (x < minX) minX = x; if (y < minY) minY = y; if (x > maxX) maxX = x; if (y > maxY) maxY = y; x = a * x1 + c * y1 + tx; y = b * x1 + d * y1 + ty; if (x < minX) minX = x; if (y < minY) minY = y; if (x > maxX) maxX = x; if (y > maxY) maxY = y; this.minX = minX; this.minY = minY; this.maxX = maxX; this.maxY = maxY; } /** * Adds a rectangle to the bounds. * @param rect - The rectangle to be added. * @param matrix - The matrix to apply to the bounds. */ }, { key: "addRect", value: function addRect(rect, matrix) { this.addFrame(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, matrix); } /** * Adds other {@link Bounds}. * @param bounds - The Bounds to be added * @param matrix */ }, { key: "addBounds", value: function addBounds(bounds, matrix) { this.addFrame(bounds.minX, bounds.minY, bounds.maxX, bounds.maxY, matrix); } /** * Adds other Bounds, masked with Bounds. * @param mask - The Bounds to be added. */ }, { key: "addBoundsMask", value: function addBoundsMask(mask) { this.minX = this.minX > mask.minX ? this.minX : mask.minX; this.minY = this.minY > mask.minY ? this.minY : mask.minY; this.maxX = this.maxX < mask.maxX ? this.maxX : mask.maxX; this.maxY = this.maxY < mask.maxY ? this.maxY : mask.maxY; } /** * Adds other Bounds, multiplied with matrix. * @param matrix - The matrix to apply to the bounds. */ }, { key: "applyMatrix", value: function applyMatrix(matrix) { var minX = this.minX; var minY = this.minY; var maxX = this.maxX; var maxY = this.maxY; var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d, tx = matrix.tx, ty = matrix.ty; var x = a * minX + c * minY + tx; var y = b * minX + d * minY + ty; this.minX = x; this.minY = y; this.maxX = x; this.maxY = y; x = a * maxX + c * minY + tx; y = b * maxX + d * minY + ty; this.minX = x < this.minX ? x : this.minX; this.minY = y < this.minY ? y : this.minY; this.maxX = x > this.maxX ? x : this.maxX; this.maxY = y > this.maxY ? y : this.maxY; x = a * minX + c * maxY + tx; y = b * minX + d * maxY + ty; this.minX = x < this.minX ? x : this.minX; this.minY = y < this.minY ? y : this.minY; this.maxX = x > this.maxX ? x : this.maxX; this.maxY = y > this.maxY ? y : this.maxY; x = a * maxX + c * maxY + tx; y = b * maxX + d * maxY + ty; this.minX = x < this.minX ? x : this.minX; this.minY = y < this.minY ? y : this.minY; this.maxX = x > this.maxX ? x : this.maxX; this.maxY = y > this.maxY ? y : this.maxY; } /** * Resizes the bounds object to include the given rectangle. * @param rect - The rectangle to be included. */ }, { key: "fit", value: function fit(rect) { if (this.minX < rect.left) this.minX = rect.left; if (this.maxX > rect.right) this.maxX = rect.right; if (this.minY < rect.top) this.minY = rect.top; if (this.maxY > rect.bottom) this.maxY = rect.bottom; return this; } /** * Resizes the bounds object to include the given bounds. * @param left - The left value of the bounds. * @param right - The right value of the bounds. * @param top - The top value of the bounds. * @param bottom - The bottom value of the bounds. */ }, { key: "fitBounds", value: function fitBounds(left, right, top, bottom) { if (this.minX < left) this.minX = left; if (this.maxX > right) this.maxX = right; if (this.minY < top) this.minY = top; if (this.maxY > bottom) this.maxY = bottom; return this; } /** * Pads bounds object, making it grow in all directions. * If paddingY is omitted, both paddingX and paddingY will be set to paddingX. * @param paddingX - The horizontal padding amount. * @param paddingY - The vertical padding amount. */ }, { key: "pad", value: function pad(paddingX) { var paddingY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : paddingX; this.minX -= paddingX; this.maxX += paddingX; this.minY -= paddingY; this.maxY += paddingY; return this; } /** Ceils the bounds. */ }, { key: "ceil", value: function ceil() { this.minX = Math.floor(this.minX); this.minY = Math.floor(this.minY); this.maxX = Math.ceil(this.maxX); this.maxY = Math.ceil(this.maxY); return this; } /** Clones the bounds. */ }, { key: "clone", value: function clone() { return new Bounds(this.minX, this.minY, this.maxX, this.maxY); } /** * Scales the bounds by the given values * @param x - The X value to scale by. * @param y - The Y value to scale by. */ }, { key: "scale", value: function scale(x) { var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; this.minX *= x; this.minY *= y; this.maxX *= x; this.maxY *= y; return this; } /** the x value of the bounds. */ }, { key: "x", get: function get() { return this.minX; }, set: function set(value) { var width = this.maxX - this.minX; this.minX = value; this.maxX = value + width; } /** the y value of the bounds. */ }, { key: "y", get: function get() { return this.minY; }, set: function set(value) { var height = this.maxY - this.minY; this.minY = value; this.maxY = value + height; } /** the width value of the bounds. */ }, { key: "width", get: function get() { return this.maxX - this.minX; }, set: function set(value) { this.maxX = this.minX + value; } /** the height value of the bounds. */ }, { key: "height", get: function get() { return this.maxY - this.minY; }, set: function set(value) { this.maxY = this.minY + value; } /** the left value of the bounds. */ }, { key: "left", get: function get() { return this.minX; } /** the right value of the bounds. */ }, { key: "right", get: function get() { return this.maxX; } /** the top value of the bounds. */ }, { key: "top", get: function get() { return this.minY; } /** the bottom value of the bounds. */ }, { key: "bottom", get: function get() { return this.maxY; } /** Is the bounds positive. */ }, { key: "isPositive", get: function get() { return this.maxX - this.minX > 0 && this.maxY - this.minY > 0; } }, { key: "isValid", get: function get() { return this.minX + this.minY !== Infinity; } /** * Adds screen vertices from array * @param vertexData - calculated vertices * @param beginOffset - begin offset * @param endOffset - end offset, excluded * @param matrix */ }, { key: "addVertexData", value: function addVertexData(vertexData, beginOffset, endOffset, matrix) { var minX = this.minX; var minY = this.minY; var maxX = this.maxX; var maxY = this.maxY; matrix || (matrix = this.matrix); var a = matrix.a; var b = matrix.b; var c = matrix.c; var d = matrix.d; var tx = matrix.tx; var ty = matrix.ty; for (var i = beginOffset; i < endOffset; i += 2) { var localX = vertexData[i]; var localY = vertexData[i + 1]; var x = a * localX + c * localY + tx; var y = b * localX + d * localY + ty; minX = x < minX ? x : minX; minY = y < minY ? y : minY; maxX = x > maxX ? x : maxX; maxY = y > maxY ? y : maxY; } this.minX = minX; this.minY = minY; this.maxX = maxX; this.maxY = maxY; } /** * Checks if the point is contained within the bounds. * @param x - x coordinate * @param y - y coordinate */ }, { key: "containsPoint", value: function containsPoint(x, y) { if (this.minX <= x && this.minY <= y && this.maxX >= x && this.maxY >= y) { return true; } return false; } }, { key: "toString", value: function toString() { return "[pixi.js:Bounds minX=".concat(this.minX, " minY=").concat(this.minY, " maxX=").concat(this.maxX, " maxY=").concat(this.maxY, " width=").concat(this.width, " height=").concat(this.height, "]"); } /** * Copies the bounds from another bounds object. * @param bounds - The bounds to copy from. * @returns - This bounds object. */ }, { key: "copyFrom", value: function copyFrom(bounds) { this.minX = bounds.minX; this.minY = bounds.minY; this.maxX = bounds.maxX; this.maxY = bounds.maxY; return this; } }]); }(); exports.Bounds = Bounds; /***/ }), /***/ 76835: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 77236: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var scaleModeToGlFilter = { linear: 9729, nearest: 9728 }; var mipmapScaleModeToGlFilter = { linear: { linear: 9987, nearest: 9985 }, nearest: { linear: 9986, nearest: 9984 } }; var wrapModeToGlAddress = { "clamp-to-edge": 33071, repeat: 10497, "mirror-repeat": 33648 }; var compareModeToGlCompare = { never: 512, less: 513, equal: 514, "less-equal": 515, greater: 516, "not-equal": 517, "greater-equal": 518, always: 519 }; exports.compareModeToGlCompare = compareModeToGlCompare; exports.mipmapScaleModeToGlFilter = mipmapScaleModeToGlFilter; exports.scaleModeToGlFilter = scaleModeToGlFilter; exports.wrapModeToGlAddress = wrapModeToGlAddress; /***/ }), /***/ 77693: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var CanvasPool = __webpack_require__(88699); var TexturePool = __webpack_require__(53248); var types = __webpack_require__(9634); var isSafari = __webpack_require__(33552); var warn = __webpack_require__(57371); var PoolGroup = __webpack_require__(47505); var getPo2TextureFromSource = __webpack_require__(41701); var HTMLTextRenderData = __webpack_require__(40180); var HTMLTextStyle = __webpack_require__(755); var extractFontFamilies = __webpack_require__(68618); var getFontCss = __webpack_require__(37368); var getSVGUrl = __webpack_require__(91945); var getTemporaryCanvasFromImage = __webpack_require__(4026); var loadSVGImage = __webpack_require__(82423); var measureHtmlText = __webpack_require__(54748); "use strict"; var HTMLTextSystem = /*#__PURE__*/function () { function HTMLTextSystem(renderer) { _classCallCheck(this, HTMLTextSystem); this._activeTextures = {}; this._renderer = renderer; this._createCanvas = renderer.type === types.RendererType.WEBGPU; } return _createClass(HTMLTextSystem, [{ key: "getTexture", value: function getTexture(options) { return this._buildTexturePromise(options.text, options.resolution, options.style); } }, { key: "getManagedTexture", value: function getManagedTexture(text, resolution, style, textKey) { var _this = this; if (this._activeTextures[textKey]) { this._increaseReferenceCount(textKey); return this._activeTextures[textKey].promise; } var promise = this._buildTexturePromise(text, resolution, style).then(function (texture) { _this._activeTextures[textKey].texture = texture; return texture; }); this._activeTextures[textKey] = { texture: null, promise: promise, usageCount: 1 }; return promise; } }, { key: "_buildTexturePromise", value: function () { var _buildTexturePromise2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(text, resolution, style) { var htmlTextData, fontFamilies, fontCSS, measured, width, height, image, uvSafeOffset, svgURL, resource, canvasAndContext, texture; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: htmlTextData = PoolGroup.BigPool.get(HTMLTextRenderData.HTMLTextRenderData); fontFamilies = extractFontFamilies.extractFontFamilies(text, style); _context.n = 1; return getFontCss.getFontCss(fontFamilies, style, HTMLTextStyle.HTMLTextStyle.defaultTextStyle); case 1: fontCSS = _context.v; measured = measureHtmlText.measureHtmlText(text, style, fontCSS, htmlTextData); width = Math.ceil(Math.ceil(Math.max(1, measured.width) + style.padding * 2) * resolution); height = Math.ceil(Math.ceil(Math.max(1, measured.height) + style.padding * 2) * resolution); image = htmlTextData.image; uvSafeOffset = 2; image.width = (width | 0) + uvSafeOffset; image.height = (height | 0) + uvSafeOffset; svgURL = getSVGUrl.getSVGUrl(text, style, resolution, fontCSS, htmlTextData); _context.n = 2; return loadSVGImage.loadSVGImage(image, svgURL, isSafari.isSafari() && fontFamilies.length > 0); case 2: resource = image; if (this._createCanvas) { canvasAndContext = getTemporaryCanvasFromImage.getTemporaryCanvasFromImage(image, resolution); } texture = getPo2TextureFromSource.getPo2TextureFromSource(canvasAndContext ? canvasAndContext.canvas : resource, image.width - uvSafeOffset, image.height - uvSafeOffset, resolution); if (this._createCanvas) { this._renderer.texture.initSource(texture.source); CanvasPool.CanvasPool.returnCanvasAndContext(canvasAndContext); } PoolGroup.BigPool["return"](htmlTextData); return _context.a(2, texture); } }, _callee, this); })); function _buildTexturePromise(_x, _x2, _x3) { return _buildTexturePromise2.apply(this, arguments); } return _buildTexturePromise; }() }, { key: "_increaseReferenceCount", value: function _increaseReferenceCount(textKey) { this._activeTextures[textKey].usageCount++; } }, { key: "decreaseReferenceCount", value: function decreaseReferenceCount(textKey) { var _this2 = this; var activeTexture = this._activeTextures[textKey]; if (!activeTexture) return; activeTexture.usageCount--; if (activeTexture.usageCount === 0) { if (activeTexture.texture) { this._cleanUp(activeTexture); } else { activeTexture.promise.then(function (texture) { activeTexture.texture = texture; _this2._cleanUp(activeTexture); })["catch"](function () { warn.warn("HTMLTextSystem: Failed to clean texture"); }); } this._activeTextures[textKey] = null; } } }, { key: "_cleanUp", value: function _cleanUp(activeTexture) { TexturePool.TexturePool.returnTexture(activeTexture.texture); activeTexture.texture.source.resource = null; activeTexture.texture.source.uploadMethodId = "unknown"; } }, { key: "getReferenceCount", value: function getReferenceCount(textKey) { return this._activeTextures[textKey].usageCount; } }, { key: "destroy", value: function destroy() { this._activeTextures = null; } }]); }(); /** @ignore */ HTMLTextSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "htmlText" }; HTMLTextSystem.defaultFontOptions = { fontFamily: "Arial", fontStyle: "normal", fontWeight: "normal" }; exports.HTMLTextSystem = HTMLTextSystem; /***/ }), /***/ 78115: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var Point = __webpack_require__(75544); var colorToUniform = __webpack_require__(6455); var BindGroup = __webpack_require__(85156); var types = __webpack_require__(9634); var UniformGroup = __webpack_require__(34400); "use strict"; var GlobalUniformSystem = /*#__PURE__*/function () { function GlobalUniformSystem(renderer) { _classCallCheck(this, GlobalUniformSystem); this._stackIndex = 0; this._globalUniformDataStack = []; this._uniformsPool = []; this._activeUniforms = []; this._bindGroupPool = []; this._activeBindGroups = []; this._renderer = renderer; } return _createClass(GlobalUniformSystem, [{ key: "reset", value: function reset() { this._stackIndex = 0; for (var i = 0; i < this._activeUniforms.length; i++) { this._uniformsPool.push(this._activeUniforms[i]); } for (var _i = 0; _i < this._activeBindGroups.length; _i++) { this._bindGroupPool.push(this._activeBindGroups[_i]); } this._activeUniforms.length = 0; this._activeBindGroups.length = 0; } }, { key: "start", value: function start(options) { this.reset(); this.push(options); } }, { key: "bind", value: function bind(_ref) { var size = _ref.size, projectionMatrix = _ref.projectionMatrix, worldTransformMatrix = _ref.worldTransformMatrix, worldColor = _ref.worldColor, offset = _ref.offset; var renderTarget = this._renderer.renderTarget.renderTarget; var currentGlobalUniformData = this._stackIndex ? this._globalUniformDataStack[this._stackIndex - 1] : { projectionData: renderTarget, worldTransformMatrix: new Matrix.Matrix(), worldColor: 4294967295, offset: new Point.Point() }; var globalUniformData = { projectionMatrix: projectionMatrix || this._renderer.renderTarget.projectionMatrix, resolution: size || renderTarget.size, worldTransformMatrix: worldTransformMatrix || currentGlobalUniformData.worldTransformMatrix, worldColor: worldColor || currentGlobalUniformData.worldColor, offset: offset || currentGlobalUniformData.offset, bindGroup: null }; var uniformGroup = this._uniformsPool.pop() || this._createUniforms(); this._activeUniforms.push(uniformGroup); var uniforms = uniformGroup.uniforms; uniforms.uProjectionMatrix = globalUniformData.projectionMatrix; uniforms.uResolution = globalUniformData.resolution; uniforms.uWorldTransformMatrix.copyFrom(globalUniformData.worldTransformMatrix); uniforms.uWorldTransformMatrix.tx -= globalUniformData.offset.x; uniforms.uWorldTransformMatrix.ty -= globalUniformData.offset.y; colorToUniform.color32BitToUniform(globalUniformData.worldColor, uniforms.uWorldColorAlpha, 0); uniformGroup.update(); var bindGroup; if (this._renderer.renderPipes.uniformBatch) { bindGroup = this._renderer.renderPipes.uniformBatch.getUniformBindGroup(uniformGroup, false); } else { bindGroup = this._bindGroupPool.pop() || new BindGroup.BindGroup(); this._activeBindGroups.push(bindGroup); bindGroup.setResource(uniformGroup, 0); } globalUniformData.bindGroup = bindGroup; this._currentGlobalUniformData = globalUniformData; } }, { key: "push", value: function push(options) { this.bind(options); this._globalUniformDataStack[this._stackIndex++] = this._currentGlobalUniformData; } }, { key: "pop", value: function pop() { this._currentGlobalUniformData = this._globalUniformDataStack[--this._stackIndex - 1]; if (this._renderer.type === types.RendererType.WEBGL) { this._currentGlobalUniformData.bindGroup.resources[0].update(); } } }, { key: "bindGroup", get: function get() { return this._currentGlobalUniformData.bindGroup; } }, { key: "globalUniformData", get: function get() { return this._currentGlobalUniformData; } }, { key: "uniformGroup", get: function get() { return this._currentGlobalUniformData.bindGroup.resources[0]; } }, { key: "_createUniforms", value: function _createUniforms() { var globalUniforms = new UniformGroup.UniformGroup({ uProjectionMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uWorldTransformMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, // TODO - someone smart - set this to be a unorm8x4 rather than a vec4<f32> uWorldColorAlpha: { value: new Float32Array(4), type: "vec4<f32>" }, uResolution: { value: [0, 0], type: "vec2<f32>" } }, { isStatic: true }); return globalUniforms; } }, { key: "destroy", value: function destroy() { this._renderer = null; } }]); }(); /** @ignore */ GlobalUniformSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "globalUniforms" }; exports.GlobalUniformSystem = GlobalUniformSystem; /***/ }), /***/ 78440: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var vertex = "in vec2 aPosition;\nout vec2 vTextureCoord;\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"; exports["default"] = vertex; /***/ }), /***/ 78786: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var colorBit = { name: "color-bit", vertex: { header: /* wgsl */"\n @in aColor: vec4<f32>;\n ", main: /* wgsl */"\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n " } }; var colorBitGl = { name: "color-bit", vertex: { header: /* glsl */"\n in vec4 aColor;\n ", main: /* glsl */"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n " } }; exports.colorBit = colorBit; exports.colorBitGl = colorBitGl; /***/ }), /***/ 78838: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; exports.defaultCmp = defaultCmp; exports.heapDown = heapDown; exports.heapPop = heapPop; exports.heapPush = heapPush; exports.heapUp = heapUp; exports.heapify = heapify; function defaultCmp(x, y) { if (x < y) { return -1; } if (x > y) { return 1; } return 0; } ; /** * * @param {Array} arr * @param {Number} pos * @param {Function} cmp */ function heapDown(arr, pos, cmp) { if (!cmp) cmp = defaultCmp; var item = arr[pos]; var endPos = arr.length; var childPos = pos << 1 | 1; var childRightPos; while (childPos < endPos) { childRightPos = childPos + 1; if (childPos + 1 < endPos && cmp(arr[childPos], arr[childRightPos]) > 0) { childPos = childRightPos; } if (cmp(arr[childPos], item) < 0) { arr[pos] = arr[childPos]; arr[childPos] = item; pos = childPos; childPos = pos << 1 | 1; } else break; } } /** * * @param {Array} arr * @param {Number} pos * @param {Function} cmp */ function heapUp(arr, pos, cmp) { if (!cmp) cmp = defaultCmp; var item = arr[pos]; var parPos; while (pos > 0) { parPos = pos - 1 >> 1; if (cmp(arr[parPos], item) > 0) { arr[pos] = arr[parPos]; arr[parPos] = item; pos = parPos; } else break; } } /** * * @param {Array} arr * @param {Function} cmp */ function heapify(arr, cmp) { if (!cmp) cmp = defaultCmp; var endPos = arr.length; for (var i = 0; i < endPos; ++i) heapUp(arr, i, cmp); } /** * * @param {Array} arr * @param {Function} cmp */ function heapPop(arr, cmp) { if (!cmp) cmp = defaultCmp; var item = arr[0]; var lastItem = arr.pop(); if (arr.length > 0) { arr[0] = lastItem; heapDown(arr, 0, cmp); } return item; } /** * * @param {Array} arr * @param {*} item * @param {Function} cmp */ function heapPush(arr, item, cmp) { if (!cmp) cmp = defaultCmp; arr.push(item); heapUp(arr, arr.length - 1, cmp); } function Heap(cmd) { this.cmp = cmd || defaultCmp; this.arr = []; } /** * @param {Array} arr * @param {Function} cmp * @returns {Heap} */ Heap.fromArray = function (arr, cmp) { var heap = new Heap(cmp); heapify(arr); heap.arr = arr; return heap; }; Heap.prototype.push = function (x) { heapPush(this.arr, x, this.cmp); return this; }; Heap.prototype.pop = function () { return heapPop(this.arr, this.cmp); }; Heap.prototype.peek = function () { return this.arr[0]; }; Heap.prototype.contains = function (x) { return this.arr.indexOf(x) !== -1; }; Heap.prototype.clear = function () { this.arr.splice(0, this.arr.length); return this; }; Heap.prototype.empty = function () { return this.arr.length === 0; }; Heap.prototype.size = function () { return this.arr.length; }; Heap.prototype.clone = function () { var heap; heap = new Heap(this.cmp); heap.arr = this.arr.slice(0); return heap; }; Heap.prototype.toArray = function () { return this.arr.slice(0); }; Heap.prototype.toSortedArray = function () { var res = []; var heap = this.clone(); while (!heap.empty()) res.push(heap.pop()); return res; }; Heap.prototype.insert = Heap.prototype.push; Heap.prototype.top = Heap.prototype.peek; Heap.prototype.front = Heap.prototype.peek; Heap.prototype.has = Heap.prototype.contains; Heap.prototype.copy = Heap.prototype.clone; var _default = exports["default"] = Heap; /***/ }), /***/ 78974: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var adapter = __webpack_require__(72450); "use strict"; function loadFontAsBase64(_x) { return _loadFontAsBase.apply(this, arguments); } function _loadFontAsBase() { _loadFontAsBase = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(url) { var response, blob, reader, dataSrc; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return adapter.DOMAdapter.get().fetch(url); case 1: response = _context.v; _context.n = 2; return response.blob(); case 2: blob = _context.v; reader = new FileReader(); _context.n = 3; return new Promise(function (resolve, reject) { reader.onloadend = function () { return resolve(reader.result); }; reader.onerror = reject; reader.readAsDataURL(blob); }); case 3: dataSrc = _context.v; return _context.a(2, dataSrc); } }, _callee); })); return _loadFontAsBase.apply(this, arguments); } exports.loadFontAsBase64 = loadFontAsBase64; /***/ }), /***/ 79236: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Buffer = __webpack_require__(59832); var BufferResource = __webpack_require__(1484); var _const = __webpack_require__(33843); var UboBatch = __webpack_require__(41581); var BindGroup = __webpack_require__(85156); "use strict"; var minUniformOffsetAlignment = 128; var GpuUniformBatchPipe = /*#__PURE__*/function () { function GpuUniformBatchPipe(renderer) { _classCallCheck(this, GpuUniformBatchPipe); this._bindGroupHash = /* @__PURE__ */Object.create(null); // number of buffers.. this._buffers = []; this._bindGroups = []; this._bufferResources = []; this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_bindGroupHash"); this._batchBuffer = new UboBatch.UboBatch({ minUniformOffsetAlignment: minUniformOffsetAlignment }); var totalBuffers = 256 / minUniformOffsetAlignment; for (var i = 0; i < totalBuffers; i++) { var usage = _const.BufferUsage.UNIFORM | _const.BufferUsage.COPY_DST; if (i === 0) usage |= _const.BufferUsage.COPY_SRC; this._buffers.push(new Buffer.Buffer({ data: this._batchBuffer.data, usage: usage })); } } return _createClass(GpuUniformBatchPipe, [{ key: "renderEnd", value: function renderEnd() { this._uploadBindGroups(); this._resetBindGroups(); } }, { key: "_resetBindGroups", value: function _resetBindGroups() { for (var i in this._bindGroupHash) { this._bindGroupHash[i] = null; } this._batchBuffer.clear(); } // just works for single bind groups for now }, { key: "getUniformBindGroup", value: function getUniformBindGroup(group, duplicate) { if (!duplicate && this._bindGroupHash[group.uid]) { return this._bindGroupHash[group.uid]; } this._renderer.ubo.ensureUniformGroup(group); var data = group.buffer.data; var offset = this._batchBuffer.addEmptyGroup(data.length); this._renderer.ubo.syncUniformGroup(group, this._batchBuffer.data, offset / 4); this._bindGroupHash[group.uid] = this._getBindGroup(offset / minUniformOffsetAlignment); return this._bindGroupHash[group.uid]; } }, { key: "getUboResource", value: function getUboResource(group) { this._renderer.ubo.updateUniformGroup(group); var data = group.buffer.data; var offset = this._batchBuffer.addGroup(data); return this._getBufferResource(offset / minUniformOffsetAlignment); } }, { key: "getArrayBindGroup", value: function getArrayBindGroup(data) { var offset = this._batchBuffer.addGroup(data); return this._getBindGroup(offset / minUniformOffsetAlignment); } }, { key: "getArrayBufferResource", value: function getArrayBufferResource(data) { var offset = this._batchBuffer.addGroup(data); var index = offset / minUniformOffsetAlignment; return this._getBufferResource(index); } }, { key: "_getBufferResource", value: function _getBufferResource(index) { if (!this._bufferResources[index]) { var buffer = this._buffers[index % 2]; this._bufferResources[index] = new BufferResource.BufferResource({ buffer: buffer, offset: (index / 2 | 0) * 256, size: minUniformOffsetAlignment }); } return this._bufferResources[index]; } }, { key: "_getBindGroup", value: function _getBindGroup(index) { if (!this._bindGroups[index]) { var bindGroup = new BindGroup.BindGroup({ 0: this._getBufferResource(index) }); this._bindGroups[index] = bindGroup; } return this._bindGroups[index]; } }, { key: "_uploadBindGroups", value: function _uploadBindGroups() { var bufferSystem = this._renderer.buffer; var firstBuffer = this._buffers[0]; firstBuffer.update(this._batchBuffer.byteIndex); bufferSystem.updateBuffer(firstBuffer); var commandEncoder = this._renderer.gpu.device.createCommandEncoder(); for (var i = 1; i < this._buffers.length; i++) { var buffer = this._buffers[i]; commandEncoder.copyBufferToBuffer(bufferSystem.getGPUBuffer(firstBuffer), minUniformOffsetAlignment, bufferSystem.getGPUBuffer(buffer), 0, this._batchBuffer.byteIndex); } this._renderer.gpu.device.queue.submit([commandEncoder.finish()]); } }, { key: "destroy", value: function destroy() { for (var i = 0; i < this._bindGroups.length; i++) { this._bindGroups[i].destroy(); } this._bindGroups = null; this._bindGroupHash = null; for (var _i = 0; _i < this._buffers.length; _i++) { this._buffers[_i].destroy(); } this._buffers = null; for (var _i2 = 0; _i2 < this._bufferResources.length; _i2++) { this._bufferResources[_i2].destroy(); } this._bufferResources = null; this._batchBuffer.destroy(); this._bindGroupHash = null; this._renderer = null; } }]); }(); /** @ignore */ GpuUniformBatchPipe.extension = { type: [Extensions.ExtensionType.WebGPUPipes], name: "uniformBatch" }; exports.GpuUniformBatchPipe = GpuUniformBatchPipe; /***/ }), /***/ 79259: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var LoaderParser = __webpack_require__(96804); var createTexture = __webpack_require__(49698); var checkExtension = __webpack_require__(59230); var Extensions = __webpack_require__(86890); var CompressedSource = __webpack_require__(49326); var getSupportedTextureFormats = __webpack_require__(10144); var parseKTX = __webpack_require__(3200); "use strict"; var loadKTX = { extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.High, name: "loadKTX" }, name: "loadKTX", test: function test(url) { return checkExtension.checkExtension(url, ".ktx"); }, load: function load(url, _asset, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var supportedTextures, ktxResponse, ktxArrayBuffer, textureOptions, compressedTextureSource; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return getSupportedTextureFormats.getSupportedTextureFormats(); case 1: supportedTextures = _context.v; _context.n = 2; return fetch(url); case 2: ktxResponse = _context.v; _context.n = 3; return ktxResponse.arrayBuffer(); case 3: ktxArrayBuffer = _context.v; textureOptions = parseKTX.parseKTX(ktxArrayBuffer, supportedTextures); compressedTextureSource = new CompressedSource.CompressedSource(textureOptions); return _context.a(2, createTexture.createTexture(compressedTextureSource, loader, url)); } }, _callee); }))(); }, unload: function unload(texture) { if (Array.isArray(texture)) { texture.forEach(function (t) { return t.destroy(true); }); } else { texture.destroy(true); } } }; exports.loadKTX = loadKTX; /***/ }), /***/ 79379: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function formatShader(shader) { var spl = shader.split(/([\n{}])/g).map(function (a) { return a.trim(); }).filter(function (a) { return a.length; }); var indent = ""; var formatted = spl.map(function (a) { var indentedLine = indent + a; if (a === "{") { indent += " "; } else if (a === "}") { indent = indent.substr(0, indent.length - 4); indentedLine = indent + a; } return indentedLine; }).join("\n"); return formatted; } exports.formatShader = formatShader; /***/ }), /***/ 79471: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var idCounts = /* @__PURE__ */Object.create(null); var idHash = /* @__PURE__ */Object.create(null); function createIdFromString(value, groupId) { var id = idHash[value]; if (id === void 0) { if (idCounts[groupId] === void 0) { idCounts[groupId] = 1; } idHash[value] = id = idCounts[groupId]++; } return id; } exports.createIdFromString = createIdFromString; /***/ }), /***/ 79556: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var fragment = "\nin vec2 vTextureCoord;\nin vec4 vColor;\n\nout vec4 finalColor;\n\nuniform float uColorMatrix[20];\nuniform float uAlpha;\n\nuniform sampler2D uTexture;\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 = texture(uTexture, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * 0.2);\n float diff = (randomValue - 0.5) * 0.5;\n\n if (uAlpha == 0.0) {\n finalColor = color;\n return;\n }\n\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n vec4 result;\n\n result.r = (uColorMatrix[0] * color.r);\n result.r += (uColorMatrix[1] * color.g);\n result.r += (uColorMatrix[2] * color.b);\n result.r += (uColorMatrix[3] * color.a);\n result.r += uColorMatrix[4];\n\n result.g = (uColorMatrix[5] * color.r);\n result.g += (uColorMatrix[6] * color.g);\n result.g += (uColorMatrix[7] * color.b);\n result.g += (uColorMatrix[8] * color.a);\n result.g += uColorMatrix[9];\n\n result.b = (uColorMatrix[10] * color.r);\n result.b += (uColorMatrix[11] * color.g);\n result.b += (uColorMatrix[12] * color.b);\n result.b += (uColorMatrix[13] * color.a);\n result.b += uColorMatrix[14];\n\n result.a = (uColorMatrix[15] * color.r);\n result.a += (uColorMatrix[16] * color.g);\n result.a += (uColorMatrix[17] * color.b);\n result.a += (uColorMatrix[18] * color.a);\n result.a += uColorMatrix[19];\n\n vec3 rgb = mix(color.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n finalColor = vec4(rgb, result.a);\n}\n"; exports["default"] = fragment; /***/ }), /***/ 79679: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var Rectangle = __webpack_require__(74731); var deprecation = __webpack_require__(11225); var RenderTarget = __webpack_require__(25654); var getCanvasTexture = __webpack_require__(57240); "use strict"; var _ViewSystem = /*#__PURE__*/function () { function _ViewSystem() { _classCallCheck(this, _ViewSystem); } return _createClass(_ViewSystem, [{ key: "autoDensity", get: /** * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically. * @member {boolean} */ function get() { return this.texture.source.autoDensity; }, set: function set(value) { this.texture.source.autoDensity = value; } /** The resolution / device pixel ratio of the renderer. */ }, { key: "resolution", get: function get() { return this.texture.source._resolution; }, set: function set(value) { this.texture.source.resize(this.texture.source.width, this.texture.source.height, value); } /** * initiates the view system * @param options - the options for the view */ }, { key: "init", value: function init(options) { options = _objectSpread(_objectSpread({}, _ViewSystem.defaultOptions), options); if (options.view) { deprecation.deprecation(deprecation.v8_0_0, "ViewSystem.view has been renamed to ViewSystem.canvas"); options.canvas = options.view; } this.screen = new Rectangle.Rectangle(0, 0, options.width, options.height); this.canvas = options.canvas || adapter.DOMAdapter.get().createCanvas(); this.antialias = !!options.antialias; this.texture = getCanvasTexture.getCanvasTexture(this.canvas, options); this.renderTarget = new RenderTarget.RenderTarget({ colorTextures: [this.texture], depth: !!options.depth, isRoot: true }); this.texture.source.transparent = options.backgroundAlpha < 1; this.resolution = options.resolution; } /** * Resizes the screen and canvas to the specified dimensions. * @param desiredScreenWidth - The new width of the screen. * @param desiredScreenHeight - The new height of the screen. * @param resolution */ }, { key: "resize", value: function resize(desiredScreenWidth, desiredScreenHeight, resolution) { this.texture.source.resize(desiredScreenWidth, desiredScreenHeight, resolution); this.screen.width = this.texture.frame.width; this.screen.height = this.texture.frame.height; } /** * Destroys this System and optionally removes the canvas from the dom. * @param {options | false} options - The options for destroying the view, or "false". * @param options.removeView - Whether to remove the view element from the DOM. Defaults to `false`. */ }, { key: "destroy", value: function destroy() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var removeView = typeof options === "boolean" ? options : !!(options !== null && options !== void 0 && options.removeView); if (removeView && this.canvas.parentNode) { this.canvas.parentNode.removeChild(this.canvas); } } }]); }(); /** @ignore */ _ViewSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "view", priority: 0 }; /** The default options for the view system. */ _ViewSystem.defaultOptions = { /** * {@link WebGLOptions.width} * @default 800 */ width: 800, /** * {@link WebGLOptions.height} * @default 600 */ height: 600, /** * {@link WebGLOptions.autoDensity} * @default false */ autoDensity: false, /** * {@link WebGLOptions.antialias} * @default false */ antialias: false }; var ViewSystem = _ViewSystem; exports.ViewSystem = ViewSystem; /***/ }), /***/ 79826: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Rectangle = __webpack_require__(74731); var Texture = __webpack_require__(73782); var AbstractBitmapFont = __webpack_require__(17660); var BitmapFontManager = __webpack_require__(30815); "use strict"; var BitmapFont = /*#__PURE__*/function (_AbstractBitmapFont$A) { function BitmapFont(options, url) { var _data$distanceField; var _this; _classCallCheck(this, BitmapFont); _this = _callSuper(this, BitmapFont); var textures = options.textures, data = options.data; Object.keys(data.pages).forEach(function (key) { var pageData = data.pages[parseInt(key, 10)]; var texture = textures[pageData.id]; _this.pages.push({ texture: texture }); }); Object.keys(data.chars).forEach(function (key) { var _charData$kerning; var charData = data.chars[key]; var _textures$charData$pa = textures[charData.page], textureFrame = _textures$charData$pa.frame, textureSource = _textures$charData$pa.source; var frameReal = new Rectangle.Rectangle(charData.x + textureFrame.x, charData.y + textureFrame.y, charData.width, charData.height); var texture = new Texture.Texture({ source: textureSource, frame: frameReal }); _this.chars[key] = { id: key.codePointAt(0), xOffset: charData.xOffset, yOffset: charData.yOffset, xAdvance: charData.xAdvance, kerning: (_charData$kerning = charData.kerning) !== null && _charData$kerning !== void 0 ? _charData$kerning : {}, texture: texture }; }); _this.baseRenderedFontSize = data.fontSize; _this.baseMeasurementFontSize = data.fontSize; _this.fontMetrics = { ascent: 0, descent: 0, fontSize: data.fontSize }; _this.baseLineOffset = data.baseLineOffset; _this.lineHeight = data.lineHeight; _this.fontFamily = data.fontFamily; _this.distanceField = (_data$distanceField = data.distanceField) !== null && _data$distanceField !== void 0 ? _data$distanceField : { type: "none", range: 0 }; _this.url = url; return _this; } /** Destroys the BitmapFont object. */ _inherits(BitmapFont, _AbstractBitmapFont$A); return _createClass(BitmapFont, [{ key: "destroy", value: function destroy() { _superPropGet(BitmapFont, "destroy", this, 3)([]); for (var i = 0; i < this.pages.length; i++) { var texture = this.pages[i].texture; texture.destroy(true); } this.pages = null; } /** * Generates a bitmap-font for the given style and character set * @param options - Setup options for font generation. * @returns Font generated by style options. * @example * import { BitmapFont, BitmapText } from 'pixi.js'; * * BitmapFont.install('TitleFont', { * fontFamily: 'Arial', * fontSize: 12, * strokeThickness: 2, * fill: 'purple', * }); * * const title = new BitmapText({ text: 'This is the title', fontFamily: 'TitleFont' }); */ }], [{ key: "install", value: function install(options) { BitmapFontManager.BitmapFontManager.install(options); } /** * Uninstalls a bitmap font from the cache. * @param {string} name - The name of the bitmap font to uninstall. */ }, { key: "uninstall", value: function uninstall(name) { BitmapFontManager.BitmapFontManager.uninstall(name); } }]); }(AbstractBitmapFont.AbstractBitmapFont); exports.BitmapFont = BitmapFont; /***/ }), /***/ 79904: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var multiplyHexColors = __webpack_require__(6967); "use strict"; var WHITE_BGR = 16777215; function multiplyColors(localBGRColor, parentBGRColor) { if (localBGRColor === WHITE_BGR) { return parentBGRColor; } if (parentBGRColor === WHITE_BGR) { return localBGRColor; } return multiplyHexColors.multiplyHexColors(localBGRColor, parentBGRColor); } exports.multiplyColors = multiplyColors; /***/ }), /***/ 80013: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 80176: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var GL_FORMATS = /* @__PURE__ */function (GL_FORMATS2) { GL_FORMATS2[GL_FORMATS2["RGBA"] = 6408] = "RGBA"; GL_FORMATS2[GL_FORMATS2["RGB"] = 6407] = "RGB"; GL_FORMATS2[GL_FORMATS2["RG"] = 33319] = "RG"; GL_FORMATS2[GL_FORMATS2["RED"] = 6403] = "RED"; GL_FORMATS2[GL_FORMATS2["RGBA_INTEGER"] = 36249] = "RGBA_INTEGER"; GL_FORMATS2[GL_FORMATS2["RGB_INTEGER"] = 36248] = "RGB_INTEGER"; GL_FORMATS2[GL_FORMATS2["RG_INTEGER"] = 33320] = "RG_INTEGER"; GL_FORMATS2[GL_FORMATS2["RED_INTEGER"] = 36244] = "RED_INTEGER"; GL_FORMATS2[GL_FORMATS2["ALPHA"] = 6406] = "ALPHA"; GL_FORMATS2[GL_FORMATS2["LUMINANCE"] = 6409] = "LUMINANCE"; GL_FORMATS2[GL_FORMATS2["LUMINANCE_ALPHA"] = 6410] = "LUMINANCE_ALPHA"; GL_FORMATS2[GL_FORMATS2["DEPTH_COMPONENT"] = 6402] = "DEPTH_COMPONENT"; GL_FORMATS2[GL_FORMATS2["DEPTH_STENCIL"] = 34041] = "DEPTH_STENCIL"; return GL_FORMATS2; }(GL_FORMATS || {}); var GL_TARGETS = /* @__PURE__ */function (GL_TARGETS2) { GL_TARGETS2[GL_TARGETS2["TEXTURE_2D"] = 3553] = "TEXTURE_2D"; GL_TARGETS2[GL_TARGETS2["TEXTURE_CUBE_MAP"] = 34067] = "TEXTURE_CUBE_MAP"; GL_TARGETS2[GL_TARGETS2["TEXTURE_2D_ARRAY"] = 35866] = "TEXTURE_2D_ARRAY"; GL_TARGETS2[GL_TARGETS2["TEXTURE_CUBE_MAP_POSITIVE_X"] = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X"; GL_TARGETS2[GL_TARGETS2["TEXTURE_CUBE_MAP_NEGATIVE_X"] = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X"; GL_TARGETS2[GL_TARGETS2["TEXTURE_CUBE_MAP_POSITIVE_Y"] = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y"; GL_TARGETS2[GL_TARGETS2["TEXTURE_CUBE_MAP_NEGATIVE_Y"] = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y"; GL_TARGETS2[GL_TARGETS2["TEXTURE_CUBE_MAP_POSITIVE_Z"] = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z"; GL_TARGETS2[GL_TARGETS2["TEXTURE_CUBE_MAP_NEGATIVE_Z"] = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z"; return GL_TARGETS2; }(GL_TARGETS || {}); var GL_WRAP_MODES = /* @__PURE__ */function (GL_WRAP_MODES2) { GL_WRAP_MODES2[GL_WRAP_MODES2["CLAMP"] = 33071] = "CLAMP"; GL_WRAP_MODES2[GL_WRAP_MODES2["REPEAT"] = 10497] = "REPEAT"; GL_WRAP_MODES2[GL_WRAP_MODES2["MIRRORED_REPEAT"] = 33648] = "MIRRORED_REPEAT"; return GL_WRAP_MODES2; }(GL_WRAP_MODES || {}); var GL_TYPES = /* @__PURE__ */function (GL_TYPES2) { GL_TYPES2[GL_TYPES2["UNSIGNED_BYTE"] = 5121] = "UNSIGNED_BYTE"; GL_TYPES2[GL_TYPES2["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT"; GL_TYPES2[GL_TYPES2["UNSIGNED_SHORT_5_6_5"] = 33635] = "UNSIGNED_SHORT_5_6_5"; GL_TYPES2[GL_TYPES2["UNSIGNED_SHORT_4_4_4_4"] = 32819] = "UNSIGNED_SHORT_4_4_4_4"; GL_TYPES2[GL_TYPES2["UNSIGNED_SHORT_5_5_5_1"] = 32820] = "UNSIGNED_SHORT_5_5_5_1"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT"] = 5125] = "UNSIGNED_INT"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT_10F_11F_11F_REV"] = 35899] = "UNSIGNED_INT_10F_11F_11F_REV"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT_2_10_10_10_REV"] = 33640] = "UNSIGNED_INT_2_10_10_10_REV"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT_24_8"] = 34042] = "UNSIGNED_INT_24_8"; GL_TYPES2[GL_TYPES2["UNSIGNED_INT_5_9_9_9_REV"] = 35902] = "UNSIGNED_INT_5_9_9_9_REV"; GL_TYPES2[GL_TYPES2["BYTE"] = 5120] = "BYTE"; GL_TYPES2[GL_TYPES2["SHORT"] = 5122] = "SHORT"; GL_TYPES2[GL_TYPES2["INT"] = 5124] = "INT"; GL_TYPES2[GL_TYPES2["FLOAT"] = 5126] = "FLOAT"; GL_TYPES2[GL_TYPES2["FLOAT_32_UNSIGNED_INT_24_8_REV"] = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV"; GL_TYPES2[GL_TYPES2["HALF_FLOAT"] = 36193] = "HALF_FLOAT"; return GL_TYPES2; }(GL_TYPES || {}); exports.GL_FORMATS = GL_FORMATS; exports.GL_TARGETS = GL_TARGETS; exports.GL_TYPES = GL_TYPES; exports.GL_WRAP_MODES = GL_WRAP_MODES; /***/ }), /***/ 80344: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var warn = __webpack_require__(57371); var TextureSource = __webpack_require__(55406); "use strict"; var ImageSource = /*#__PURE__*/function (_TextureSource$Textur) { function ImageSource(options) { var _this; _classCallCheck(this, ImageSource); if (options.resource && globalThis.HTMLImageElement && options.resource instanceof HTMLImageElement) { var canvas = adapter.DOMAdapter.get().createCanvas(options.resource.width, options.resource.height); var context = canvas.getContext("2d"); context.drawImage(options.resource, 0, 0, options.resource.width, options.resource.height); options.resource = canvas; warn.warn("ImageSource: Image element passed, converting to canvas. Use CanvasSource instead."); } _this = _callSuper(this, ImageSource, [options]); _this.uploadMethodId = "image"; _this.autoGarbageCollect = true; return _this; } _inherits(ImageSource, _TextureSource$Textur); return _createClass(ImageSource, null, [{ key: "test", value: function test(resource) { return globalThis.HTMLImageElement && resource instanceof HTMLImageElement || typeof ImageBitmap !== "undefined" && resource instanceof ImageBitmap || globalThis.VideoFrame && resource instanceof VideoFrame; } }]); }(TextureSource.TextureSource); ImageSource.extension = Extensions.ExtensionType.TextureSource; exports.ImageSource = ImageSource; /***/ }), /***/ 80396: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var loadBitmapFont = __webpack_require__(87115); var warn = __webpack_require__(57371); var BackgroundLoader = __webpack_require__(51814); var Cache = __webpack_require__(65278); var cacheTextureArray = __webpack_require__(62997); var detectAvif = __webpack_require__(33634); var detectDefaults = __webpack_require__(51783); var detectMp4 = __webpack_require__(2675); var detectOgv = __webpack_require__(20180); var detectWebm = __webpack_require__(52371); var detectWebp = __webpack_require__(42264); var Loader = __webpack_require__(85898); var loadJson = __webpack_require__(23962); var loadTxt = __webpack_require__(24778); var loadWebFont = __webpack_require__(43885); var loadSVG = __webpack_require__(10465); var loadTextures = __webpack_require__(7407); var loadVideoTextures = __webpack_require__(7272); var resolveJsonUrl = __webpack_require__(20720); var resolveTextureUrl = __webpack_require__(12435); var Resolver = __webpack_require__(54080); var convertToList = __webpack_require__(28097); var isSingleItem = __webpack_require__(91208); "use strict"; var AssetsClass = /*#__PURE__*/function () { function AssetsClass() { _classCallCheck(this, AssetsClass); this._detections = []; this._initialized = false; this.resolver = new Resolver.Resolver(); this.loader = new Loader.Loader(); this.cache = Cache.Cache; this._backgroundLoader = new BackgroundLoader.BackgroundLoader(this.loader); this._backgroundLoader.active = true; this.reset(); } /** * Best practice is to call this function before any loading commences * Initiating is the best time to add any customization to the way things are loaded. * * you do not need to call this for the Assets class to work, only if you want to set any initial properties * @param options - options to initialize the Assets manager with */ return _createClass(AssetsClass, [{ key: "init", value: (function () { var _init = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var _options$texturePrefe, _options$texturePrefe2, _options$texturePrefe3; var options, manifest, resolutionPref, resolution, formats, _args = arguments; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; if (!this._initialized) { _context.n = 1; break; } warn.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?"); return _context.a(2); case 1: this._initialized = true; if (options.defaultSearchParams) { this.resolver.setDefaultSearchParams(options.defaultSearchParams); } if (options.basePath) { this.resolver.basePath = options.basePath; } if (options.bundleIdentifier) { this.resolver.setBundleIdentifier(options.bundleIdentifier); } if (!options.manifest) { _context.n = 4; break; } manifest = options.manifest; if (!(typeof manifest === "string")) { _context.n = 3; break; } _context.n = 2; return this.load(manifest); case 2: manifest = _context.v; case 3: this.resolver.addManifest(manifest); case 4: resolutionPref = (_options$texturePrefe = (_options$texturePrefe2 = options.texturePreference) === null || _options$texturePrefe2 === void 0 ? void 0 : _options$texturePrefe2.resolution) !== null && _options$texturePrefe !== void 0 ? _options$texturePrefe : 1; resolution = typeof resolutionPref === "number" ? [resolutionPref] : resolutionPref; _context.n = 5; return this._detectFormats({ preferredFormats: (_options$texturePrefe3 = options.texturePreference) === null || _options$texturePrefe3 === void 0 ? void 0 : _options$texturePrefe3.format, skipDetections: options.skipDetections, detections: this._detections }); case 5: formats = _context.v; this.resolver.prefer({ params: { format: formats, resolution: resolution } }); if (options.preferences) { this.setPreferences(options.preferences); } case 6: return _context.a(2); } }, _callee, this); })); function init() { return _init.apply(this, arguments); } return init; }() /** * Allows you to specify how to resolve any assets load requests. * There are a few ways to add things here as shown below: * @example * import { Assets } from 'pixi.js'; * * // Simple * Assets.add({alias: 'bunnyBooBoo', src: 'bunny.png'}); * const bunny = await Assets.load('bunnyBooBoo'); * * // Multiple keys: * Assets.add({alias: ['burger', 'chicken'], src: 'bunny.png'}); * * const bunny = await Assets.load('burger'); * const bunny2 = await Assets.load('chicken'); * * // passing options to to the object * Assets.add({ * alias: 'bunnyBooBooSmooth', * src: 'bunny.{png,webp}', * data: { scaleMode: SCALE_MODES.NEAREST }, // Base texture options * }); * * // Multiple assets * * // The following all do the same thing: * * Assets.add({alias: 'bunnyBooBoo', src: 'bunny.{png,webp}'}); * * Assets.add({ * alias: 'bunnyBooBoo', * src: [ * 'bunny.png', * 'bunny.webp', * ], * }); * * const bunny = await Assets.load('bunnyBooBoo'); // Will try to load WebP if available * @param assets - the unresolved assets to add to the resolver */ ) }, { key: "add", value: function add(assets) { this.resolver.add(assets); } }, { key: "load", value: function () { var _load = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(urls, onProgress) { var _this = this; var singleAsset, urlArray, resolveResults, out; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: if (this._initialized) { _context2.n = 1; break; } _context2.n = 1; return this.init(); case 1: singleAsset = isSingleItem.isSingleItem(urls); urlArray = convertToList.convertToList(urls).map(function (url) { if (typeof url !== "string") { var aliases = _this.resolver.getAlias(url); if (aliases.some(function (alias) { return !_this.resolver.hasKey(alias); })) { _this.add(url); } return Array.isArray(aliases) ? aliases[0] : aliases; } if (!_this.resolver.hasKey(url)) _this.add({ alias: url, src: url }); return url; }); resolveResults = this.resolver.resolve(urlArray); _context2.n = 2; return this._mapLoadToResolve(resolveResults, onProgress); case 2: out = _context2.v; return _context2.a(2, singleAsset ? out[urlArray[0]] : out); } }, _callee2, this); })); function load(_x, _x2) { return _load.apply(this, arguments); } return load; }() /** * This adds a bundle of assets in one go so that you can load them as a group. * For example you could add a bundle for each screen in you pixi app * @example * import { Assets } from 'pixi.js'; * * Assets.addBundle('animals', [ * { alias: 'bunny', src: 'bunny.png' }, * { alias: 'chicken', src: 'chicken.png' }, * { alias: 'thumper', src: 'thumper.png' }, * ]); * // or * Assets.addBundle('animals', { * bunny: 'bunny.png', * chicken: 'chicken.png', * thumper: 'thumper.png', * }); * * const assets = await Assets.loadBundle('animals'); * @param bundleId - the id of the bundle to add * @param assets - a record of the asset or assets that will be chosen from when loading via the specified key */ }, { key: "addBundle", value: function addBundle(bundleId, assets) { this.resolver.addBundle(bundleId, assets); } /** * Bundles are a way to load multiple assets at once. * If a manifest has been provided to the init function then you can load a bundle, or bundles. * you can also add bundles via `addBundle` * @example * import { Assets } from 'pixi.js'; * * // Manifest Example * const manifest = { * bundles: [ * { * name: 'load-screen', * assets: [ * { * alias: 'background', * src: 'sunset.png', * }, * { * alias: 'bar', * src: 'load-bar.{png,webp}', * }, * ], * }, * { * name: 'game-screen', * assets: [ * { * alias: 'character', * src: 'robot.png', * }, * { * alias: 'enemy', * src: 'bad-guy.png', * }, * ], * }, * ] * }; * * await Assets.init({ manifest }); * * // Load a bundle... * loadScreenAssets = await Assets.loadBundle('load-screen'); * // Load another bundle... * gameScreenAssets = await Assets.loadBundle('game-screen'); * @param bundleIds - the bundle id or ids to load * @param onProgress - Optional function that is called when progress on asset loading is made. * The function is passed a single parameter, `progress`, which represents the percentage (0.0 - 1.0) * of the assets loaded. Do not use this function to detect when assets are complete and available, * instead use the Promise returned by this function. * @returns all the bundles assets or a hash of assets for each bundle specified */ }, { key: "loadBundle", value: (function () { var _loadBundle = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(bundleIds, onProgress) { var _this2 = this; var singleAsset, resolveResults, out, keys, count, total, _onProgress, promises; return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: if (this._initialized) { _context3.n = 1; break; } _context3.n = 1; return this.init(); case 1: singleAsset = false; if (typeof bundleIds === "string") { singleAsset = true; bundleIds = [bundleIds]; } resolveResults = this.resolver.resolveBundle(bundleIds); out = {}; keys = Object.keys(resolveResults); count = 0; total = 0; _onProgress = function _onProgress() { onProgress === null || onProgress === void 0 || onProgress(++count / total); }; promises = keys.map(function (bundleId) { var resolveResult = resolveResults[bundleId]; total += Object.keys(resolveResult).length; return _this2._mapLoadToResolve(resolveResult, _onProgress).then(function (resolveResult2) { out[bundleId] = resolveResult2; }); }); _context3.n = 2; return Promise.all(promises); case 2: return _context3.a(2, singleAsset ? out[bundleIds[0]] : out); } }, _callee3, this); })); function loadBundle(_x3, _x4) { return _loadBundle.apply(this, arguments); } return loadBundle; }() /** * Initiate a background load of some assets. It will passively begin to load these assets in the background. * So when you actually come to loading them you will get a promise that resolves to the loaded assets immediately * * An example of this might be that you would background load game assets after your initial load. * then when you got to actually load your game screen assets when a player goes to the game - the loading * would already have stared or may even be complete, saving you having to show an interim load bar. * @example * import { Assets } from 'pixi.js'; * * Assets.backgroundLoad('bunny.png'); * * // later on in your app... * await Assets.loadBundle('bunny.png'); // Will resolve quicker as loading may have completed! * @param urls - the url / urls you want to background load */ ) }, { key: "backgroundLoad", value: (function () { var _backgroundLoad = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(urls) { var resolveResults; return _regenerator().w(function (_context4) { while (1) switch (_context4.n) { case 0: if (this._initialized) { _context4.n = 1; break; } _context4.n = 1; return this.init(); case 1: if (typeof urls === "string") { urls = [urls]; } resolveResults = this.resolver.resolve(urls); this._backgroundLoader.add(Object.values(resolveResults)); case 2: return _context4.a(2); } }, _callee4, this); })); function backgroundLoad(_x5) { return _backgroundLoad.apply(this, arguments); } return backgroundLoad; }() /** * Initiate a background of a bundle, works exactly like backgroundLoad but for bundles. * this can only be used if the loader has been initiated with a manifest * @example * import { Assets } from 'pixi.js'; * * await Assets.init({ * manifest: { * bundles: [ * { * name: 'load-screen', * assets: [...], * }, * ... * ], * }, * }); * * Assets.backgroundLoadBundle('load-screen'); * * // Later on in your app... * await Assets.loadBundle('load-screen'); // Will resolve quicker as loading may have completed! * @param bundleIds - the bundleId / bundleIds you want to background load */ ) }, { key: "backgroundLoadBundle", value: (function () { var _backgroundLoadBundle = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(bundleIds) { var _this3 = this; var resolveResults; return _regenerator().w(function (_context5) { while (1) switch (_context5.n) { case 0: if (this._initialized) { _context5.n = 1; break; } _context5.n = 1; return this.init(); case 1: if (typeof bundleIds === "string") { bundleIds = [bundleIds]; } resolveResults = this.resolver.resolveBundle(bundleIds); Object.values(resolveResults).forEach(function (resolveResult) { _this3._backgroundLoader.add(Object.values(resolveResult)); }); case 2: return _context5.a(2); } }, _callee5, this); })); function backgroundLoadBundle(_x6) { return _backgroundLoadBundle.apply(this, arguments); } return backgroundLoadBundle; }() /** * Only intended for development purposes. * This will wipe the resolver and caches. * You will need to reinitialize the Asset */ ) }, { key: "reset", value: function reset() { this.resolver.reset(); this.loader.reset(); this.cache.reset(); this._initialized = false; } }, { key: "get", value: function get(keys) { if (typeof keys === "string") { return Cache.Cache.get(keys); } var assets = {}; for (var i = 0; i < keys.length; i++) { assets[i] = Cache.Cache.get(keys[i]); } return assets; } /** * helper function to map resolved assets back to loaded assets * @param resolveResults - the resolve results from the resolver * @param onProgress - the progress callback */ }, { key: "_mapLoadToResolve", value: (function () { var _mapLoadToResolve2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(resolveResults, onProgress) { var resolveArray, loadedAssets, out; return _regenerator().w(function (_context6) { while (1) switch (_context6.n) { case 0: resolveArray = _toConsumableArray(new Set(Object.values(resolveResults))); this._backgroundLoader.active = false; _context6.n = 1; return this.loader.load(resolveArray, onProgress); case 1: loadedAssets = _context6.v; this._backgroundLoader.active = true; out = {}; resolveArray.forEach(function (resolveResult) { var asset = loadedAssets[resolveResult.src]; var keys = [resolveResult.src]; if (resolveResult.alias) { keys.push.apply(keys, _toConsumableArray(resolveResult.alias)); } keys.forEach(function (key) { out[key] = asset; }); Cache.Cache.set(keys, asset); }); return _context6.a(2, out); } }, _callee6, this); })); function _mapLoadToResolve(_x7, _x8) { return _mapLoadToResolve2.apply(this, arguments); } return _mapLoadToResolve; }() /** * Unload an asset or assets. As the Assets class is responsible for creating the assets via the `load` function * this will make sure to destroy any assets and release them from memory. * Once unloaded, you will need to load the asset again. * * Use this to help manage assets if you find that you have a large app and you want to free up memory. * * - it's up to you as the developer to make sure that textures are not actively being used when you unload them, * Pixi won't break but you will end up with missing assets. Not a good look for the user! * @example * import { Assets } from 'pixi.js'; * * // Load a URL: * const myImageTexture = await Assets.load('http://some.url.com/image.png'); // => returns a texture * * await Assets.unload('http://some.url.com/image.png') * * // myImageTexture will be destroyed now. * * // Unload multiple assets: * const textures = await Assets.unload(['thumper', 'chicko']); * @param urls - the urls to unload */ ) }, { key: "unload", value: (function () { var _unload = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(urls) { var urlArray, resolveResults; return _regenerator().w(function (_context7) { while (1) switch (_context7.n) { case 0: if (this._initialized) { _context7.n = 1; break; } _context7.n = 1; return this.init(); case 1: urlArray = convertToList.convertToList(urls).map(function (url) { return typeof url !== "string" ? url.src : url; }); resolveResults = this.resolver.resolve(urlArray); _context7.n = 2; return this._unloadFromResolved(resolveResults); case 2: return _context7.a(2); } }, _callee7, this); })); function unload(_x9) { return _unload.apply(this, arguments); } return unload; }() /** * Bundles are a way to manage multiple assets at once. * this will unload all files in a bundle. * * once a bundle has been unloaded, you need to load it again to have access to the assets. * @example * import { Assets } from 'pixi.js'; * * Assets.addBundle({ * 'thumper': 'http://some.url.com/thumper.png', * }) * * const assets = await Assets.loadBundle('thumper'); * * // Now to unload... * * await Assets.unloadBundle('thumper'); * * // All assets in the assets object will now have been destroyed and purged from the cache * @param bundleIds - the bundle id or ids to unload */ ) }, { key: "unloadBundle", value: (function () { var _unloadBundle = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(bundleIds) { var _this4 = this; var resolveResults, promises; return _regenerator().w(function (_context8) { while (1) switch (_context8.n) { case 0: if (this._initialized) { _context8.n = 1; break; } _context8.n = 1; return this.init(); case 1: bundleIds = convertToList.convertToList(bundleIds); resolveResults = this.resolver.resolveBundle(bundleIds); promises = Object.keys(resolveResults).map(function (bundleId) { return _this4._unloadFromResolved(resolveResults[bundleId]); }); _context8.n = 2; return Promise.all(promises); case 2: return _context8.a(2); } }, _callee8, this); })); function unloadBundle(_x0) { return _unloadBundle.apply(this, arguments); } return unloadBundle; }()) }, { key: "_unloadFromResolved", value: function () { var _unloadFromResolved2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(resolveResult) { var resolveArray; return _regenerator().w(function (_context9) { while (1) switch (_context9.n) { case 0: resolveArray = Object.values(resolveResult); resolveArray.forEach(function (resolveResult2) { Cache.Cache.remove(resolveResult2.src); }); _context9.n = 1; return this.loader.unload(resolveArray); case 1: return _context9.a(2); } }, _callee9, this); })); function _unloadFromResolved(_x1) { return _unloadFromResolved2.apply(this, arguments); } return _unloadFromResolved; }() /** * Detects the supported formats for the browser, and returns an array of supported formats, respecting * the users preferred formats order. * @param options - the options to use when detecting formats * @param options.preferredFormats - the preferred formats to use * @param options.skipDetections - if we should skip the detections altogether * @param options.detections - the detections to use * @returns - the detected formats */ }, { key: "_detectFormats", value: (function () { var _detectFormats2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(options) { var formats, _iterator, _step, detection, _t, _t2; return _regenerator().w(function (_context0) { while (1) switch (_context0.n) { case 0: formats = []; if (options.preferredFormats) { formats = Array.isArray(options.preferredFormats) ? options.preferredFormats : [options.preferredFormats]; } _iterator = _createForOfIteratorHelper(options.detections); _context0.p = 1; _iterator.s(); case 2: if ((_step = _iterator.n()).done) { _context0.n = 9; break; } detection = _step.value; _t = options.skipDetections; if (_t) { _context0.n = 4; break; } _context0.n = 3; return detection.test(); case 3: _t = _context0.v; case 4: if (!_t) { _context0.n = 6; break; } _context0.n = 5; return detection.add(formats); case 5: formats = _context0.v; _context0.n = 8; break; case 6: if (options.skipDetections) { _context0.n = 8; break; } _context0.n = 7; return detection.remove(formats); case 7: formats = _context0.v; case 8: _context0.n = 2; break; case 9: _context0.n = 11; break; case 10: _context0.p = 10; _t2 = _context0.v; _iterator.e(_t2); case 11: _context0.p = 11; _iterator.f(); return _context0.f(11); case 12: formats = formats.filter(function (format, index) { return formats.indexOf(format) === index; }); return _context0.a(2, formats); } }, _callee0, null, [[1, 10, 11, 12]]); })); function _detectFormats(_x10) { return _detectFormats2.apply(this, arguments); } return _detectFormats; }() /** All the detection parsers currently added to the Assets class. */) }, { key: "detections", get: function get() { return this._detections; } /** * General setter for preferences. This is a helper function to set preferences on all parsers. * @param preferences - the preferences to set */ }, { key: "setPreferences", value: function setPreferences(preferences) { this.loader.parsers.forEach(function (parser) { if (!parser.config) return; Object.keys(parser.config).filter(function (key) { return key in preferences; }).forEach(function (key) { parser.config[key] = preferences[key]; }); }); } }]); }(); var Assets = new AssetsClass(); Extensions.extensions.handleByList(Extensions.ExtensionType.LoadParser, Assets.loader.parsers).handleByList(Extensions.ExtensionType.ResolveParser, Assets.resolver.parsers).handleByList(Extensions.ExtensionType.CacheParser, Assets.cache.parsers).handleByList(Extensions.ExtensionType.DetectionParser, Assets.detections); Extensions.extensions.add(cacheTextureArray.cacheTextureArray, detectDefaults.detectDefaults, detectAvif.detectAvif, detectWebp.detectWebp, detectMp4.detectMp4, detectOgv.detectOgv, detectWebm.detectWebm, loadJson.loadJson, loadTxt.loadTxt, loadWebFont.loadWebFont, loadSVG.loadSvg, loadTextures.loadTextures, loadVideoTextures.loadVideoTextures, loadBitmapFont.loadBitmapFont, loadBitmapFont.bitmapFontCachePlugin, resolveTextureUrl.resolveTextureUrl, resolveJsonUrl.resolveJsonUrl); var assetKeyMap = { loader: Extensions.ExtensionType.LoadParser, resolver: Extensions.ExtensionType.ResolveParser, cache: Extensions.ExtensionType.CacheParser, detection: Extensions.ExtensionType.DetectionParser }; Extensions.extensions.handle(Extensions.ExtensionType.Asset, function (extension) { var ref = extension.ref; Object.entries(assetKeyMap).filter(function (_ref) { var _ref2 = _slicedToArray(_ref, 1), key = _ref2[0]; return !!ref[key]; }).forEach(function (_ref3) { var _ref$key$extension; var _ref4 = _slicedToArray(_ref3, 2), key = _ref4[0], type = _ref4[1]; return Extensions.extensions.add(Object.assign(ref[key], // Allow the function to optionally define it's own // ExtensionMetadata, the use cases here is priority for LoaderParsers { extension: (_ref$key$extension = ref[key].extension) !== null && _ref$key$extension !== void 0 ? _ref$key$extension : type })); }); }, function (extension) { var ref = extension.ref; Object.keys(assetKeyMap).filter(function (key) { return !!ref[key]; }).forEach(function (key) { return Extensions.extensions.remove(ref[key]); }); }); exports.Assets = Assets; exports.AssetsClass = AssetsClass; /***/ }), /***/ 80423: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var LightenBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function LightenBlend() { _classCallCheck(this, LightenBlend); return _callSuper(this, LightenBlend, [{ gl: { functions: "\n vec3 blendLighten(vec3 base, vec3 blend, float opacity)\n {\n return (max(base, blend) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendLighten(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn blendLighten(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n return (max(base, blend) * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendLighten(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(LightenBlend, _BlendModeFilter$Blen); return _createClass(LightenBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ LightenBlend.extension = { name: "lighten", type: Extensions.ExtensionType.BlendMode }; exports.LightenBlend = LightenBlend; /***/ }), /***/ 80442: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function compileShader(gl, type, src) { var shader = gl.createShader(type); gl.shaderSource(shader, src); gl.compileShader(shader); return shader; } exports.compileShader = compileShader; /***/ }), /***/ 80556: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var GraphicsContextSystem = __webpack_require__(40545); "use strict"; var RECURSION_LIMIT = 8; var FLT_EPSILON = 11920929e-14; var PATH_DISTANCE_EPSILON = 1; var curveAngleToleranceEpsilon = 0.01; var mAngleTolerance = 0; var mCuspLimit = 0; function buildAdaptiveBezier(points, sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, smoothness) { var scale = 1; var smoothing = Math.min(0.99, // a value of 1.0 actually inverts smoothing, so we cap it at 0.99 Math.max(0, smoothness !== null && smoothness !== void 0 ? smoothness : GraphicsContextSystem.GraphicsContextSystem.defaultOptions.bezierSmoothness)); var distanceTolerance = (PATH_DISTANCE_EPSILON - smoothing) / scale; distanceTolerance *= distanceTolerance; begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance); return points; } function begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance) { recursive(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance, 0); points.push(eX, eY); } function recursive(x1, y1, x2, y2, x3, y3, x4, y4, points, distanceTolerance, level) { if (level > RECURSION_LIMIT) { return; } var pi = Math.PI; var x12 = (x1 + x2) / 2; var y12 = (y1 + y2) / 2; var x23 = (x2 + x3) / 2; var y23 = (y2 + y3) / 2; var x34 = (x3 + x4) / 2; var y34 = (y3 + y4) / 2; var x123 = (x12 + x23) / 2; var y123 = (y12 + y23) / 2; var x234 = (x23 + x34) / 2; var y234 = (y23 + y34) / 2; var x1234 = (x123 + x234) / 2; var y1234 = (y123 + y234) / 2; if (level > 0) { var dx = x4 - x1; var dy = y4 - y1; var d2 = Math.abs((x2 - x4) * dy - (y2 - y4) * dx); var d3 = Math.abs((x3 - x4) * dy - (y3 - y4) * dx); var da1; var da2; if (d2 > FLT_EPSILON && d3 > FLT_EPSILON) { if ((d2 + d3) * (d2 + d3) <= distanceTolerance * (dx * dx + dy * dy)) { if (mAngleTolerance < curveAngleToleranceEpsilon) { points.push(x1234, y1234); return; } var a23 = Math.atan2(y3 - y2, x3 - x2); da1 = Math.abs(a23 - Math.atan2(y2 - y1, x2 - x1)); da2 = Math.abs(Math.atan2(y4 - y3, x4 - x3) - a23); if (da1 >= pi) da1 = 2 * pi - da1; if (da2 >= pi) da2 = 2 * pi - da2; if (da1 + da2 < mAngleTolerance) { points.push(x1234, y1234); return; } if (mCuspLimit !== 0) { if (da1 > mCuspLimit) { points.push(x2, y2); return; } if (da2 > mCuspLimit) { points.push(x3, y3); return; } } } } else if (d2 > FLT_EPSILON) { if (d2 * d2 <= distanceTolerance * (dx * dx + dy * dy)) { if (mAngleTolerance < curveAngleToleranceEpsilon) { points.push(x1234, y1234); return; } da1 = Math.abs(Math.atan2(y3 - y2, x3 - x2) - Math.atan2(y2 - y1, x2 - x1)); if (da1 >= pi) da1 = 2 * pi - da1; if (da1 < mAngleTolerance) { points.push(x2, y2); points.push(x3, y3); return; } if (mCuspLimit !== 0) { if (da1 > mCuspLimit) { points.push(x2, y2); return; } } } } else if (d3 > FLT_EPSILON) { if (d3 * d3 <= distanceTolerance * (dx * dx + dy * dy)) { if (mAngleTolerance < curveAngleToleranceEpsilon) { points.push(x1234, y1234); return; } da1 = Math.abs(Math.atan2(y4 - y3, x4 - x3) - Math.atan2(y3 - y2, x3 - x2)); if (da1 >= pi) da1 = 2 * pi - da1; if (da1 < mAngleTolerance) { points.push(x2, y2); points.push(x3, y3); return; } if (mCuspLimit !== 0) { if (da1 > mCuspLimit) { points.push(x3, y3); return; } } } } else { dx = x1234 - (x1 + x4) / 2; dy = y1234 - (y1 + y4) / 2; if (dx * dx + dy * dy <= distanceTolerance) { points.push(x1234, y1234); return; } } } recursive(x1, y1, x12, y12, x123, y123, x1234, y1234, points, distanceTolerance, level + 1); recursive(x1234, y1234, x234, y234, x34, y34, x4, y4, points, distanceTolerance, level + 1); } exports.buildAdaptiveBezier = buildAdaptiveBezier; /***/ }), /***/ 80657: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function getTextureDefaultMatrix(texture, out) { var _texture$frame = texture.frame, width = _texture$frame.width, height = _texture$frame.height; out.scale(1 / width, 1 / height); return out; } exports.getTextureDefaultMatrix = getTextureDefaultMatrix; /***/ }), /***/ 80690: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); var GLhls = __webpack_require__(44064); var GPUhls = __webpack_require__(505); "use strict"; var SaturationBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function SaturationBlend() { _classCallCheck(this, SaturationBlend); return _callSuper(this, SaturationBlend, [{ gl: { functions: "\n ".concat(GLhls.hslgl, "\n\n vec3 blendSaturation(vec3 base, vec3 blend, float opacity)\n {\n vec3 blendSaturation = setLuminosity(setSaturation(base, getSaturation(blend)), getLuminosity(base));\n return (blendSaturation * opacity + base * (1.0 - opacity));\n }\n "), main: "\n finalColor = vec4(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n ".concat(GPUhls.hslgpu, "\n\n fn blendSaturation(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blendSaturation = setLuminosity(setSaturation(base, getSaturation(blend)), getLuminosity(base));\n return (blendSaturation * opacity + base * (1.0 - opacity));\n }\n "), main: "\n out = vec4<f32>(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(SaturationBlend, _BlendModeFilter$Blen); return _createClass(SaturationBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ SaturationBlend.extension = { name: "saturation", type: Extensions.ExtensionType.BlendMode }; exports.SaturationBlend = SaturationBlend; /***/ }), /***/ 80721: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var xmldom = __webpack_require__(69633); "use strict"; var WebWorkerAdapter = { createCanvas: function createCanvas(width, height) { return new OffscreenCanvas(width !== null && width !== void 0 ? width : 0, height !== null && height !== void 0 ? height : 0); }, getCanvasRenderingContext2D: function getCanvasRenderingContext2D() { return OffscreenCanvasRenderingContext2D; }, getWebGLRenderingContext: function getWebGLRenderingContext() { return WebGLRenderingContext; }, getNavigator: function getNavigator() { return navigator; }, getBaseUrl: function getBaseUrl() { return globalThis.location.href; }, getFontFaceSet: function getFontFaceSet() { return globalThis.fonts; }, fetch: function (_fetch) { function fetch(_x, _x2) { return _fetch.apply(this, arguments); } fetch.toString = function () { return _fetch.toString(); }; return fetch; }(function (url, options) { return fetch(url, options); }), parseXML: function parseXML(xml) { var parser = new xmldom.DOMParser(); return parser.parseFromString(xml, "text/xml"); } }; exports.WebWorkerAdapter = WebWorkerAdapter; /***/ }), /***/ 80793: /***/ ((module) => { "use strict"; module.exports = function (e, f) { var a = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r = {}; for (var d in a) r[a[d]] = d; var l = {}; e.prototype.toName = function (f) { if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; var d, i, o = r[this.toHex()]; if (o) return o; if (null == f ? void 0 : f.closest) { var n = this.toRgb(), t = 1 / 0, b = "black"; if (!l.length) for (var c in a) l[c] = new e(a[c]).toRgb(); for (var g in a) { var u = (d = n, i = l[g], Math.pow(d.r - i.r, 2) + Math.pow(d.g - i.g, 2) + Math.pow(d.b - i.b, 2)); u < t && (t = u, b = g); } return b; } }; f.string.push([function (f) { var r = f.toLowerCase(), d = "transparent" === r ? "#0000" : a[r]; return d ? new e(d).toRgb() : null; }, "name"]); }; /***/ }), /***/ 80844: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Culler = __webpack_require__(10541); var CullerPlugin = __webpack_require__(93942); var cullingMixin = __webpack_require__(47827); "use strict"; exports.Culler = Culler.Culler; exports.CullerPlugin = CullerPlugin.CullerPlugin; exports.cullingMixin = cullingMixin.cullingMixin; /***/ }), /***/ 80851: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 80871: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var BindGroup = __webpack_require__(85156); var UniformGroup = __webpack_require__(34400); var getAdjustedBlendModeBlend = __webpack_require__(4794); var PoolGroup = __webpack_require__(47505); var colorToUniform = __webpack_require__(6455); var BatchableMesh = __webpack_require__(8781); "use strict"; var MeshPipe = /*#__PURE__*/function () { function MeshPipe(renderer, adaptor) { _classCallCheck(this, MeshPipe); this.localUniforms = new UniformGroup.UniformGroup({ uTransformMatrix: { value: new Matrix.Matrix(), type: "mat3x3<f32>" }, uColor: { value: new Float32Array([1, 1, 1, 1]), type: "vec4<f32>" }, uRound: { value: 0, type: "f32" } }); this.localUniformsBindGroup = new BindGroup.BindGroup({ 0: this.localUniforms }); this._meshDataHash = /* @__PURE__ */Object.create(null); this._gpuBatchableMeshHash = /* @__PURE__ */Object.create(null); this._destroyRenderableBound = this.destroyRenderable.bind(this); this.renderer = renderer; this._adaptor = adaptor; this._adaptor.init(); renderer.renderableGC.addManagedHash(this, "_gpuBatchableMeshHash"); renderer.renderableGC.addManagedHash(this, "_meshDataHash"); } return _createClass(MeshPipe, [{ key: "validateRenderable", value: function validateRenderable(mesh) { var meshData = this._getMeshData(mesh); var wasBatched = meshData.batched; var isBatched = mesh.batched; meshData.batched = isBatched; if (wasBatched !== isBatched) { return true; } else if (isBatched) { var geometry = mesh._geometry; if (geometry.indices.length !== meshData.indexSize || geometry.positions.length !== meshData.vertexSize) { meshData.indexSize = geometry.indices.length; meshData.vertexSize = geometry.positions.length; return true; } var batchableMesh = this._getBatchableMesh(mesh); if (batchableMesh.texture.uid !== mesh._texture.uid) { batchableMesh._textureMatrixUpdateId = -1; } return !batchableMesh._batcher.checkAndUpdateTexture(batchableMesh, mesh._texture); } return false; } }, { key: "addRenderable", value: function addRenderable(mesh, instructionSet) { var batcher = this.renderer.renderPipes.batch; var _this$_getMeshData = this._getMeshData(mesh), batched = _this$_getMeshData.batched; if (batched) { var gpuBatchableMesh = this._getBatchableMesh(mesh); gpuBatchableMesh.setTexture(mesh._texture); gpuBatchableMesh.geometry = mesh._geometry; batcher.addToBatch(gpuBatchableMesh, instructionSet); } else { batcher["break"](instructionSet); instructionSet.add(mesh); } } }, { key: "updateRenderable", value: function updateRenderable(mesh) { if (mesh.batched) { var gpuBatchableMesh = this._gpuBatchableMeshHash[mesh.uid]; gpuBatchableMesh.setTexture(mesh._texture); gpuBatchableMesh.geometry = mesh._geometry; gpuBatchableMesh._batcher.updateElement(gpuBatchableMesh); } } }, { key: "destroyRenderable", value: function destroyRenderable(mesh) { this._meshDataHash[mesh.uid] = null; var gpuMesh = this._gpuBatchableMeshHash[mesh.uid]; if (gpuMesh) { PoolGroup.BigPool["return"](gpuMesh); this._gpuBatchableMeshHash[mesh.uid] = null; } mesh.off("destroyed", this._destroyRenderableBound); } }, { key: "execute", value: function execute(mesh) { if (!mesh.isRenderable) return; mesh.state.blendMode = getAdjustedBlendModeBlend.getAdjustedBlendModeBlend(mesh.groupBlendMode, mesh.texture._source); var localUniforms = this.localUniforms; localUniforms.uniforms.uTransformMatrix = mesh.groupTransform; localUniforms.uniforms.uRound = this.renderer._roundPixels | mesh._roundPixels; localUniforms.update(); colorToUniform.color32BitToUniform(mesh.groupColorAlpha, localUniforms.uniforms.uColor, 0); this._adaptor.execute(this, mesh); } }, { key: "_getMeshData", value: function _getMeshData(mesh) { return this._meshDataHash[mesh.uid] || this._initMeshData(mesh); } }, { key: "_initMeshData", value: function _initMeshData(mesh) { var _mesh$_geometry$indic, _mesh$_geometry$posit; this._meshDataHash[mesh.uid] = { batched: mesh.batched, indexSize: (_mesh$_geometry$indic = mesh._geometry.indices) === null || _mesh$_geometry$indic === void 0 ? void 0 : _mesh$_geometry$indic.length, vertexSize: (_mesh$_geometry$posit = mesh._geometry.positions) === null || _mesh$_geometry$posit === void 0 ? void 0 : _mesh$_geometry$posit.length }; mesh.on("destroyed", this._destroyRenderableBound); return this._meshDataHash[mesh.uid]; } }, { key: "_getBatchableMesh", value: function _getBatchableMesh(mesh) { return this._gpuBatchableMeshHash[mesh.uid] || this._initBatchableMesh(mesh); } }, { key: "_initBatchableMesh", value: function _initBatchableMesh(mesh) { var gpuMesh = PoolGroup.BigPool.get(BatchableMesh.BatchableMesh); gpuMesh.renderable = mesh; gpuMesh.setTexture(mesh._texture); gpuMesh.transform = mesh.groupTransform; gpuMesh.roundPixels = this.renderer._roundPixels | mesh._roundPixels; this._gpuBatchableMeshHash[mesh.uid] = gpuMesh; return gpuMesh; } }, { key: "destroy", value: function destroy() { for (var i in this._gpuBatchableMeshHash) { if (this._gpuBatchableMeshHash[i]) { PoolGroup.BigPool["return"](this._gpuBatchableMeshHash[i]); } } this._gpuBatchableMeshHash = null; this._meshDataHash = null; this.localUniforms = null; this.localUniformsBindGroup = null; this._adaptor.destroy(); this._adaptor = null; this.renderer = null; } }]); }(); /** @ignore */ MeshPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "mesh" }; exports.MeshPipe = MeshPipe; /***/ }), /***/ 81004: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Matrix = __webpack_require__(20764); var Rectangle = __webpack_require__(74731); "use strict"; var tempTextureMatrix = new Matrix.Matrix(); var tempRect = new Rectangle.Rectangle(); function generateTextureMatrix(out, style, shape, matrix) { var textureMatrix = style.matrix ? out.copyFrom(style.matrix).invert() : out.identity(); if (style.textureSpace === "local") { var bounds = shape.getBounds(tempRect); textureMatrix.translate(-bounds.x, -bounds.y); textureMatrix.scale(1 / bounds.width, 1 / bounds.height); } else { textureMatrix.translate(style.texture.frame.x, style.texture.frame.y); textureMatrix.scale(1 / style.texture.source.width, 1 / style.texture.source.height); var sourceStyle = style.texture.source.style; if (sourceStyle.addressMode === "clamp-to-edge") { sourceStyle.addressMode = "repeat"; sourceStyle.update(); } } if (matrix) { textureMatrix.append(tempTextureMatrix.copyFrom(matrix).invert()); } return textureMatrix; } exports.generateTextureMatrix = generateTextureMatrix; /***/ }), /***/ 81033: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; var conventions = __webpack_require__(86621); var dom = __webpack_require__(5433); var entities = __webpack_require__(63174); var sax = __webpack_require__(82677); var DOMImplementation = dom.DOMImplementation; var NAMESPACE = conventions.NAMESPACE; var ParseError = sax.ParseError; var XMLReader = sax.XMLReader; /** * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends: * * > XML parsed entities are often stored in computer files which, * > for editing convenience, are organized into lines. * > These lines are typically separated by some combination * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA). * > * > To simplify the tasks of applications, the XML processor must behave * > as if it normalized all line breaks in external parsed entities (including the document entity) * > on input, before parsing, by translating all of the following to a single #xA character: * > * > 1. the two-character sequence #xD #xA * > 2. the two-character sequence #xD #x85 * > 3. the single character #x85 * > 4. the single character #x2028 * > 5. any #xD character that is not immediately followed by #xA or #x85. * * @param {string} input * @returns {string} */ function normalizeLineEndings(input) { return input.replace(/\r[\n\u0085]/g, '\n').replace(/[\r\u0085\u2028]/g, '\n'); } /** * @typedef Locator * @property {number} [columnNumber] * @property {number} [lineNumber] */ /** * @typedef DOMParserOptions * @property {DOMHandler} [domBuilder] * @property {Function} [errorHandler] * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing * defaults to `normalizeLineEndings` * @property {Locator} [locator] * @property {Record<string, string>} [xmlns] * * @see normalizeLineEndings */ /** * The DOMParser interface provides the ability to parse XML or HTML source code * from a string into a DOM `Document`. * * _xmldom is different from the spec in that it allows an `options` parameter, * to override the default behavior._ * * @param {DOMParserOptions} [options] * @constructor * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization */ function DOMParser(options) { this.options = options || { locator: {} }; } DOMParser.prototype.parseFromString = function (source, mimeType) { var options = this.options; var sax = new XMLReader(); var domBuilder = options.domBuilder || new DOMHandler(); //contentHandler and LexicalHandler var errorHandler = options.errorHandler; var locator = options.locator; var defaultNSMap = options.xmlns || {}; var isHTML = /\/x?html?$/.test(mimeType); //mimeType.toLowerCase().indexOf('html') > -1; var entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES; if (locator) { domBuilder.setDocumentLocator(locator); } sax.errorHandler = buildErrorHandler(errorHandler, domBuilder, locator); sax.domBuilder = options.domBuilder || domBuilder; if (isHTML) { defaultNSMap[''] = NAMESPACE.HTML; } defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML; var normalize = options.normalizeLineEndings || normalizeLineEndings; if (source && typeof source === 'string') { sax.parse(normalize(source), defaultNSMap, entityMap); } else { sax.errorHandler.error('invalid doc source'); } return domBuilder.doc; }; function buildErrorHandler(errorImpl, domBuilder, locator) { if (!errorImpl) { if (domBuilder instanceof DOMHandler) { return domBuilder; } errorImpl = domBuilder; } var errorHandler = {}; var isCallback = errorImpl instanceof Function; locator = locator || {}; function build(key) { var fn = errorImpl[key]; if (!fn && isCallback) { fn = errorImpl.length == 2 ? function (msg) { errorImpl(key, msg); } : errorImpl; } errorHandler[key] = fn && function (msg) { fn('[xmldom ' + key + ']\t' + msg + _locator(locator)); } || function () {}; } build('warning'); build('error'); build('fatalError'); return errorHandler; } //console.log('#\n\n\n\n\n\n\n####') /** * +ContentHandler+ErrorHandler * +LexicalHandler+EntityResolver2 * -DeclHandler-DTDHandler * * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2 * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html */ function DOMHandler() { this.cdata = false; } function position(locator, node) { node.lineNumber = locator.lineNumber; node.columnNumber = locator.columnNumber; } /** * @see org.xml.sax.ContentHandler#startDocument * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html */ DOMHandler.prototype = { startDocument: function startDocument() { this.doc = new DOMImplementation().createDocument(null, null, null); if (this.locator) { this.doc.documentURI = this.locator.systemId; } }, startElement: function startElement(namespaceURI, localName, qName, attrs) { var doc = this.doc; var el = doc.createElementNS(namespaceURI, qName || localName); var len = attrs.length; appendElement(this, el); this.currentElement = el; this.locator && position(this.locator, el); for (var i = 0; i < len; i++) { var namespaceURI = attrs.getURI(i); var value = attrs.getValue(i); var qName = attrs.getQName(i); var attr = doc.createAttributeNS(namespaceURI, qName); this.locator && position(attrs.getLocator(i), attr); attr.value = attr.nodeValue = value; el.setAttributeNode(attr); } }, endElement: function endElement(namespaceURI, localName, qName) { var current = this.currentElement; var tagName = current.tagName; this.currentElement = current.parentNode; }, startPrefixMapping: function startPrefixMapping(prefix, uri) {}, endPrefixMapping: function endPrefixMapping(prefix) {}, processingInstruction: function processingInstruction(target, data) { var ins = this.doc.createProcessingInstruction(target, data); this.locator && position(this.locator, ins); appendElement(this, ins); }, ignorableWhitespace: function ignorableWhitespace(ch, start, length) {}, characters: function characters(chars, start, length) { chars = _toString.apply(this, arguments); //console.log(chars) if (chars) { if (this.cdata) { var charNode = this.doc.createCDATASection(chars); } else { var charNode = this.doc.createTextNode(chars); } if (this.currentElement) { this.currentElement.appendChild(charNode); } else if (/^\s*$/.test(chars)) { this.doc.appendChild(charNode); //process xml } this.locator && position(this.locator, charNode); } }, skippedEntity: function skippedEntity(name) {}, endDocument: function endDocument() { this.doc.normalize(); }, setDocumentLocator: function setDocumentLocator(locator) { if (this.locator = locator) { // && !('lineNumber' in locator)){ locator.lineNumber = 0; } }, //LexicalHandler comment: function comment(chars, start, length) { chars = _toString.apply(this, arguments); var comm = this.doc.createComment(chars); this.locator && position(this.locator, comm); appendElement(this, comm); }, startCDATA: function startCDATA() { //used in characters() methods this.cdata = true; }, endCDATA: function endCDATA() { this.cdata = false; }, startDTD: function startDTD(name, publicId, systemId) { var impl = this.doc.implementation; if (impl && impl.createDocumentType) { var dt = impl.createDocumentType(name, publicId, systemId); this.locator && position(this.locator, dt); appendElement(this, dt); this.doc.doctype = dt; } }, /** * @see org.xml.sax.ErrorHandler * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html */ warning: function warning(error) { console.warn('[xmldom warning]\t' + error, _locator(this.locator)); }, error: function error(_error) { console.error('[xmldom error]\t' + _error, _locator(this.locator)); }, fatalError: function fatalError(error) { throw new ParseError(error, this.locator); } }; function _locator(l) { if (l) { return '\n@' + (l.systemId || '') + '#[line:' + l.lineNumber + ',col:' + l.columnNumber + ']'; } } function _toString(chars, start, length) { if (typeof chars == 'string') { return chars.substr(start, length); } else { //java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)") if (chars.length >= start + length || start) { return new java.lang.String(chars, start, length) + ''; } return chars; } } /* * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html * used method of org.xml.sax.ext.LexicalHandler: * #comment(chars, start, length) * #startCDATA() * #endCDATA() * #startDTD(name, publicId, systemId) * * * IGNORED method of org.xml.sax.ext.LexicalHandler: * #endDTD() * #startEntity(name) * #endEntity(name) * * * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html * IGNORED method of org.xml.sax.ext.DeclHandler * #attributeDecl(eName, aName, type, mode, value) * #elementDecl(name, model) * #externalEntityDecl(name, publicId, systemId) * #internalEntityDecl(name, value) * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html * IGNORED method of org.xml.sax.EntityResolver2 * #resolveEntity(String name,String publicId,String baseURI,String systemId) * #resolveEntity(publicId, systemId) * #getExternalSubset(name, baseURI) * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html * IGNORED method of org.xml.sax.DTDHandler * #notationDecl(name, publicId, systemId) {}; * #unparsedEntityDecl(name, publicId, systemId, notationName) {}; */ "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function (key) { DOMHandler.prototype[key] = function () { return null; }; }); /* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */ function appendElement(hander, node) { if (!hander.currentElement) { hander.doc.appendChild(node); } else { hander.currentElement.appendChild(node); } } //appendChild and setAttributeNS are preformance key __webpack_unused_export__ = DOMHandler; __webpack_unused_export__ = normalizeLineEndings; exports.DOMParser = DOMParser; /***/ }), /***/ 81268: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Matrix = __webpack_require__(20764); var warn = __webpack_require__(57371); var matrixAndBoundsPool = __webpack_require__(22727); "use strict"; function getLocalBounds(target, bounds, relativeMatrix) { bounds.clear(); relativeMatrix || (relativeMatrix = Matrix.Matrix.IDENTITY); _getLocalBounds(target, bounds, relativeMatrix, target, true); if (!bounds.isValid) { bounds.set(0, 0, 0, 0); } return bounds; } function _getLocalBounds(target, bounds, parentTransform, rootContainer, isRoot) { var relativeTransform; if (!isRoot) { if (!target.visible || !target.measurable) return; target.updateLocalTransform(); var localTransform = target.localTransform; relativeTransform = matrixAndBoundsPool.matrixPool.get(); relativeTransform.appendFrom(localTransform, parentTransform); } else { relativeTransform = matrixAndBoundsPool.matrixPool.get(); relativeTransform = parentTransform.copyTo(relativeTransform); } var parentBounds = bounds; var preserveBounds = !!target.effects.length; if (preserveBounds) { bounds = matrixAndBoundsPool.boundsPool.get().clear(); } if (target.boundsArea) { bounds.addRect(target.boundsArea, relativeTransform); } else { if (target.renderPipeId) { bounds.matrix = relativeTransform; bounds.addBounds(target.bounds); } var children = target.children; for (var i = 0; i < children.length; i++) { _getLocalBounds(children[i], bounds, relativeTransform, rootContainer, false); } } if (preserveBounds) { for (var _i = 0; _i < target.effects.length; _i++) { var _target$effects$_i$ad, _target$effects$_i; (_target$effects$_i$ad = (_target$effects$_i = target.effects[_i]).addLocalBounds) === null || _target$effects$_i$ad === void 0 || _target$effects$_i$ad.call(_target$effects$_i, bounds, rootContainer); } parentBounds.addBounds(bounds, Matrix.Matrix.IDENTITY); matrixAndBoundsPool.boundsPool["return"](bounds); } matrixAndBoundsPool.matrixPool["return"](relativeTransform); } function getParent(target, root, matrix) { var parent = target.parent; if (!parent) { warn.warn("Item is not inside the root container"); return; } if (parent !== root) { getParent(parent, root, matrix); parent.updateLocalTransform(); matrix.append(parent.localTransform); } } exports.getLocalBounds = getLocalBounds; exports.getParent = getParent; /***/ }), /***/ 81430: /***/ ((__unused_webpack_module, exports) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } Object.defineProperty(exports, "__esModule", ({ value: true })); var WORKER_CODE = "(function () {\n 'use strict';\n\n const WHITE_PNG = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=\";\n async function checkImageBitmap() {\n try {\n if (typeof createImageBitmap !== \"function\")\n return false;\n const response = await fetch(WHITE_PNG);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n } catch (_e) {\n return false;\n }\n }\n void checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n\n})();\n"; var WORKER_URL = null; var WorkerInstance = /*#__PURE__*/_createClass(function WorkerInstance() { _classCallCheck(this, WorkerInstance); if (!WORKER_URL) { WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' })); } this.worker = new Worker(WORKER_URL); }); WorkerInstance.revokeObjectURL = function revokeObjectURL() { if (WORKER_URL) { URL.revokeObjectURL(WORKER_URL); WORKER_URL = null; } }; exports["default"] = WorkerInstance; /***/ }), /***/ 82084: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var GpuShaderSystem = /*#__PURE__*/function () { function GpuShaderSystem() { _classCallCheck(this, GpuShaderSystem); this._gpuProgramData = /* @__PURE__ */Object.create(null); } return _createClass(GpuShaderSystem, [{ key: "contextChange", value: function contextChange(gpu) { this._gpu = gpu; this.maxTextures = gpu.device.limits.maxSampledTexturesPerShaderStage; } }, { key: "getProgramData", value: function getProgramData(program) { return this._gpuProgramData[program._layoutKey] || this._createGPUProgramData(program); } }, { key: "_createGPUProgramData", value: function _createGPUProgramData(program) { var device = this._gpu.device; var bindGroups = program.gpuLayout.map(function (group) { return device.createBindGroupLayout({ entries: group }); }); var pipelineLayoutDesc = { bindGroupLayouts: bindGroups }; this._gpuProgramData[program._layoutKey] = { bindGroups: bindGroups, pipeline: device.createPipelineLayout(pipelineLayoutDesc) }; return this._gpuProgramData[program._layoutKey]; } }, { key: "destroy", value: function destroy() { this._gpu = null; this._gpuProgramData = null; } }]); }(); /** @ignore */ GpuShaderSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "shader" }; exports.GpuShaderSystem = GpuShaderSystem; /***/ }), /***/ 82132: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var getLocalBounds = __webpack_require__(81268); var matrixAndBoundsPool = __webpack_require__(22727); var warn = __webpack_require__(57371); "use strict"; function addMaskLocalBounds(mask, bounds, localRoot) { var boundsToMask = matrixAndBoundsPool.boundsPool.get(); mask.measurable = true; var tempMatrix = matrixAndBoundsPool.matrixPool.get().identity(); var relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix); getLocalBounds.getLocalBounds(mask, boundsToMask, relativeMask); mask.measurable = false; bounds.addBoundsMask(boundsToMask); matrixAndBoundsPool.matrixPool["return"](tempMatrix); matrixAndBoundsPool.boundsPool["return"](boundsToMask); } function getMatrixRelativeToParent(target, root, matrix) { if (!target) { warn.warn("Mask bounds, renderable is not inside the root container"); return matrix; } if (target !== root) { getMatrixRelativeToParent(target.parent, root, matrix); target.updateLocalTransform(); matrix.append(target.localTransform); } return matrix; } exports.addMaskLocalBounds = addMaskLocalBounds; exports.getMatrixRelativeToParent = getMatrixRelativeToParent; /***/ }), /***/ 82278: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.stringHashCode = stringHashCode; function stringHashCode(st) { var hash = 0, i, chr; if (st.length === 0) return hash; for (i = 0; i < st.length; i++) { chr = st.charCodeAt(i); hash = (hash << 5) - hash + chr; hash |= 0; // Convert to 32bit integer } return hash; } function crc16($str) { var $CRC16_Lookup = [0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0]; var $crc16 = 0xFFFF; // the CRC var $len = $str.length; var $t; for (var $i = 0; $i < $len; $i++) { $t = $crc16 >> 8 ^ $str.charCodeAt($i); // High byte Xor Message Byte to get index $crc16 = $crc16 << 8 & 0xffff ^ $CRC16_Lookup[$t]; // Update the CRC from table } $crc16 = $crc16.toString(16).toUpperCase(); return $crc16; } /***/ }), /***/ 82295: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 82323: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["context", "roundPixels"]; function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var deprecation = __webpack_require__(11225); var ViewContainer = __webpack_require__(23804); var GraphicsContext = __webpack_require__(59244); "use strict"; var Graphics = /*#__PURE__*/function (_ViewContainer$ViewCo) { /** * @param options - Options for the Graphics. */ function Graphics(options) { var _this; _classCallCheck(this, Graphics); if (options instanceof GraphicsContext.GraphicsContext) { options = { context: options }; } var _ref = options || {}, context = _ref.context, roundPixels = _ref.roundPixels, rest = _objectWithoutProperties(_ref, _excluded); _this = _callSuper(this, Graphics, [_objectSpread({ label: "Graphics" }, rest)]); _this.renderPipeId = "graphics"; if (!context) { _this._context = _this._ownedContext = new GraphicsContext.GraphicsContext(); } else { _this._context = context; } _this._context.on("update", _this.onViewUpdate, _this); _this.allowChildren = false; _this.roundPixels = roundPixels !== null && roundPixels !== void 0 ? roundPixels : false; return _this; } _inherits(Graphics, _ViewContainer$ViewCo); return _createClass(Graphics, [{ key: "context", get: function get() { return this._context; } /** * The local bounds of the graphic. * @type {rendering.Bounds} */, set: function set(context) { if (context === this._context) return; this._context.off("update", this.onViewUpdate, this); this._context = context; this._context.on("update", this.onViewUpdate, this); this.onViewUpdate(); } }, { key: "bounds", get: function get() { return this._context.bounds; } /** * Graphics objects do not need to update their bounds as the context handles this. * @private */ }, { key: "updateBounds", value: function updateBounds() {} /** * Checks if the object contains the given point. * @param point - The point to check */ }, { key: "containsPoint", value: function containsPoint(point) { return this._context.containsPoint(point); } /** * Destroys this graphics renderable and optionally its context. * @param options - Options parameter. A boolean will act as if all options * * If the context was created by this graphics and `destroy(false)` or `destroy()` is called * then the context will still be destroyed. * * If you want to explicitly not destroy this context that this graphics created, * then you should pass destroy({ context: false }) * * If the context was passed in as an argument to the constructor then it will not be destroyed * @param {boolean} [options.texture=false] - Should destroy the texture of the graphics context * @param {boolean} [options.textureSource=false] - Should destroy the texture source of the graphics context * @param {boolean} [options.context=false] - Should destroy the context */ }, { key: "destroy", value: function destroy(options) { if (this._ownedContext && !options) { this._ownedContext.destroy(options); } else if (options === true || (options === null || options === void 0 ? void 0 : options.context) === true) { this._context.destroy(options); } this._ownedContext = null; this._context = null; _superPropGet(Graphics, "destroy", this, 3)([options]); } }, { key: "_callContextMethod", value: function _callContextMethod(method, args) { var _this$context; (_this$context = this.context)[method].apply(_this$context, _toConsumableArray(args)); return this; } // --------------------------------------- GraphicsContext methods --------------------------------------- /** * Sets the current fill style of the graphics context. The fill style can be a color, gradient, * pattern, or a more complex style defined by a FillStyle object. * @param {FillInput} args - The fill style to apply. This can be a simple color, a gradient or * pattern object, or a FillStyle or ConvertedFillStyle object. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "setFillStyle", value: function setFillStyle() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return this._callContextMethod("setFillStyle", args); } /** * Sets the current stroke style of the graphics context. Similar to fill styles, stroke styles can * encompass colors, gradients, patterns, or more detailed configurations via a StrokeStyle object. * @param {StrokeInput} args - The stroke style to apply. Can be defined as a color, a gradient or pattern, * or a StrokeStyle or ConvertedStrokeStyle object. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "setStrokeStyle", value: function setStrokeStyle() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return this._callContextMethod("setStrokeStyle", args); } }, { key: "fill", value: function fill() { for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } return this._callContextMethod("fill", args); } /** * Strokes the current path with the current stroke style. This method can take an optional * FillStyle parameter to define the stroke's appearance, including its color, width, and other properties. * @param {FillStyle} args - (Optional) The stroke style to apply. Can be defined as a simple color or a more * complex style object. If omitted, uses the current stroke style. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "stroke", value: function stroke() { for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } return this._callContextMethod("stroke", args); } }, { key: "texture", value: function texture() { for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } return this._callContextMethod("texture", args); } /** * Resets the current path. Any previous path and its commands are discarded and a new path is * started. This is typically called before beginning a new shape or series of drawing commands. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "beginPath", value: function beginPath() { return this._callContextMethod("beginPath", []); } /** * Applies a cutout to the last drawn shape. This is used to create holes or complex shapes by * subtracting a path from the previously drawn path. If a hole is not completely in a shape, it will * fail to cut correctly! */ }, { key: "cut", value: function cut() { return this._callContextMethod("cut", []); } }, { key: "arc", value: function arc() { for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6]; } return this._callContextMethod("arc", args); } }, { key: "arcTo", value: function arcTo() { for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { args[_key7] = arguments[_key7]; } return this._callContextMethod("arcTo", args); } }, { key: "arcToSvg", value: function arcToSvg() { for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { args[_key8] = arguments[_key8]; } return this._callContextMethod("arcToSvg", args); } }, { key: "bezierCurveTo", value: function bezierCurveTo() { for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { args[_key9] = arguments[_key9]; } return this._callContextMethod("bezierCurveTo", args); } /** * Closes the current path by drawing a straight line back to the start. * If the shape is already closed or there are no points in the path, this method does nothing. * @returns The instance of the current object for chaining. */ }, { key: "closePath", value: function closePath() { return this._callContextMethod("closePath", []); } }, { key: "ellipse", value: function ellipse() { for (var _len0 = arguments.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) { args[_key0] = arguments[_key0]; } return this._callContextMethod("ellipse", args); } }, { key: "circle", value: function circle() { for (var _len1 = arguments.length, args = new Array(_len1), _key1 = 0; _key1 < _len1; _key1++) { args[_key1] = arguments[_key1]; } return this._callContextMethod("circle", args); } }, { key: "path", value: function path() { for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { args[_key10] = arguments[_key10]; } return this._callContextMethod("path", args); } }, { key: "lineTo", value: function lineTo() { for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { args[_key11] = arguments[_key11]; } return this._callContextMethod("lineTo", args); } }, { key: "moveTo", value: function moveTo() { for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { args[_key12] = arguments[_key12]; } return this._callContextMethod("moveTo", args); } }, { key: "quadraticCurveTo", value: function quadraticCurveTo() { for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) { args[_key13] = arguments[_key13]; } return this._callContextMethod("quadraticCurveTo", args); } }, { key: "rect", value: function rect() { for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) { args[_key14] = arguments[_key14]; } return this._callContextMethod("rect", args); } }, { key: "roundRect", value: function roundRect() { for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) { args[_key15] = arguments[_key15]; } return this._callContextMethod("roundRect", args); } }, { key: "poly", value: function poly() { for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) { args[_key16] = arguments[_key16]; } return this._callContextMethod("poly", args); } }, { key: "regularPoly", value: function regularPoly() { for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) { args[_key17] = arguments[_key17]; } return this._callContextMethod("regularPoly", args); } }, { key: "roundPoly", value: function roundPoly() { for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) { args[_key18] = arguments[_key18]; } return this._callContextMethod("roundPoly", args); } }, { key: "roundShape", value: function roundShape() { for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) { args[_key19] = arguments[_key19]; } return this._callContextMethod("roundShape", args); } }, { key: "filletRect", value: function filletRect() { for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) { args[_key20] = arguments[_key20]; } return this._callContextMethod("filletRect", args); } }, { key: "chamferRect", value: function chamferRect() { for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) { args[_key21] = arguments[_key21]; } return this._callContextMethod("chamferRect", args); } }, { key: "star", value: function star() { for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) { args[_key22] = arguments[_key22]; } return this._callContextMethod("star", args); } }, { key: "svg", value: function svg() { for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) { args[_key23] = arguments[_key23]; } return this._callContextMethod("svg", args); } }, { key: "restore", value: function restore() { for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) { args[_key24] = arguments[_key24]; } return this._callContextMethod("restore", args); } /** Saves the current graphics state, including transformations, fill styles, and stroke styles, onto a stack. */ }, { key: "save", value: function save() { return this._callContextMethod("save", []); } /** * Returns the current transformation matrix of the graphics context. * @returns The current transformation matrix. */ }, { key: "getTransform", value: function getTransform() { return this.context.getTransform(); } /** * Resets the current transformation matrix to the identity matrix, effectively removing * any transformations (rotation, scaling, translation) previously applied. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "resetTransform", value: function resetTransform() { return this._callContextMethod("resetTransform", []); } }, { key: "rotateTransform", value: function rotateTransform() { for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) { args[_key25] = arguments[_key25]; } return this._callContextMethod("rotate", args); } }, { key: "scaleTransform", value: function scaleTransform() { for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) { args[_key26] = arguments[_key26]; } return this._callContextMethod("scale", args); } }, { key: "setTransform", value: function setTransform() { for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) { args[_key27] = arguments[_key27]; } return this._callContextMethod("setTransform", args); } }, { key: "transform", value: function transform() { for (var _len28 = arguments.length, args = new Array(_len28), _key28 = 0; _key28 < _len28; _key28++) { args[_key28] = arguments[_key28]; } return this._callContextMethod("transform", args); } }, { key: "translateTransform", value: function translateTransform() { for (var _len29 = arguments.length, args = new Array(_len29), _key29 = 0; _key29 < _len29; _key29++) { args[_key29] = arguments[_key29]; } return this._callContextMethod("translate", args); } /** * Clears all drawing commands from the graphics context, effectively resetting it. This includes clearing the path, * and optionally resetting transformations to the identity matrix. * @returns The instance of the current GraphicsContext for method chaining. */ }, { key: "clear", value: function clear() { return this._callContextMethod("clear", []); } /** * The fill style to use. * @type {ConvertedFillStyle} */ }, { key: "fillStyle", get: function get() { return this._context.fillStyle; }, set: function set(value) { this._context.fillStyle = value; } /** * The stroke style to use. * @type {ConvertedStrokeStyle} */ }, { key: "strokeStyle", get: function get() { return this._context.strokeStyle; }, set: function set(value) { this._context.strokeStyle = value; } /** * Creates a new Graphics object. * Note that only the context of the object is cloned, not its transform (position,scale,etc) * @param deep - Whether to create a deep clone of the graphics object. If false, the context * will be shared between the two objects (default false). If true, the context will be * cloned (recommended if you need to modify the context in any way). * @returns - A clone of the graphics object */ }, { key: "clone", value: function clone() { var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (deep) { return new Graphics(this._context.clone()); } this._ownedContext = null; var clone = new Graphics(this._context); return clone; } // -------- v7 deprecations --------- /** * @param width * @param color * @param alpha * @deprecated since 8.0.0 Use {@link Graphics#setStrokeStyle} instead */ }, { key: "lineStyle", value: function lineStyle(width, color, alpha) { deprecation.deprecation(deprecation.v8_0_0, "Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style."); var strokeStyle = {}; width && (strokeStyle.width = width); color && (strokeStyle.color = color); alpha && (strokeStyle.alpha = alpha); this.context.strokeStyle = strokeStyle; return this; } /** * @param color * @param alpha * @deprecated since 8.0.0 Use {@link Graphics#fill} instead */ }, { key: "beginFill", value: function beginFill(color, alpha) { deprecation.deprecation(deprecation.v8_0_0, "Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."); var fillStyle = {}; if (color !== void 0) fillStyle.color = color; if (alpha !== void 0) fillStyle.alpha = alpha; this.context.fillStyle = fillStyle; return this; } /** * @deprecated since 8.0.0 Use {@link Graphics#fill} instead */ }, { key: "endFill", value: function endFill() { deprecation.deprecation(deprecation.v8_0_0, "Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."); this.context.fill(); var strokeStyle = this.context.strokeStyle; if (strokeStyle.width !== GraphicsContext.GraphicsContext.defaultStrokeStyle.width || strokeStyle.color !== GraphicsContext.GraphicsContext.defaultStrokeStyle.color || strokeStyle.alpha !== GraphicsContext.GraphicsContext.defaultStrokeStyle.alpha) { this.context.stroke(); } return this; } /** * @param {...any} args * @deprecated since 8.0.0 Use {@link Graphics#circle} instead */ }, { key: "drawCircle", value: function drawCircle() { deprecation.deprecation(deprecation.v8_0_0, "Graphics#drawCircle has been renamed to Graphics#circle"); for (var _len30 = arguments.length, args = new Array(_len30), _key30 = 0; _key30 < _len30; _key30++) { args[_key30] = arguments[_key30]; } return this._callContextMethod("circle", args); } /** * @param {...any} args * @deprecated since 8.0.0 Use {@link Graphics#ellipse} instead */ }, { key: "drawEllipse", value: function drawEllipse() { deprecation.deprecation(deprecation.v8_0_0, "Graphics#drawEllipse has been renamed to Graphics#ellipse"); for (var _len31 = arguments.length, args = new Array(_len31), _key31 = 0; _key31 < _len31; _key31++) { args[_key31] = arguments[_key31]; } return this._callContextMethod("ellipse", args); } /** * @param {...any} args * @deprecated since 8.0.0 Use {@link Graphics#poly} instead */ }, { key: "drawPolygon", value: function drawPolygon() { deprecation.deprecation(deprecation.v8_0_0, "Graphics#drawPolygon has been renamed to Graphics#poly"); for (var _len32 = arguments.length, args = new Array(_len32), _key32 = 0; _key32 < _len32; _key32++) { args[_key32] = arguments[_key32]; } return this._callContextMethod("poly", args); } /** * @param {...any} args * @deprecated since 8.0.0 Use {@link Graphics#rect} instead */ }, { key: "drawRect", value: function drawRect() { deprecation.deprecation(deprecation.v8_0_0, "Graphics#drawRect has been renamed to Graphics#rect"); for (var _len33 = arguments.length, args = new Array(_len33), _key33 = 0; _key33 < _len33; _key33++) { args[_key33] = arguments[_key33]; } return this._callContextMethod("rect", args); } /** * @param {...any} args * @deprecated since 8.0.0 Use {@link Graphics#roundRect} instead */ }, { key: "drawRoundedRect", value: function drawRoundedRect() { deprecation.deprecation(deprecation.v8_0_0, "Graphics#drawRoundedRect has been renamed to Graphics#roundRect"); for (var _len34 = arguments.length, args = new Array(_len34), _key34 = 0; _key34 < _len34; _key34++) { args[_key34] = arguments[_key34]; } return this._callContextMethod("roundRect", args); } /** * @param {...any} args * @deprecated since 8.0.0 Use {@link Graphics#star} instead */ }, { key: "drawStar", value: function drawStar() { deprecation.deprecation(deprecation.v8_0_0, "Graphics#drawStar has been renamed to Graphics#star"); for (var _len35 = arguments.length, args = new Array(_len35), _key35 = 0; _key35 < _len35; _key35++) { args[_key35] = arguments[_key35]; } return this._callContextMethod("star", args); } }]); }(ViewContainer.ViewContainer); exports.Graphics = Graphics; /***/ }), /***/ 82352: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 82422: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var source = "\n\nstruct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct BlurUniforms {\n uStrength:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> blurUniforms : BlurUniforms;\n\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n %blur-struct%\n };\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n\n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n\n let filteredCord = filterTextureCoord(aPosition);\n\n let pixelStrength = gfu.uInputSize.%dimension% * blurUniforms.uStrength;\n\n return VSOutput(\n filterVertexPosition(aPosition),\n %blur-vertex-out%\n );\n}\n\n@fragment\nfn mainFragment(\n @builtin(position) position: vec4<f32>,\n %blur-fragment-in%\n) -> @location(0) vec4<f32> {\n\n var finalColor = vec4(0.0);\n\n %blur-sampling%\n\n return finalColor;\n}"; exports["default"] = source; /***/ }), /***/ 82423: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function loadSVGImage(image, url, delay) { return new Promise(/*#__PURE__*/function () { var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(resolve) { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: if (!delay) { _context.n = 1; break; } _context.n = 1; return new Promise(function (resolve2) { return setTimeout(resolve2, 100); }); case 1: image.onload = function () { resolve(); }; image.src = "data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(url)); image.crossOrigin = "anonymous"; case 2: return _context.a(2); } }, _callee); })); return function (_x) { return _ref.apply(this, arguments); }; }()); } exports.loadSVGImage = loadSVGImage; /***/ }), /***/ 82467: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Matrix = __webpack_require__(20764); "use strict"; var tempMat = new Matrix.Matrix(); var TextureMatrix = /*#__PURE__*/function () { /** * @param texture - observed texture * @param clampMargin - Changes frame clamping, 0.5 by default. Use -0.5 for extra border. */ function TextureMatrix(texture, clampMargin) { _classCallCheck(this, TextureMatrix); this.mapCoord = new Matrix.Matrix(); this.uClampFrame = new Float32Array(4); this.uClampOffset = new Float32Array(2); this._textureID = -1; this._updateID = 0; this.clampOffset = 0; if (typeof clampMargin === "undefined") { this.clampMargin = texture.width < 10 ? 0 : 0.5; } else { this.clampMargin = clampMargin; } this.isSimple = false; this.texture = texture; } /** Texture property. */ return _createClass(TextureMatrix, [{ key: "texture", get: function get() { return this._texture; }, set: function set(value) { var _this$_texture; if (this.texture === value) return; (_this$_texture = this._texture) === null || _this$_texture === void 0 || _this$_texture.removeListener("update", this.update, this); this._texture = value; this._texture.addListener("update", this.update, this); this.update(); } /** * Multiplies uvs array to transform * @param uvs - mesh uvs * @param [out=uvs] - output * @returns - output */ }, { key: "multiplyUvs", value: function multiplyUvs(uvs, out) { if (out === void 0) { out = uvs; } var mat = this.mapCoord; for (var i = 0; i < uvs.length; i += 2) { var x = uvs[i]; var y = uvs[i + 1]; out[i] = x * mat.a + y * mat.c + mat.tx; out[i + 1] = x * mat.b + y * mat.d + mat.ty; } return out; } /** * Updates matrices if texture was changed * @returns - whether or not it was updated */ }, { key: "update", value: function update() { var tex = this._texture; this._updateID++; var uvs = tex.uvs; this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0); var orig = tex.orig; var trim = tex.trim; if (trim) { tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height, -trim.x / trim.width, -trim.y / trim.height); this.mapCoord.append(tempMat); } var texBase = tex.source; var frame = this.uClampFrame; var margin = this.clampMargin / texBase._resolution; var offset = this.clampOffset / texBase._resolution; frame[0] = (tex.frame.x + margin + offset) / texBase.width; frame[1] = (tex.frame.y + margin + offset) / texBase.height; frame[2] = (tex.frame.x + tex.frame.width - margin + offset) / texBase.width; frame[3] = (tex.frame.y + tex.frame.height - margin + offset) / texBase.height; this.uClampOffset[0] = this.clampOffset / texBase.pixelWidth; this.uClampOffset[1] = this.clampOffset / texBase.pixelHeight; this.isSimple = tex.frame.width === texBase.width && tex.frame.height === texBase.height && tex.rotate === 0; return true; } }]); }(); exports.TextureMatrix = TextureMatrix; /***/ }), /***/ 82525: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Rectangle = __webpack_require__(74731); "use strict"; function checkRow(data, width, y) { for (var x = 0, index = 4 * y * width; x < width; ++x, index += 4) { if (data[index + 3] !== 0) return false; } return true; } function checkColumn(data, width, x, top, bottom) { var stride = 4 * width; for (var y = top, index = top * stride + 4 * x; y <= bottom; ++y, index += stride) { if (data[index + 3] !== 0) return false; } return true; } function getCanvasBoundingBox(canvas) { var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var width = canvas.width, height = canvas.height; var context = canvas.getContext("2d", { willReadFrequently: true }); if (context === null) { throw new TypeError("Failed to get canvas 2D context"); } var imageData = context.getImageData(0, 0, width, height); var data = imageData.data; var left = 0; var top = 0; var right = width - 1; var bottom = height - 1; while (top < height && checkRow(data, width, top)) ++top; if (top === height) return Rectangle.Rectangle.EMPTY; while (checkRow(data, width, bottom)) --bottom; while (checkColumn(data, width, left, top, bottom)) ++left; while (checkColumn(data, width, right, top, bottom)) --right; ++right; ++bottom; return new Rectangle.Rectangle(left / resolution, top / resolution, (right - left) / resolution, (bottom - top) / resolution); } exports.getCanvasBoundingBox = getCanvasBoundingBox; /***/ }), /***/ 82534: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 82554: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; exports.parsedNodeToAST = parsedNodeToAST; exports.parsedNodeToASTChain = parsedNodeToASTChain; var _Heap = _interopRequireDefault(__webpack_require__(78838)); var _stringUtils = __webpack_require__(82278); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } var TARGET = 0; var RULE = 1; var PASSED = 2; var LENGTH = 3; var TRACK = 4; /*** * @param {string} target * @param {Rule|null} rule * @param {number} passed * @param {number} length * @param {[]} track * * @returns {*[]} */ function mkItem(target, rule, passed, length, track) { return [target, rule, passed, length, track]; } function indexingItem(item) { return item[TARGET] + '*' + item[PASSED] + '*' + item[LENGTH]; } function arrayKey(item) { return item[TARGET] + '*' + item[PASSED]; } /**** * * @param {DPParser} parser * @param {string || []} source * @param {string} target * @constructor */ function DPParseInstance(parser, source, target) { this.target = target; this.parser = parser; this.targets = parser.targets; this.rules = parser.rules; this.tokenTypes = parser.tokenizer.types; this.error = null; this.source = source; var start = Date.now(); if (typeof source === "string") { this.tokens = parser.tokenizer.tokenize(source).filter(function (tk) { return tk.type !== 'skip'; }); } else if (source instanceof Array) { this.tokens = source; } else { throw new Error("Invalid source, source must be string or array of token"); } this.tokenIdx = 0; this.priQueue = new _Heap["default"](this._cmpFunction); this.maxSize = 0; this.expectedArr = []; this.parsedNode = null; this.ast = null; start = Date.now(); this._dp(); this._trackBack(); if (this.parsedNode) { this._calcAST(); } else { this._findError(); } } DPParseInstance.prototype._dp = function () { while (this.tokenIdx < this.tokens.length) { this._nextToken(); } }; DPParseInstance.prototype._cmpFunction = function (a, b) { return b[LENGTH] - a[LENGTH]; }; DPParseInstance.prototype._nextToken = function () { var idx = this.tokenIdx++; var token = this.tokens[idx]; this.priQueue.push(mkItem('.' + token.type, null, 1, 1, [null, token])); this.priQueue.push(mkItem('_' + token.content, null, 1, 1, [null, token])); var expected = {}; var pushed = {}; var itemIndex; var longestChecked = {}; this.expectedArr.push(expected); var cur, next; var i, j, rule; var prevExpectedList, prevRule; var prevExpectedItem; //nếu cùng 1 rule, cùng điểm bắt dầu, cùng passed thì dài hơn lấy while (this.priQueue.size() > 0) { this.maxSize = Math.max(this.maxSize, this.priQueue.size()); cur = this.priQueue.pop(); for (i = 0; i < this.rules.length; ++i) { rule = this.rules[i]; if (rule.elements[0] === cur[TARGET]) { if (rule.elements.length === 1) { next = mkItem(rule.target, rule, cur[PASSED], cur[LENGTH], [null, cur]); itemIndex = indexingItem(next); if (!pushed[itemIndex]) { pushed[itemIndex] = true; this.priQueue.push(next); } expected['^'] = expected['^'] || []; expected['^'].push(next); } else { next = mkItem(rule.target, rule, 1, cur[LENGTH], [null, cur]); expected[rule.elements[1]] = expected[rule.elements[1]] || []; expected[rule.elements[1]].push(next); } } } prevExpectedList = this.expectedArr[idx - cur[LENGTH]] && this.expectedArr[idx - cur[LENGTH]][cur[TARGET]]; if (prevExpectedList) { for (j = 0; j < prevExpectedList.length; ++j) { prevExpectedItem = prevExpectedList[j]; prevRule = prevExpectedItem[RULE]; next = mkItem(prevRule.target, prevRule, prevExpectedItem[PASSED] + 1, prevExpectedItem[LENGTH] + cur[LENGTH], [prevExpectedItem, cur]); if (prevExpectedItem[PASSED] + 1 === prevRule.elements.length) { itemIndex = indexingItem(next); if (next[RULE] && next[RULE].longestOnly) { if (longestChecked[next[RULE].ident] && longestChecked[next[RULE].ident] >= next[LENGTH]) { continue; } longestChecked[next[RULE].ident] = next[LENGTH]; } if (!pushed[itemIndex]) { pushed[itemIndex] = true; this.priQueue.push(next); } expected['^'] = expected['^'] || []; expected['^'].push(next); //[rule index, passed, length] } else { expected[prevRule.elements[prevExpectedItem[PASSED] + 1]] = expected[prevRule.elements[prevExpectedItem[PASSED] + 1]] || []; expected[prevRule.elements[prevExpectedItem[PASSED] + 1]].push(next); } } } } }; DPParseInstance.prototype._trackBack = function () { var expectedAr = this.expectedArr; function visit(target, start, length) { var node = { type: target, start: start, end: start + length }; var matchedItem = null; var expected = expectedAr[start + length - 1]; if (!expected) return null; var itemList = expected['^']; if (!itemList) return null; var item; if (itemList) { for (var j = 0; j < itemList.length; ++j) { item = itemList[j]; if (item[TARGET] === target) { if (item[LENGTH] === length) { matchedItem = item; } } } } if (!matchedItem) { return null; } node.rule = matchedItem[RULE]; var childItem = []; var cTrack = matchedItem[TRACK]; var right, left; while (cTrack) { left = cTrack[0]; right = cTrack[1]; childItem.unshift(right); cTrack = left && left[TRACK]; } var ac = childItem.reduce(function (ac, item) { if (typeof item[TRACK][1].type === "string") { ac.child.push(item[TRACK][1]); ac.start += 1; } else { ac.child.push(visit(item[TARGET], ac.start, item[LENGTH])); ac.start += item[LENGTH]; } return ac; }, { start: start, child: [] }); node.children = ac.child; node.end = ac.start; return node; } this.parsedNode = visit(this.target, 0, this.expectedArr.length); }; DPParseInstance.prototype._findError = function () { function cmp(a, b) { return b.i - a.i; } var queue = new _Heap["default"](cmp); var doneArr = Array(this.expectedArr.length).fill(null).map(function () { return {}; }); this.expectedArr.forEach(function (ex, i) { for (var k in ex) { ex[k].forEach(function (it) { var target = it[TARGET]; var done = doneArr[i - it[LENGTH] + 1]; done[target] = done[target] || []; done[target].push(it); }); } }); var d = {}; queue.push({ t: this.target, i: 0 }); d[this.target + '/' + 0] = true; var cr, next; var nextIdent; var item; var hasNewExpected; while (queue.size() > 0) { cr = queue.pop(); if (cr.i >= doneArr.length) { if (!this.error || this.error.tokenIdx < cr.i || this.error.type !== "expected") { this.error = { tokenIdx: cr.i, type: 'expected', expectedToken: [] }; } if (cr.t[0] === '_' || cr.t[0] === '.') { this.error.expectedToken.push(cr.t); } continue; } hasNewExpected = false; if (doneArr[cr.i][cr.t]) { doneArr[cr.i][cr.t].forEach(function (item) { if (item[PASSED] < item[RULE].elements.length) { next = { i: cr.i + item[LENGTH], t: item[RULE].elements[item[PASSED]] }; nextIdent = next.t + '/' + next.i; hasNewExpected = true; if (!d[nextIdent]) { d[nextIdent] = true; queue.push(next); } } }); } this.rules.forEach(function (rule) { if (rule.target === cr.t) { next = { i: cr.i, t: rule.elements[0] }; nextIdent = next.t + '/' + next.i; if (!d[nextIdent]) { d[nextIdent] = true; queue.push(next); } } }); if (!hasNewExpected) { if (!this.error || this.error.tokenIdx < cr.i) { this.error = { tokenIdx: cr.i, type: 'unexpected' }; } } } if (this.error.type === 'expected') { this.error.message = 'Expected: ' + this.error.expectedToken.map(function (t) { if (t[0] === '.') return t.substring(1); if (t[0] === '_') return JSON.stringify(t.substring(1)); }).join(', '); } else if (this.error.type === 'unexpected') { this.error.message = 'Unexpected token ' + (this.tokens[this.error.tokenIdx].content || JSON.stringify(this.tokens[this.error.tokenIdx])); } }; DPParseInstance.prototype._calcAST = function () { this.ast = this.parsedNode.rule.toAST(this.parsedNode); }; function parsedNodeToAST(parsedNode) { return parsedNode.rule.toAST(parsedNode); } function parsedNodeToASTChain(parsedNode) { return parsedNode.rule.toASTChain(parsedNode); } var _default = exports["default"] = DPParseInstance; /***/ }), /***/ 82677: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var NAMESPACE = (__webpack_require__(86621).NAMESPACE); //[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] //[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] //[5] Name ::= NameStartChar (NameChar)* var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; //\u10000-\uEFFFF var nameChar = new RegExp("[\\-\\.0-9" + nameStartChar.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"); var tagNamePattern = new RegExp('^' + nameStartChar.source + nameChar.source + '*(?:\:' + nameStartChar.source + nameChar.source + '*)?$'); //var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/ //var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',') //S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE //S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE var S_TAG = 0; //tag name offerring var S_ATTR = 1; //attr name offerring var S_ATTR_SPACE = 2; //attr name end and space offer var S_EQ = 3; //=space? var S_ATTR_NOQUOT_VALUE = 4; //attr value(no quot value only) var S_ATTR_END = 5; //attr value end and no space(quot end) var S_TAG_SPACE = 6; //(attr value end || tag end ) && (space offer) var S_TAG_CLOSE = 7; //closed el<el /> /** * Creates an error that will not be caught by XMLReader aka the SAX parser. * * @param {string} message * @param {any?} locator Optional, can provide details about the location in the source * @constructor */ function ParseError(message, locator) { this.message = message; this.locator = locator; if (Error.captureStackTrace) Error.captureStackTrace(this, ParseError); } ParseError.prototype = new Error(); ParseError.prototype.name = ParseError.name; function XMLReader() {} XMLReader.prototype = { parse: function parse(source, defaultNSMap, entityMap) { var domBuilder = this.domBuilder; domBuilder.startDocument(); _copy(defaultNSMap, defaultNSMap = {}); _parse(source, defaultNSMap, entityMap, domBuilder, this.errorHandler); domBuilder.endDocument(); } }; function _parse(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) { function fixedFromCharCode(code) { // String.prototype.fromCharCode does not supports // > 2 bytes unicode chars directly if (code > 0xffff) { code -= 0x10000; var surrogate1 = 0xd800 + (code >> 10), surrogate2 = 0xdc00 + (code & 0x3ff); return String.fromCharCode(surrogate1, surrogate2); } else { return String.fromCharCode(code); } } function entityReplacer(a) { var k = a.slice(1, -1); if (Object.hasOwnProperty.call(entityMap, k)) { return entityMap[k]; } else if (k.charAt(0) === '#') { return fixedFromCharCode(parseInt(k.substr(1).replace('x', '0x'))); } else { errorHandler.error('entity not found:' + a); return a; } } function appendText(end) { //has some bugs if (end > start) { var xt = source.substring(start, end).replace(/&#?\w+;/g, entityReplacer); locator && position(start); domBuilder.characters(xt, 0, end - start); start = end; } } function position(p, m) { while (p >= lineEnd && (m = linePattern.exec(source))) { lineStart = m.index; lineEnd = lineStart + m[0].length; locator.lineNumber++; //console.log('line++:',locator,startPos,endPos) } locator.columnNumber = p - lineStart + 1; } var lineStart = 0; var lineEnd = 0; var linePattern = /.*(?:\r\n?|\n)|.*$/g; var locator = domBuilder.locator; var parseStack = [{ currentNSMap: defaultNSMapCopy }]; var closeMap = {}; var start = 0; while (true) { try { var tagStart = source.indexOf('<', start); if (tagStart < 0) { if (!source.substr(start).match(/^\s*$/)) { var doc = domBuilder.doc; var text = doc.createTextNode(source.substr(start)); doc.appendChild(text); domBuilder.currentElement = text; } return; } if (tagStart > start) { appendText(tagStart); } switch (source.charAt(tagStart + 1)) { case '/': var end = source.indexOf('>', tagStart + 3); var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, ''); var config = parseStack.pop(); if (end < 0) { tagName = source.substring(tagStart + 2).replace(/[\s<].*/, ''); errorHandler.error("end tag name: " + tagName + ' is not complete:' + config.tagName); end = tagStart + 1 + tagName.length; } else if (tagName.match(/\s</)) { tagName = tagName.replace(/[\s<].*/, ''); errorHandler.error("end tag name: " + tagName + ' maybe not complete'); end = tagStart + 1 + tagName.length; } var localNSMap = config.localNSMap; var endMatch = config.tagName == tagName; var endIgnoreCaseMach = endMatch || config.tagName && config.tagName.toLowerCase() == tagName.toLowerCase(); if (endIgnoreCaseMach) { domBuilder.endElement(config.uri, config.localName, tagName); if (localNSMap) { for (var prefix in localNSMap) { if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) { domBuilder.endPrefixMapping(prefix); } } } if (!endMatch) { errorHandler.fatalError("end tag name: " + tagName + ' is not match the current start tagName:' + config.tagName); // No known test case } } else { parseStack.push(config); } end++; break; // end elment case '?': // <?...?> locator && position(tagStart); end = parseInstruction(source, tagStart, domBuilder); break; case '!': // <!doctype,<![CDATA,<!-- locator && position(tagStart); end = parseDCC(source, tagStart, domBuilder, errorHandler); break; default: locator && position(tagStart); var el = new ElementAttributes(); var currentNSMap = parseStack[parseStack.length - 1].currentNSMap; //elStartEnd var end = parseElementStartPart(source, tagStart, el, currentNSMap, entityReplacer, errorHandler); var len = el.length; if (!el.closed && fixSelfClosed(source, end, el.tagName, closeMap)) { el.closed = true; if (!entityMap.nbsp) { errorHandler.warning('unclosed xml attribute'); } } if (locator && len) { var locator2 = copyLocator(locator, {}); //try{//attribute position fixed for (var i = 0; i < len; i++) { var a = el[i]; position(a.offset); a.locator = copyLocator(locator, {}); } domBuilder.locator = locator2; if (appendElement(el, domBuilder, currentNSMap)) { parseStack.push(el); } domBuilder.locator = locator; } else { if (appendElement(el, domBuilder, currentNSMap)) { parseStack.push(el); } } if (NAMESPACE.isHTML(el.uri) && !el.closed) { end = parseHtmlSpecialContent(source, end, el.tagName, entityReplacer, domBuilder); } else { end++; } } } catch (e) { if (e instanceof ParseError) { throw e; } errorHandler.error('element parse error: ' + e); end = -1; } if (end > start) { start = end; } else { //TODO: 这里有可能sax回退,有位置错误风险 appendText(Math.max(tagStart, start) + 1); } } } function copyLocator(f, t) { t.lineNumber = f.lineNumber; t.columnNumber = f.columnNumber; return t; } /** * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack); * @return end of the elementStartPart(end of elementEndPart for selfClosed el) */ function parseElementStartPart(source, start, el, currentNSMap, entityReplacer, errorHandler) { /** * @param {string} qname * @param {string} value * @param {number} startIndex */ function addAttribute(qname, value, startIndex) { if (el.attributeNames.hasOwnProperty(qname)) { errorHandler.fatalError('Attribute ' + qname + ' redefined'); } el.addValue(qname, // @see https://www.w3.org/TR/xml/#AVNormalize // since the xmldom sax parser does not "interpret" DTD the following is not implemented: // - recursive replacement of (DTD) entity references // - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA value.replace(/[\t\n\r]/g, ' ').replace(/&#?\w+;/g, entityReplacer), startIndex); } var attrName; var value; var p = ++start; var s = S_TAG; //status while (true) { var c = source.charAt(p); switch (c) { case '=': if (s === S_ATTR) { //attrName attrName = source.slice(start, p); s = S_EQ; } else if (s === S_ATTR_SPACE) { s = S_EQ; } else { //fatalError: equal must after attrName or space after attrName throw new Error('attribute equal must after attrName'); // No known test case } break; case '\'': case '"': if (s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE ) { //equal if (s === S_ATTR) { errorHandler.warning('attribute value must after "="'); attrName = source.slice(start, p); } start = p + 1; p = source.indexOf(c, start); if (p > 0) { value = source.slice(start, p); addAttribute(attrName, value, start - 1); s = S_ATTR_END; } else { //fatalError: no end quot match throw new Error('attribute value no end \'' + c + '\' match'); } } else if (s == S_ATTR_NOQUOT_VALUE) { value = source.slice(start, p); addAttribute(attrName, value, start); errorHandler.warning('attribute "' + attrName + '" missed start quot(' + c + ')!!'); start = p + 1; s = S_ATTR_END; } else { //fatalError: no equal before throw new Error('attribute value must after "="'); // No known test case } break; case '/': switch (s) { case S_TAG: el.setTagName(source.slice(start, p)); case S_ATTR_END: case S_TAG_SPACE: case S_TAG_CLOSE: s = S_TAG_CLOSE; el.closed = true; case S_ATTR_NOQUOT_VALUE: case S_ATTR: break; case S_ATTR_SPACE: el.closed = true; break; //case S_EQ: default: throw new Error("attribute invalid close char('/')"); // No known test case } break; case '': //end document errorHandler.error('unexpected end of input'); if (s == S_TAG) { el.setTagName(source.slice(start, p)); } return p; case '>': switch (s) { case S_TAG: el.setTagName(source.slice(start, p)); case S_ATTR_END: case S_TAG_SPACE: case S_TAG_CLOSE: break; //normal case S_ATTR_NOQUOT_VALUE: //Compatible state case S_ATTR: value = source.slice(start, p); if (value.slice(-1) === '/') { el.closed = true; value = value.slice(0, -1); } case S_ATTR_SPACE: if (s === S_ATTR_SPACE) { value = attrName; } if (s == S_ATTR_NOQUOT_VALUE) { errorHandler.warning('attribute "' + value + '" missed quot(")!'); addAttribute(attrName, value, start); } else { if (!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)) { errorHandler.warning('attribute "' + value + '" missed value!! "' + value + '" instead!!'); } addAttribute(value, value, start); } break; case S_EQ: throw new Error('attribute value missed!!'); } // console.log(tagName,tagNamePattern,tagNamePattern.test(tagName)) return p; /*xml space '\x20' | #x9 | #xD | #xA; */ case "\x80": c = ' '; default: if (c <= ' ') { //space switch (s) { case S_TAG: el.setTagName(source.slice(start, p)); //tagName s = S_TAG_SPACE; break; case S_ATTR: attrName = source.slice(start, p); s = S_ATTR_SPACE; break; case S_ATTR_NOQUOT_VALUE: var value = source.slice(start, p); errorHandler.warning('attribute "' + value + '" missed quot(")!!'); addAttribute(attrName, value, start); case S_ATTR_END: s = S_TAG_SPACE; break; //case S_TAG_SPACE: //case S_EQ: //case S_ATTR_SPACE: // void();break; //case S_TAG_CLOSE: //ignore warning } } else { //not space //S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE //S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE switch (s) { //case S_TAG:void();break; //case S_ATTR:void();break; //case S_ATTR_NOQUOT_VALUE:void();break; case S_ATTR_SPACE: var tagName = el.tagName; if (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) { errorHandler.warning('attribute "' + attrName + '" missed value!! "' + attrName + '" instead2!!'); } addAttribute(attrName, attrName, start); start = p; s = S_ATTR; break; case S_ATTR_END: errorHandler.warning('attribute space is required"' + attrName + '"!!'); case S_TAG_SPACE: s = S_ATTR; start = p; break; case S_EQ: s = S_ATTR_NOQUOT_VALUE; start = p; break; case S_TAG_CLOSE: throw new Error("elements closed character '/' and '>' must be connected to"); } } } //end outer switch //console.log('p++',p) p++; } } /** * @return true if has new namespace define */ function appendElement(el, domBuilder, currentNSMap) { var tagName = el.tagName; var localNSMap = null; //var currentNSMap = parseStack[parseStack.length-1].currentNSMap; var i = el.length; while (i--) { var a = el[i]; var qName = a.qName; var value = a.value; var nsp = qName.indexOf(':'); if (nsp > 0) { var prefix = a.prefix = qName.slice(0, nsp); var localName = qName.slice(nsp + 1); var nsPrefix = prefix === 'xmlns' && localName; } else { localName = qName; prefix = null; nsPrefix = qName === 'xmlns' && ''; } //can not set prefix,because prefix !== '' a.localName = localName; //prefix == null for no ns prefix attribute if (nsPrefix !== false) { //hack!! if (localNSMap == null) { localNSMap = {}; //console.log(currentNSMap,0) _copy(currentNSMap, currentNSMap = {}); //console.log(currentNSMap,1) } currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value; a.uri = NAMESPACE.XMLNS; domBuilder.startPrefixMapping(nsPrefix, value); } } var i = el.length; while (i--) { a = el[i]; var prefix = a.prefix; if (prefix) { //no prefix attribute has no namespace if (prefix === 'xml') { a.uri = NAMESPACE.XML; } if (prefix !== 'xmlns') { a.uri = currentNSMap[prefix || '']; //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)} } } } var nsp = tagName.indexOf(':'); if (nsp > 0) { prefix = el.prefix = tagName.slice(0, nsp); localName = el.localName = tagName.slice(nsp + 1); } else { prefix = null; //important!! localName = el.localName = tagName; } //no prefix element has default namespace var ns = el.uri = currentNSMap[prefix || '']; domBuilder.startElement(ns, localName, tagName, el); //endPrefixMapping and startPrefixMapping have not any help for dom builder //localNSMap = null if (el.closed) { domBuilder.endElement(ns, localName, tagName); if (localNSMap) { for (prefix in localNSMap) { if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) { domBuilder.endPrefixMapping(prefix); } } } } else { el.currentNSMap = currentNSMap; el.localNSMap = localNSMap; //parseStack.push(el); return true; } } function parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) { if (/^(?:script|textarea)$/i.test(tagName)) { var elEndStart = source.indexOf('</' + tagName + '>', elStartEnd); var text = source.substring(elStartEnd + 1, elEndStart); if (/[&<]/.test(text)) { if (/^script$/i.test(tagName)) { //if(!/\]\]>/.test(text)){ //lexHandler.startCDATA(); domBuilder.characters(text, 0, text.length); //lexHandler.endCDATA(); return elEndStart; //} } //}else{//text area text = text.replace(/&#?\w+;/g, entityReplacer); domBuilder.characters(text, 0, text.length); return elEndStart; //} } } return elStartEnd + 1; } function fixSelfClosed(source, elStartEnd, tagName, closeMap) { //if(tagName in closeMap){ var pos = closeMap[tagName]; if (pos == null) { //console.log(tagName) pos = source.lastIndexOf('</' + tagName + '>'); if (pos < elStartEnd) { //忘记闭合 pos = source.lastIndexOf('</' + tagName); } closeMap[tagName] = pos; } return pos < elStartEnd; //} } function _copy(source, target) { for (var n in source) { if (Object.prototype.hasOwnProperty.call(source, n)) { target[n] = source[n]; } } } function parseDCC(source, start, domBuilder, errorHandler) { //sure start with '<!' var next = source.charAt(start + 2); switch (next) { case '-': if (source.charAt(start + 3) === '-') { var end = source.indexOf('-->', start + 4); //append comment source.substring(4,end)//<!-- if (end > start) { domBuilder.comment(source, start + 4, end - start - 4); return end + 3; } else { errorHandler.error("Unclosed comment"); return -1; } } else { //error return -1; } default: if (source.substr(start + 3, 6) == 'CDATA[') { var end = source.indexOf(']]>', start + 9); domBuilder.startCDATA(); domBuilder.characters(source, start + 9, end - start - 9); domBuilder.endCDATA(); return end + 3; } //<!DOCTYPE //startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) var matchs = split(source, start); var len = matchs.length; if (len > 1 && /!doctype/i.test(matchs[0][0])) { var name = matchs[1][0]; var pubid = false; var sysid = false; if (len > 3) { if (/^public$/i.test(matchs[2][0])) { pubid = matchs[3][0]; sysid = len > 4 && matchs[4][0]; } else if (/^system$/i.test(matchs[2][0])) { sysid = matchs[3][0]; } } var lastMatch = matchs[len - 1]; domBuilder.startDTD(name, pubid, sysid); domBuilder.endDTD(); return lastMatch.index + lastMatch[0].length; } } return -1; } function parseInstruction(source, start, domBuilder) { var end = source.indexOf('?>', start); if (end) { var match = source.substring(start, end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/); if (match) { var len = match[0].length; domBuilder.processingInstruction(match[1], match[2]); return end + 2; } else { //error return -1; } } return -1; } function ElementAttributes() { this.attributeNames = {}; } ElementAttributes.prototype = { setTagName: function setTagName(tagName) { if (!tagNamePattern.test(tagName)) { throw new Error('invalid tagName:' + tagName); } this.tagName = tagName; }, addValue: function addValue(qName, value, offset) { if (!tagNamePattern.test(qName)) { throw new Error('invalid attribute:' + qName); } this.attributeNames[qName] = this.length; this[this.length++] = { qName: qName, value: value, offset: offset }; }, length: 0, getLocalName: function getLocalName(i) { return this[i].localName; }, getLocator: function getLocator(i) { return this[i].locator; }, getQName: function getQName(i) { return this[i].qName; }, getURI: function getURI(i) { return this[i].uri; }, getValue: function getValue(i) { return this[i].value; } // ,getIndex:function(uri, localName)){ // if(localName){ // // }else{ // var qName = uri // } // }, // getValue:function(){return this.getValue(this.getIndex.apply(this,arguments))}, // getType:function(uri,localName){} // getType:function(i){}, }; function split(source, start) { var match; var buf = []; var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g; reg.lastIndex = start; reg.exec(source); //skip < while (match = reg.exec(source)) { buf.push(match); if (match[1]) return buf; } } exports.XMLReader = XMLReader; exports.ParseError = ParseError; /***/ }), /***/ 82788: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var inWorker = "WorkerGlobalScope" in globalThis && globalThis instanceof globalThis.WorkerGlobalScope; function testVideoFormat(mimeType) { if (inWorker) { return false; } var video = document.createElement("video"); return video.canPlayType(mimeType) !== ""; } exports.testVideoFormat = testVideoFormat; /***/ }), /***/ 82834: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "computeMeasureExpression", ({ enumerable: true, get: function get() { return _CSSParser.computeMeasureExpression; } })); exports.parseClassAttr = parseClassAttr; exports.parseMeasureValue = parseMeasureValue; exports.parseStyleAttr = parseStyleAttr; var _CSSParser = __webpack_require__(87602); /** * * @param {String} text * @returns {Object} */ function parseStyleAttr(text) { return text.split(';').map(function (line) { var parts = line.split(':'); if (parts.length < 2) return null; var key = parts.shift().trim(); var value = parts.join(':').trim(); if (key.length == 0 || value.length == 0) return null; return [key, value]; }).filter(function (it) { return it != null; }).reduce(function (ac, cr) { ac[cr[0]] = cr[1]; return ac; }, {}); } /** * * @param {String} text * @returns {Array<String>} */ function parseClassAttr(text) { return text.trim().split(/\s+/); } /** * * @param mValue * @returns {{unit: null, value: string}|{unit: string, value: number}|null} */ function parseMeasureValue(mValue) { if (mValue === 'auto') return { unit: null, value: 'auto' }; if (mValue === 'match_parent') return { unit: null, value: 'match_parent' }; var value = NaN; var unit = null; var matched; if (typeof mValue === "number") { value = mValue; unit = 'px'; } else if (typeof mValue === "string") { matched = mValue.match(/([+-]?([0-9]*[.])?[0-9]+([eE][+-]?[0-9]+)?)(px|%|vw|vh|em|rem|pt)?/i); if (matched) { value = parseFloat(matched[1]); unit = matched[4]; } } if (isNaN(value)) return null; unit = unit || 'px'; return { value: value, unit: unit }; } /***/ }), /***/ 82847: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var Rectangle = __webpack_require__(74731); var buildUvs = __webpack_require__(36262); var transformVertices = __webpack_require__(25835); var Texture = __webpack_require__(73782); var PoolGroup = __webpack_require__(47505); var BatchableGraphics = __webpack_require__(84305); var buildCircle = __webpack_require__(94641); var buildLine = __webpack_require__(21187); var buildPixelLine = __webpack_require__(22247); var buildPolygon = __webpack_require__(18591); var buildRectangle = __webpack_require__(92828); var buildTriangle = __webpack_require__(96465); var generateTextureFillMatrix = __webpack_require__(81004); var triangulateWithHoles = __webpack_require__(39333); "use strict"; var shapeBuilders = {}; Extensions.extensions.handleByMap(Extensions.ExtensionType.ShapeBuilder, shapeBuilders); Extensions.extensions.add(buildRectangle.buildRectangle, buildPolygon.buildPolygon, buildTriangle.buildTriangle, buildCircle.buildCircle, buildCircle.buildEllipse, buildCircle.buildRoundedRectangle); var tempRect = new Rectangle.Rectangle(); var tempTextureMatrix = new Matrix.Matrix(); function buildContextBatches(context, gpuContext) { var geometryData = gpuContext.geometryData, batches = gpuContext.batches; batches.length = 0; geometryData.indices.length = 0; geometryData.vertices.length = 0; geometryData.uvs.length = 0; for (var i = 0; i < context.instructions.length; i++) { var instruction = context.instructions[i]; if (instruction.action === "texture") { addTextureToGeometryData(instruction.data, batches, geometryData); } else if (instruction.action === "fill" || instruction.action === "stroke") { var isStroke = instruction.action === "stroke"; var shapePath = instruction.data.path.shapePath; var style = instruction.data.style; var hole = instruction.data.hole; if (isStroke && hole) { addShapePathToGeometryData(hole.shapePath, style, true, batches, geometryData); } if (hole) { shapePath.shapePrimitives[shapePath.shapePrimitives.length - 1].holes = hole.shapePath.shapePrimitives; } addShapePathToGeometryData(shapePath, style, isStroke, batches, geometryData); } } } function addTextureToGeometryData(data, batches, geometryData) { var vertices = geometryData.vertices, uvs = geometryData.uvs, indices = geometryData.indices; var indexOffset = indices.length; var vertOffset = vertices.length / 2; var points = []; var build = shapeBuilders.rectangle; var rect = tempRect; var texture = data.image; rect.x = data.dx; rect.y = data.dy; rect.width = data.dw; rect.height = data.dh; var matrix = data.transform; build.build(rect, points); if (matrix) { transformVertices.transformVertices(points, matrix); } build.triangulate(points, vertices, 2, vertOffset, indices, indexOffset); var textureUvs = texture.uvs; uvs.push(textureUvs.x0, textureUvs.y0, textureUvs.x1, textureUvs.y1, textureUvs.x3, textureUvs.y3, textureUvs.x2, textureUvs.y2); var graphicsBatch = PoolGroup.BigPool.get(BatchableGraphics.BatchableGraphics); graphicsBatch.indexOffset = indexOffset; graphicsBatch.indexSize = indices.length - indexOffset; graphicsBatch.attributeOffset = vertOffset; graphicsBatch.attributeSize = vertices.length / 2 - vertOffset; graphicsBatch.baseColor = data.style; graphicsBatch.alpha = data.alpha; graphicsBatch.texture = texture; graphicsBatch.geometryData = geometryData; batches.push(graphicsBatch); } function addShapePathToGeometryData(shapePath, style, isStroke, batches, geometryData) { var vertices = geometryData.vertices, uvs = geometryData.uvs, indices = geometryData.indices; shapePath.shapePrimitives.forEach(function (_ref) { var shape = _ref.shape, matrix = _ref.transform, holes = _ref.holes; var indexOffset = indices.length; var vertOffset = vertices.length / 2; var points = []; var build = shapeBuilders[shape.type]; var topology = "triangle-list"; build.build(shape, points); if (matrix) { transformVertices.transformVertices(points, matrix); } if (!isStroke) { if (holes) { var holeIndices = []; var otherPoints = points.slice(); var holeArrays = getHoleArrays(holes); holeArrays.forEach(function (holePoints) { holeIndices.push(otherPoints.length / 2); otherPoints.push.apply(otherPoints, _toConsumableArray(holePoints)); }); triangulateWithHoles.triangulateWithHoles(otherPoints, holeIndices, vertices, 2, vertOffset, indices, indexOffset); } else { build.triangulate(points, vertices, 2, vertOffset, indices, indexOffset); } } else { var _shape$closePath; var close = (_shape$closePath = shape.closePath) !== null && _shape$closePath !== void 0 ? _shape$closePath : true; var lineStyle = style; if (!lineStyle.pixelLine) { buildLine.buildLine(points, lineStyle, false, close, vertices, indices); } else { buildPixelLine.buildPixelLine(points, close, vertices, indices); topology = "line-list"; } } var uvsOffset = uvs.length / 2; var texture = style.texture; if (texture !== Texture.Texture.WHITE) { var textureMatrix = generateTextureFillMatrix.generateTextureMatrix(tempTextureMatrix, style, shape, matrix); buildUvs.buildUvs(vertices, 2, vertOffset, uvs, uvsOffset, 2, vertices.length / 2 - vertOffset, textureMatrix); } else { buildUvs.buildSimpleUvs(uvs, uvsOffset, 2, vertices.length / 2 - vertOffset); } var graphicsBatch = PoolGroup.BigPool.get(BatchableGraphics.BatchableGraphics); graphicsBatch.indexOffset = indexOffset; graphicsBatch.indexSize = indices.length - indexOffset; graphicsBatch.attributeOffset = vertOffset; graphicsBatch.attributeSize = vertices.length / 2 - vertOffset; graphicsBatch.baseColor = style.color; graphicsBatch.alpha = style.alpha; graphicsBatch.texture = texture; graphicsBatch.geometryData = geometryData; graphicsBatch.topology = topology; batches.push(graphicsBatch); }); } function getHoleArrays(holePrimitives) { var holeArrays = []; for (var k = 0; k < holePrimitives.length; k++) { var holePrimitive = holePrimitives[k].shape; var holePoints = []; var holeBuilder = shapeBuilders[holePrimitive.type]; holeBuilder.build(holePrimitive, holePoints); holeArrays.push(holePoints); } return holeArrays; } exports.buildContextBatches = buildContextBatches; exports.shapeBuilders = shapeBuilders; /***/ }), /***/ 83014: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var source = "\n\nstruct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct NoiseUniforms {\n uNoise:f32,\n uSeed:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> noiseUniforms : NoiseUniforms;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n };\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n \n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n );\n}\n\nfn rand(co:vec2<f32>) -> f32\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\n\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n\n var pixelPosition = globalTextureCoord(position.xy);// / (getSize());//- gfu.uOutputFrame.xy);\n \n \n var sample = textureSample(uTexture, uSampler, uv);\n var randomValue = rand(pixelPosition.xy * noiseUniforms.uSeed);\n var diff = (randomValue - 0.5) * noiseUniforms.uNoise;\n \n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (sample.a > 0.0) {\n sample.r /= sample.a;\n sample.g /= sample.a;\n sample.b /= sample.a;\n }\n\n sample.r += diff;\n sample.g += diff;\n sample.b += diff;\n\n // Premultiply alpha again.\n sample.r *= sample.a;\n sample.g *= sample.a;\n sample.b *= sample.a;\n \n return sample;\n}"; exports["default"] = source; /***/ }), /***/ 83123: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var LoaderParser = __webpack_require__(96804); var createTexture = __webpack_require__(49698); var checkExtension = __webpack_require__(59230); var Extensions = __webpack_require__(86890); var CompressedSource = __webpack_require__(49326); var getSupportedTextureFormats = __webpack_require__(10144); var loadBasisOnWorker = __webpack_require__(23237); "use strict"; var loadBasis = { extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.High, name: "loadBasis" }, name: "loadBasis", test: function test(url) { return checkExtension.checkExtension(url, [".basis"]); }, load: function load(url, _asset, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var supportedTextures, textureOptions, compressedTextureSource; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return getSupportedTextureFormats.getSupportedTextureFormats(); case 1: supportedTextures = _context.v; _context.n = 2; return loadBasisOnWorker.loadBasisOnWorker(url, supportedTextures); case 2: textureOptions = _context.v; compressedTextureSource = new CompressedSource.CompressedSource(textureOptions); return _context.a(2, createTexture.createTexture(compressedTextureSource, loader, url)); } }, _callee); }))(); }, unload: function unload(texture) { if (Array.isArray(texture)) { texture.forEach(function (t) { return t.destroy(true); }); } else { texture.destroy(true); } } }; exports.loadBasis = loadBasis; /***/ }), /***/ 83432: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var GpuColorMaskSystem = /*#__PURE__*/function () { function GpuColorMaskSystem(renderer) { _classCallCheck(this, GpuColorMaskSystem); this._colorMaskCache = 15; this._renderer = renderer; } return _createClass(GpuColorMaskSystem, [{ key: "setMask", value: function setMask(colorMask) { if (this._colorMaskCache === colorMask) return; this._colorMaskCache = colorMask; this._renderer.pipeline.setColorMask(colorMask); } }, { key: "destroy", value: function destroy() { this._renderer = null; this._colorMaskCache = null; } }]); }(); /** @ignore */ GpuColorMaskSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "colorMask" }; exports.GpuColorMaskSystem = GpuColorMaskSystem; /***/ }), /***/ 83675: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var PlaneGeometry = __webpack_require__(45301); var applyProjectiveTransformationToPlane = __webpack_require__(8952); var compute2DProjections = __webpack_require__(10026); "use strict"; var PerspectivePlaneGeometry = /*#__PURE__*/function (_PlaneGeometry$PlaneG) { /** * @param options - Options to be applied to MeshPlane * @param options.width - The width of the plane * @param options.height - The height of the plane * @param options.verticesX - The amount of vertices on the x axis * @param options.verticesY - The amount of vertices on the y axis */ function PerspectivePlaneGeometry(options) { var _this; _classCallCheck(this, PerspectivePlaneGeometry); _this = _callSuper(this, PerspectivePlaneGeometry, [options]); _this._projectionMatrix = [0, 0, 0, 0, 0, 0, 0, 0, 0]; var width = options.width, height = options.height; _this.corners = [0, 0, width, 0, width, height, 0, height]; return _this; } /** * Will set the corners of the quad to the given coordinates * Calculating the perspective so it looks correct! * @param x0 - x coordinate of the first corner * @param y0 - y coordinate of the first corner * @param x1 - x coordinate of the second corner * @param y1 - y coordinate of the second corner * @param x2 - x coordinate of the third corner * @param y2 - y coordinate of the third corner * @param x3 - x coordinate of the fourth corner * @param y3 - y coordinate of the fourth corner */ _inherits(PerspectivePlaneGeometry, _PlaneGeometry$PlaneG); return _createClass(PerspectivePlaneGeometry, [{ key: "setCorners", value: function setCorners(x0, y0, x1, y1, x2, y2, x3, y3) { var corners = this.corners; corners[0] = x0; corners[1] = y0; corners[2] = x1; corners[3] = y1; corners[4] = x2; corners[5] = y2; corners[6] = x3; corners[7] = y3; this.updateProjection(); } /** Update the projection matrix based on the corners */ }, { key: "updateProjection", value: function updateProjection() { var width = this.width, height = this.height; var corners = this.corners; var projectionMatrix = compute2DProjections.compute2DProjection(this._projectionMatrix, 0, 0, // top-left source corners[0], corners[1], // top-left dest width, 0, // top-right source corners[2], corners[3], // top-right dest width, height, // bottom-right source corners[4], corners[5], // bottom-right dest 0, height, // bottom-left source corners[6], corners[7] // bottom-left dest ); applyProjectiveTransformationToPlane.applyProjectiveTransformationToPlane(width, height, this, projectionMatrix); } }]); }(PlaneGeometry.PlaneGeometry); exports.PerspectivePlaneGeometry = PerspectivePlaneGeometry; /***/ }), /***/ 83690: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var TickerListener = /*#__PURE__*/function () { /** * Constructor * @private * @param fn - The listener function to be added for one update * @param context - The listener context * @param priority - The priority for emitting * @param once - If the handler should fire once */ function TickerListener(fn) { var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; _classCallCheck(this, TickerListener); /** The next item in chain. */ this.next = null; /** The previous item in chain. */ this.previous = null; /** `true` if this listener has been destroyed already. */ this._destroyed = false; this._fn = fn; this._context = context; this.priority = priority; this._once = once; } /** * Simple compare function to figure out if a function and context match. * @param fn - The listener function to be added for one update * @param context - The listener context * @returns `true` if the listener match the arguments */ return _createClass(TickerListener, [{ key: "match", value: function match(fn) { var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; return this._fn === fn && this._context === context; } /** * Emit by calling the current function. * @param ticker - The ticker emitting. * @returns Next ticker */ }, { key: "emit", value: function emit(ticker) { if (this._fn) { if (this._context) { this._fn.call(this._context, ticker); } else { this._fn(ticker); } } var redirect = this.next; if (this._once) { this.destroy(true); } if (this._destroyed) { this.next = null; } return redirect; } /** * Connect to the list. * @param previous - Input node, previous listener */ }, { key: "connect", value: function connect(previous) { this.previous = previous; if (previous.next) { previous.next.previous = this; } this.next = previous.next; previous.next = this; } /** * Destroy and don't use after this. * @param hard - `true` to remove the `next` reference, this * is considered a hard destroy. Soft destroy maintains the next reference. * @returns The listener to redirect while emitting or removing. */ }, { key: "destroy", value: function destroy() { var hard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this._destroyed = true; this._fn = null; this._context = null; if (this.previous) { this.previous.next = this.next; } if (this.next) { this.next.previous = this.previous; } var redirect = this.next; this.next = hard ? null : redirect; this.previous = null; return redirect; } }]); }(); exports.TickerListener = TickerListener; /***/ }), /***/ 83873: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var blendTemplate = "\nstruct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct BlendUniforms {\n uBlend:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n@group(0) @binding(3) var uBackTexture: texture_2d<f32>;\n\n@group(1) @binding(0) var<uniform> blendUniforms : BlendUniforms;\n\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n };\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); \n}\n \n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n );\n}\n\n{FUNCTIONS}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>\n) -> @location(0) vec4<f32> {\n\n\n var back = textureSample(uBackTexture, uSampler, uv);\n var front = textureSample(uTexture, uSampler, uv);\n var blendedAlpha = front.a + back.a * (1.0 - front.a);\n \n var out = vec4<f32>(0.0,0.0,0.0,0.0);\n\n {MAIN}\n\n return out;\n}"; exports["default"] = blendTemplate; /***/ }), /***/ 83886: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AbstractBullet = AbstractBullet; exports.DanBang = DanBang; exports.DanHoa = DanHoa; exports.DanMoc = DanMoc; exports.DanPhong = DanPhong; exports.DanTho = DanTho; exports.DanThuy = DanThuy; var _Vec = _interopRequireDefault(__webpack_require__(28239)); var _util = __webpack_require__(19330); var _pixi = __webpack_require__(3635); var _stringGenerate = __webpack_require__(356); var _OOP = __webpack_require__(64181); var _AllianceObjects = __webpack_require__(2352); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * * @param {AbstractAlliance} from * @param {StaticObject|AbstractEnemy}to * @constructor */ function AbstractBullet(from, to) { this.id = (0, _stringGenerate.randomIdent)(8); /** * * @type {Level1Scene|AbstractScene|PreviewScene} */ this.scene = from.scene; this.from = from; this.to = to; this.keyFrame = 0; this.A = new _Vec["default"](from.x + 0.5, from.y + 0.5); this.B = new _Vec["default"](to.x + to.width / 2, to.y + to.height / 2); this.duration = this.B.sub(this.A).abs() * 200; this.sprite = new _pixi.Sprite(this.scene.assetMng.getTexture(this.imageRes)); this.sprite.x = -16; this.sprite.y = -16; this.root = new _pixi.Container(); this.root.addChild(this.sprite); this.scene.pGrid.addChild(this.root); this.root.x = from.x * 128; this.root.y = from.y * 128; this.scene.bullets[this.id] = this; } AbstractBullet.prototype.imageRes = 'dan_tho'; AbstractBullet.prototype.slowEffect = false; AbstractBullet.prototype.update = function (deltaTime) { var to = this.to; this.B = new _Vec["default"](to.x + to.width / 2, to.y + to.height / 2); var A = this.A; var B = this.B; var N = B.sub(A); var C; this.keyFrame += deltaTime / this.duration; var t = this.keyFrame; if (t >= 1) { this.makeDamage(); this.remove(); } else { t = (0, _util.outQuadBlend)(t); C = A.add(N.mult(t)); this.root.x = C.x * 108; this.root.y = C.y * 108; } }; AbstractBullet.prototype.makeDamage = function () { var attack = this.from.attack; if (this.slowEffect) this.to.beSlow(1000); this.to.beDamaged(attack); this.keyFrame = 2e3; }; AbstractBullet.prototype.remove = function () { this.root.parent.removeChild(this.root); delete this.scene.bullets[this.id]; }; /** * @extends AbstractBullet * @constructor */ function DanTho() { AbstractBullet.apply(this, arguments); } (0, _OOP.mixClass)(DanTho, AbstractBullet); DanTho.prototype.imageRes = 'dan_tho'; /** * @extends AbstractBullet * @constructor */ function DanBang() { AbstractBullet.apply(this, arguments); } (0, _OOP.mixClass)(DanBang, AbstractBullet); DanBang.prototype.imageRes = 'dan_bang'; DanBang.prototype.slowEffect = true; /** * @extends AbstractBullet * @constructor */ function DanMoc() { AbstractBullet.apply(this, arguments); } (0, _OOP.mixClass)(DanMoc, AbstractBullet); DanMoc.prototype.imageRes = 'dan_moc'; /** * @extends AbstractBullet * @constructor */ function DanHoa() { AbstractBullet.apply(this, arguments); } (0, _OOP.mixClass)(DanHoa, AbstractBullet); DanHoa.prototype.imageRes = 'dan_hoa'; /** * @extends AbstractBullet * @constructor */ function DanThuy() { AbstractBullet.apply(this, arguments); } (0, _OOP.mixClass)(DanThuy, AbstractBullet); DanThuy.prototype.imageRes = 'dan_thuy'; /** * @extends AbstractBullet * @constructor */ function DanPhong() { AbstractBullet.apply(this, arguments); } (0, _OOP.mixClass)(DanPhong, AbstractBullet); DanPhong.prototype.imageRes = 'dan_phong'; /***/ }), /***/ 83987: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var PI_2 = Math.PI * 2; var RAD_TO_DEG = 180 / Math.PI; var DEG_TO_RAD = Math.PI / 180; exports.DEG_TO_RAD = DEG_TO_RAD; exports.PI_2 = PI_2; exports.RAD_TO_DEG = RAD_TO_DEG; /***/ }), /***/ 84189: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Sprite = __webpack_require__(27615); "use strict"; var colors = ["#000080", // Navy Blue "#228B22", // Forest Green "#8B0000", // Dark Red "#4169E1", // Royal Blue "#008080", // Teal "#800000", // Maroon "#9400D3", // Dark Violet "#FF8C00", // Dark Orange "#556B2F", // Olive Green "#8B008B" // Dark Magenta ]; var colorTick = 0; function logScene(container) { var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { color: "#000000" }; if (container.renderGroup) { data.color = colors[colorTick++]; } var spaces = ""; for (var i = 0; i < depth; i++) { spaces += " "; } var label = container.label; if (!label && container instanceof Sprite.Sprite) { label = "sprite:".concat(container.texture.label); } var output = "%c ".concat(spaces, "|- ").concat(label, " (worldX:").concat(container.worldTransform.tx, ", relativeRenderX:").concat(container.relativeGroupTransform.tx, ", renderX:").concat(container.groupTransform.tx, ", localX:").concat(container.x, ")"); if (container.renderGroup) { output += " (RenderGroup)"; } if (container.filters) { output += "(*filters)"; } console.log(output, "color:".concat(data.color, "; font-weight:bold;")); depth++; for (var _i = 0; _i < container.children.length; _i++) { var child = container.children[_i]; logScene(child, depth, _objectSpread({}, data)); } } function logRenderGroupScene(renderGroup) { var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { index: 0, color: "#000000" }; var spaces = ""; for (var i = 0; i < depth; i++) { spaces += " "; } var output = "%c ".concat(spaces, "- ").concat(data.index, ": ").concat(renderGroup.root.label, " worldX:").concat(renderGroup.worldTransform.tx); console.log(output, "color:".concat(data.color, "; font-weight:bold;")); depth++; for (var _i2 = 0; _i2 < renderGroup.renderGroupChildren.length; _i2++) { var child = renderGroup.renderGroupChildren[_i2]; logRenderGroupScene(child, depth, _objectSpread(_objectSpread({}, data), {}, { index: _i2 })); } } exports.logRenderGroupScene = logRenderGroupScene; exports.logScene = logScene; /***/ }), /***/ 84305: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Matrix = __webpack_require__(20764); var multiplyHexColors = __webpack_require__(6967); "use strict"; var identityMatrix = new Matrix.Matrix(); var BatchableGraphics = /*#__PURE__*/function () { function BatchableGraphics() { _classCallCheck(this, BatchableGraphics); this.packAsQuad = false; this.batcherName = "default"; this.topology = "triangle-list"; this.applyTransform = true; this.roundPixels = 0; this._batcher = null; this._batch = null; } return _createClass(BatchableGraphics, [{ key: "uvs", get: function get() { return this.geometryData.uvs; } }, { key: "positions", get: function get() { return this.geometryData.vertices; } }, { key: "indices", get: function get() { return this.geometryData.indices; } }, { key: "blendMode", get: function get() { if (this.applyTransform) { return this.renderable.groupBlendMode; } return "normal"; } }, { key: "color", get: function get() { var rgb = this.baseColor; var bgr = rgb >> 16 | rgb & 65280 | (rgb & 255) << 16; var renderable = this.renderable; if (renderable) { return multiplyHexColors.multiplyHexColors(bgr, renderable.groupColor) + (this.alpha * renderable.groupAlpha * 255 << 24); } return bgr + (this.alpha * 255 << 24); } }, { key: "transform", get: function get() { var _this$renderable; return ((_this$renderable = this.renderable) === null || _this$renderable === void 0 ? void 0 : _this$renderable.groupTransform) || identityMatrix; } }, { key: "copyTo", value: function copyTo(gpuBuffer) { gpuBuffer.indexOffset = this.indexOffset; gpuBuffer.indexSize = this.indexSize; gpuBuffer.attributeOffset = this.attributeOffset; gpuBuffer.attributeSize = this.attributeSize; gpuBuffer.baseColor = this.baseColor; gpuBuffer.alpha = this.alpha; gpuBuffer.texture = this.texture; gpuBuffer.geometryData = this.geometryData; gpuBuffer.topology = this.topology; } }, { key: "reset", value: function reset() { this.applyTransform = true; this.renderable = null; this.topology = "triangle-list"; } }]); }(); exports.BatchableGraphics = BatchableGraphics; /***/ }), /***/ 84344: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var warn = __webpack_require__(57371); "use strict"; var _GlContextSystem = /*#__PURE__*/function () { /** @param renderer - The renderer this System works for. */ function _GlContextSystem(renderer) { _classCallCheck(this, _GlContextSystem); /** * Features supported by current renderer. * @type {object} * @readonly */ this.supports = { /** Support for 32-bit indices buffer. */ uint32Indices: true, /** Support for UniformBufferObjects */ uniformBufferObject: true, /** Support for VertexArrayObjects */ vertexArrayObject: true, /** Support for SRGB texture format */ srgbTextures: true, /** Support for wrapping modes if a texture is non-power of two */ nonPowOf2wrapping: true, /** Support for MSAA (antialiasing of dynamic textures) */ msaa: true, /** Support for mipmaps if a texture is non-power of two */ nonPowOf2mipmaps: true }; this._renderer = renderer; this.extensions = /* @__PURE__ */Object.create(null); this.handleContextLost = this.handleContextLost.bind(this); this.handleContextRestored = this.handleContextRestored.bind(this); } /** * `true` if the context is lost * @readonly */ return _createClass(_GlContextSystem, [{ key: "isLost", get: function get() { return !this.gl || this.gl.isContextLost(); } /** * Handles the context change event. * @param {WebGLRenderingContext} gl - New WebGL context. */ }, { key: "contextChange", value: function contextChange(gl) { this.gl = gl; this._renderer.gl = gl; } }, { key: "init", value: function init(options) { options = _objectSpread(_objectSpread({}, _GlContextSystem.defaultOptions), options); var multiView = this.multiView = options.multiView; if (options.context && multiView) { warn.warn("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."); multiView = false; } if (multiView) { this.canvas = adapter.DOMAdapter.get().createCanvas(this._renderer.canvas.width, this._renderer.canvas.height); } else { this.canvas = this._renderer.view.canvas; } if (options.context) { this.initFromContext(options.context); } else { var _options$premultiplie, _options$powerPrefere; var alpha = this._renderer.background.alpha < 1; var premultipliedAlpha = (_options$premultiplie = options.premultipliedAlpha) !== null && _options$premultiplie !== void 0 ? _options$premultiplie : true; var antialias = options.antialias && !this._renderer.backBuffer.useBackBuffer; this.createContext(options.preferWebGLVersion, { alpha: alpha, premultipliedAlpha: premultipliedAlpha, antialias: antialias, stencil: true, preserveDrawingBuffer: options.preserveDrawingBuffer, powerPreference: (_options$powerPrefere = options.powerPreference) !== null && _options$powerPrefere !== void 0 ? _options$powerPrefere : "default" }); } } }, { key: "ensureCanvasSize", value: function ensureCanvasSize(targetCanvas) { if (!this.multiView) { if (targetCanvas !== this.canvas) { warn.warn("multiView is disabled, but targetCanvas is not the main canvas"); } return; } var canvas = this.canvas; if (canvas.width < targetCanvas.width || canvas.height < targetCanvas.height) { canvas.width = Math.max(targetCanvas.width, targetCanvas.width); canvas.height = Math.max(targetCanvas.height, targetCanvas.height); } } /** * Initializes the context. * @protected * @param {WebGLRenderingContext} gl - WebGL context */ }, { key: "initFromContext", value: function initFromContext(gl) { this.gl = gl; this.webGLVersion = gl instanceof adapter.DOMAdapter.get().getWebGLRenderingContext() ? 1 : 2; this.getExtensions(); this.validateContext(gl); this._renderer.runners.contextChange.emit(gl); var element = this._renderer.view.canvas; element.addEventListener("webglcontextlost", this.handleContextLost, false); element.addEventListener("webglcontextrestored", this.handleContextRestored, false); } /** * Initialize from context options * @protected * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext * @param preferWebGLVersion * @param {object} options - context attributes */ }, { key: "createContext", value: function createContext(preferWebGLVersion, options) { var gl; var canvas = this.canvas; if (preferWebGLVersion === 2) { gl = canvas.getContext("webgl2", options); } if (!gl) { gl = canvas.getContext("webgl", options); if (!gl) { throw new Error("This browser does not support WebGL. Try using the canvas renderer"); } } this.gl = gl; this.initFromContext(this.gl); } /** Auto-populate the {@link GlContextSystem.extensions extensions}. */ }, { key: "getExtensions", value: function getExtensions() { var gl = this.gl; var common = { anisotropicFiltering: gl.getExtension("EXT_texture_filter_anisotropic"), floatTextureLinear: gl.getExtension("OES_texture_float_linear"), s3tc: gl.getExtension("WEBGL_compressed_texture_s3tc"), s3tc_sRGB: gl.getExtension("WEBGL_compressed_texture_s3tc_srgb"), // eslint-disable-line camelcase etc: gl.getExtension("WEBGL_compressed_texture_etc"), etc1: gl.getExtension("WEBGL_compressed_texture_etc1"), pvrtc: gl.getExtension("WEBGL_compressed_texture_pvrtc") || gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"), atc: gl.getExtension("WEBGL_compressed_texture_atc"), astc: gl.getExtension("WEBGL_compressed_texture_astc"), bptc: gl.getExtension("EXT_texture_compression_bptc"), rgtc: gl.getExtension("EXT_texture_compression_rgtc"), loseContext: gl.getExtension("WEBGL_lose_context") }; if (this.webGLVersion === 1) { this.extensions = _objectSpread(_objectSpread({}, common), {}, { drawBuffers: gl.getExtension("WEBGL_draw_buffers"), depthTexture: gl.getExtension("WEBGL_depth_texture"), vertexArrayObject: gl.getExtension("OES_vertex_array_object") || gl.getExtension("MOZ_OES_vertex_array_object") || gl.getExtension("WEBKIT_OES_vertex_array_object"), uint32ElementIndex: gl.getExtension("OES_element_index_uint"), // Floats and half-floats floatTexture: gl.getExtension("OES_texture_float"), floatTextureLinear: gl.getExtension("OES_texture_float_linear"), textureHalfFloat: gl.getExtension("OES_texture_half_float"), textureHalfFloatLinear: gl.getExtension("OES_texture_half_float_linear"), vertexAttribDivisorANGLE: gl.getExtension("ANGLE_instanced_arrays"), srgb: gl.getExtension("EXT_sRGB") }); } else { this.extensions = _objectSpread(_objectSpread({}, common), {}, { colorBufferFloat: gl.getExtension("EXT_color_buffer_float") }); var provokeExt = gl.getExtension("WEBGL_provoking_vertex"); if (provokeExt) { provokeExt.provokingVertexWEBGL(provokeExt.FIRST_VERTEX_CONVENTION_WEBGL); } } } /** * Handles a lost webgl context * @param {WebGLContextEvent} event - The context lost event. */ }, { key: "handleContextLost", value: function handleContextLost(event) { var _this = this; event.preventDefault(); if (this._contextLossForced) { this._contextLossForced = false; setTimeout(function () { if (_this.gl.isContextLost()) { var _this$extensions$lose; (_this$extensions$lose = _this.extensions.loseContext) === null || _this$extensions$lose === void 0 || _this$extensions$lose.restoreContext(); } }, 0); } } /** Handles a restored webgl context. */ }, { key: "handleContextRestored", value: function handleContextRestored() { this._renderer.runners.contextChange.emit(this.gl); } }, { key: "destroy", value: function destroy() { var _this$extensions$lose2; var element = this._renderer.view.canvas; this._renderer = null; element.removeEventListener("webglcontextlost", this.handleContextLost); element.removeEventListener("webglcontextrestored", this.handleContextRestored); this.gl.useProgram(null); (_this$extensions$lose2 = this.extensions.loseContext) === null || _this$extensions$lose2 === void 0 || _this$extensions$lose2.loseContext(); } /** * this function can be called to force a webGL context loss * this will release all resources on the GPU. * Useful if you need to put Pixi to sleep, and save some GPU memory * * As soon as render is called - all resources will be created again. */ }, { key: "forceContextLoss", value: function forceContextLoss() { var _this$extensions$lose3; (_this$extensions$lose3 = this.extensions.loseContext) === null || _this$extensions$lose3 === void 0 || _this$extensions$lose3.loseContext(); this._contextLossForced = true; } /** * Validate context. * @param {WebGLRenderingContext} gl - Render context. */ }, { key: "validateContext", value: function validateContext(gl) { var attributes = gl.getContextAttributes(); if (attributes && !attributes.stencil) { warn.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly"); } var supports = this.supports; var isWebGl2 = this.webGLVersion === 2; var extensions = this.extensions; supports.uint32Indices = isWebGl2 || !!extensions.uint32ElementIndex; supports.uniformBufferObject = isWebGl2; supports.vertexArrayObject = isWebGl2 || !!extensions.vertexArrayObject; supports.srgbTextures = isWebGl2 || !!extensions.srgb; supports.nonPowOf2wrapping = isWebGl2; supports.nonPowOf2mipmaps = isWebGl2; supports.msaa = isWebGl2; if (!supports.uint32Indices) { warn.warn("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly"); } } }]); }(); /** @ignore */ _GlContextSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "context" }; /** The default options for the system. */ _GlContextSystem.defaultOptions = { /** * {@link WebGLOptions.context} * @default null */ context: null, /** * {@link WebGLOptions.premultipliedAlpha} * @default true */ premultipliedAlpha: true, /** * {@link WebGLOptions.preserveDrawingBuffer} * @default false */ preserveDrawingBuffer: false, /** * {@link WebGLOptions.powerPreference} * @default default */ powerPreference: void 0, /** * {@link WebGLOptions.webGLVersion} * @default 2 */ preferWebGLVersion: 2, /** * {@link WebGLOptions.multiView} * @default false */ multiView: false }; var GlContextSystem = _GlContextSystem; exports.GlContextSystem = GlContextSystem; /***/ }), /***/ 84853: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var HardMixBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function HardMixBlend() { _classCallCheck(this, HardMixBlend); return _callSuper(this, HardMixBlend, [{ gl: { functions: "\n float hardMix(float base, float blend)\n {\n return (base + blend >= 1.0) ? 1.0 : 0.0;\n }\n\n vec3 blendHardMix(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n hardMix(base.r, blend.r),\n hardMix(base.g, blend.g),\n hardMix(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendHardMix(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn hardMix(base: f32, blend: f32) -> f32\n {\n return select(0.0, 1.0, base + blend >= 1.0);\n }\n\n fn blendHardMix(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blended: vec3<f32> = vec3<f32>(\n hardMix(base.r, blend.r),\n hardMix(base.g, blend.g),\n hardMix(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendHardMix(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(HardMixBlend, _BlendModeFilter$Blen); return _createClass(HardMixBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ HardMixBlend.extension = { name: "hard-mix", type: Extensions.ExtensionType.BlendMode }; exports.HardMixBlend = HardMixBlend; /***/ }), /***/ 84860: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var BrowserAdapter = __webpack_require__(24509); var browserExt = __webpack_require__(44241); "use strict"; exports.BrowserAdapter = BrowserAdapter.BrowserAdapter; exports.browserExt = browserExt.browserExt; /***/ }), /***/ 84938: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var blendModeIds = { normal: 0, add: 1, multiply: 2, screen: 3, overlay: 4, erase: 5, "normal-npm": 6, "add-npm": 7, "screen-npm": 8, min: 9, max: 10 }; var BLEND = 0; var OFFSET = 1; var CULLING = 2; var DEPTH_TEST = 3; var WINDING = 4; var DEPTH_MASK = 5; var _State = /*#__PURE__*/function () { function _State() { _classCallCheck(this, _State); this.data = 0; this.blendMode = "normal"; this.polygonOffset = 0; this.blend = true; this.depthMask = true; } /** * Activates blending of the computed fragment color values. * @default true */ return _createClass(_State, [{ key: "blend", get: function get() { return !!(this.data & 1 << BLEND); }, set: function set(value) { if (!!(this.data & 1 << BLEND) !== value) { this.data ^= 1 << BLEND; } } /** * Activates adding an offset to depth values of polygon's fragments * @default false */ }, { key: "offsets", get: function get() { return !!(this.data & 1 << OFFSET); }, set: function set(value) { if (!!(this.data & 1 << OFFSET) !== value) { this.data ^= 1 << OFFSET; } } /** The culling settings for this state none - No culling back - Back face culling front - Front face culling */ }, { key: "cullMode", get: function get() { if (!this.culling) { return "none"; } return this.clockwiseFrontFace ? "front" : "back"; } /** * Activates culling of polygons. * @default false */, set: function set(value) { if (value === "none") { this.culling = false; return; } this.culling = true; this.clockwiseFrontFace = value === "front"; } }, { key: "culling", get: function get() { return !!(this.data & 1 << CULLING); }, set: function set(value) { if (!!(this.data & 1 << CULLING) !== value) { this.data ^= 1 << CULLING; } } /** * Activates depth comparisons and updates to the depth buffer. * @default false */ }, { key: "depthTest", get: function get() { return !!(this.data & 1 << DEPTH_TEST); }, set: function set(value) { if (!!(this.data & 1 << DEPTH_TEST) !== value) { this.data ^= 1 << DEPTH_TEST; } } /** * Enables or disables writing to the depth buffer. * @default true */ }, { key: "depthMask", get: function get() { return !!(this.data & 1 << DEPTH_MASK); }, set: function set(value) { if (!!(this.data & 1 << DEPTH_MASK) !== value) { this.data ^= 1 << DEPTH_MASK; } } /** * Specifies whether or not front or back-facing polygons can be culled. * @default false */ }, { key: "clockwiseFrontFace", get: function get() { return !!(this.data & 1 << WINDING); }, set: function set(value) { if (!!(this.data & 1 << WINDING) !== value) { this.data ^= 1 << WINDING; } } /** * The blend mode to be applied when this state is set. Apply a value of `normal` to reset the blend mode. * Setting this mode to anything other than NO_BLEND will automatically switch blending on. * @default 'normal' */ }, { key: "blendMode", get: function get() { return this._blendMode; }, set: function set(value) { this.blend = value !== "none"; this._blendMode = value; this._blendModeId = blendModeIds[value] || 0; } /** * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill. * @default 0 */ }, { key: "polygonOffset", get: function get() { return this._polygonOffset; }, set: function set(value) { this.offsets = !!value; this._polygonOffset = value; } }, { key: "toString", value: function toString() { return "[pixi.js/core:State blendMode=".concat(this.blendMode, " clockwiseFrontFace=").concat(this.clockwiseFrontFace, " culling=").concat(this.culling, " depthMask=").concat(this.depthMask, " polygonOffset=").concat(this.polygonOffset, "]"); } /** * A quickly getting an instance of a State that is configured for 2d rendering. * @returns a new State with values set for 2d rendering */ }], [{ key: "for2d", value: function for2d() { var state = new _State(); state.depthTest = false; state.blend = true; return state; } }]); }(); _State.default2d = _State.for2d(); var State = _State; exports.State = State; /***/ }), /***/ 84968: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var warn = __webpack_require__(57371); var AbstractText = __webpack_require__(93213); var TextStyle = __webpack_require__(55858); var BitmapFontManager = __webpack_require__(30815); "use strict"; var BitmapText = /*#__PURE__*/function (_AbstractText$Abstrac) { function BitmapText() { var _options$style, _a$fill; var _this; _classCallCheck(this, BitmapText); var _a; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var options = AbstractText.ensureTextOptions(args, "BitmapText"); (_options$style = options.style) !== null && _options$style !== void 0 ? _options$style : options.style = options.style || {}; (_a$fill = (_a = options.style).fill) !== null && _a$fill !== void 0 ? _a$fill : _a.fill = 16777215; _this = _callSuper(this, BitmapText, [options, TextStyle.TextStyle]); _this.renderPipeId = "bitmapText"; return _this; } /** @private */ _inherits(BitmapText, _AbstractText$Abstrac); return _createClass(BitmapText, [{ key: "updateBounds", value: function updateBounds() { var bounds = this._bounds; var anchor = this._anchor; var bitmapMeasurement = BitmapFontManager.BitmapFontManager.measureText(this.text, this._style); var scale = bitmapMeasurement.scale; var offset = bitmapMeasurement.offsetY * scale; var width = bitmapMeasurement.width * scale; var height = bitmapMeasurement.height * scale; var stroke = this._style._stroke; if (stroke) { width += stroke.width; height += stroke.width; } bounds.minX = -anchor._x * width; bounds.maxX = bounds.minX + width; bounds.minY = -anchor._y * (height + offset); bounds.maxY = bounds.minY + height; } /** * The resolution / device pixel ratio of the canvas. * @default 1 */ }, { key: "resolution", get: function get() { return this._resolution; }, set: function set(value) { if (value !== null) { warn.warn( // eslint-disable-next-line max-len "[BitmapText] dynamically updating the resolution is not supported. Resolution should be managed by the BitmapFont."); } } }]); }(AbstractText.AbstractText); exports.BitmapText = BitmapText; /***/ }), /***/ 85080: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var Color = __webpack_require__(98828); "use strict"; function textStyleToCSS(style) { var stroke = style._stroke; var fill = style._fill; var cssStyleString = ["color: ".concat(Color.Color.shared.setValue(fill.color).toHex()), "font-size: ".concat(style.fontSize, "px"), "font-family: ".concat(style.fontFamily), "font-weight: ".concat(style.fontWeight), "font-style: ".concat(style.fontStyle), "font-variant: ".concat(style.fontVariant), "letter-spacing: ".concat(style.letterSpacing, "px"), "text-align: ".concat(style.align), "padding: ".concat(style.padding, "px"), "white-space: ".concat(style.whiteSpace === "pre" && style.wordWrap ? "pre-wrap" : style.whiteSpace)].concat(_toConsumableArray(style.lineHeight ? ["line-height: ".concat(style.lineHeight, "px")] : []), _toConsumableArray(style.wordWrap ? ["word-wrap: ".concat(style.breakWords ? "break-all" : "break-word"), "max-width: ".concat(style.wordWrapWidth, "px")] : []), _toConsumableArray(stroke ? [strokeToCSS(stroke)] : []), _toConsumableArray(style.dropShadow ? [dropShadowToCSS(style.dropShadow)] : []), _toConsumableArray(style.cssOverrides)).join(";"); var cssStyles = ["div { ".concat(cssStyleString, " }")]; tagStyleToCSS(style.tagStyles, cssStyles); return cssStyles.join(" "); } function dropShadowToCSS(dropShadowStyle) { var color = Color.Color.shared.setValue(dropShadowStyle.color).setAlpha(dropShadowStyle.alpha).toHexa(); var x = Math.round(Math.cos(dropShadowStyle.angle) * dropShadowStyle.distance); var y = Math.round(Math.sin(dropShadowStyle.angle) * dropShadowStyle.distance); var position = "".concat(x, "px ").concat(y, "px"); if (dropShadowStyle.blur > 0) { return "text-shadow: ".concat(position, " ").concat(dropShadowStyle.blur, "px ").concat(color); } return "text-shadow: ".concat(position, " ").concat(color); } function strokeToCSS(stroke) { return ["-webkit-text-stroke-width: ".concat(stroke.width, "px"), "-webkit-text-stroke-color: ".concat(Color.Color.shared.setValue(stroke.color).toHex()), "text-stroke-width: ".concat(stroke.width, "px"), "text-stroke-color: ".concat(Color.Color.shared.setValue(stroke.color).toHex()), "paint-order: stroke"].join(";"); } var templates = { fontSize: "font-size: {{VALUE}}px", fontFamily: "font-family: {{VALUE}}", fontWeight: "font-weight: {{VALUE}}", fontStyle: "font-style: {{VALUE}}", fontVariant: "font-variant: {{VALUE}}", letterSpacing: "letter-spacing: {{VALUE}}px", align: "text-align: {{VALUE}}", padding: "padding: {{VALUE}}px", whiteSpace: "white-space: {{VALUE}}", lineHeight: "line-height: {{VALUE}}px", wordWrapWidth: "max-width: {{VALUE}}px" }; var transform = { fill: function fill(value) { return "color: ".concat(Color.Color.shared.setValue(value).toHex()); }, breakWords: function breakWords(value) { return "word-wrap: ".concat(value ? "break-all" : "break-word"); }, stroke: strokeToCSS, dropShadow: dropShadowToCSS }; function tagStyleToCSS(tagStyles, out) { for (var i in tagStyles) { var tagStyle = tagStyles[i]; var cssTagStyle = []; for (var j in tagStyle) { if (transform[j]) { cssTagStyle.push(transform[j](tagStyle[j])); } else if (templates[j]) { cssTagStyle.push(templates[j].replace("{{VALUE}}", tagStyle[j])); } } out.push("".concat(i, " { ").concat(cssTagStyle.join(";"), " }")); } } exports.textStyleToCSS = textStyleToCSS; /***/ }), /***/ 85156: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var BindGroup = /*#__PURE__*/function () { /** * Create a new instance eof the Bind Group. * @param resources - The resources that are bound together for use by a shader. */ function BindGroup(resources) { _classCallCheck(this, BindGroup); /** The resources that are bound together for use by a shader. */ this.resources = /* @__PURE__ */Object.create(null); this._dirty = true; var index = 0; for (var i in resources) { var resource = resources[i]; this.setResource(resource, index++); } this._updateKey(); } /** * Updates the key if its flagged as dirty. This is used internally to * match this bind group to a WebGPU BindGroup. * @internal * @ignore */ return _createClass(BindGroup, [{ key: "_updateKey", value: function _updateKey() { if (!this._dirty) return; this._dirty = false; var keyParts = []; var index = 0; for (var i in this.resources) { keyParts[index++] = this.resources[i]._resourceId; } this._key = keyParts.join("|"); } /** * Set a resource at a given index. this function will * ensure that listeners will be removed from the current resource * and added to the new resource. * @param resource - The resource to set. * @param index - The index to set the resource at. */ }, { key: "setResource", value: function setResource(resource, index) { var _resource$on; var currentResource = this.resources[index]; if (resource === currentResource) return; if (currentResource) { var _resource$off; (_resource$off = resource.off) === null || _resource$off === void 0 || _resource$off.call(resource, "change", this.onResourceChange, this); } (_resource$on = resource.on) === null || _resource$on === void 0 || _resource$on.call(resource, "change", this.onResourceChange, this); this.resources[index] = resource; this._dirty = true; } /** * Returns the resource at the current specified index. * @param index - The index of the resource to get. * @returns - The resource at the specified index. */ }, { key: "getResource", value: function getResource(index) { return this.resources[index]; } /** * Used internally to 'touch' each resource, to ensure that the GC * knows that all resources in this bind group are still being used. * @param tick - The current tick. * @internal * @ignore */ }, { key: "_touch", value: function _touch(tick) { var resources = this.resources; for (var i in resources) { resources[i]._touched = tick; } } /** Destroys this bind group and removes all listeners. */ }, { key: "destroy", value: function destroy() { var resources = this.resources; for (var i in resources) { var _resource$off2; var resource = resources[i]; (_resource$off2 = resource.off) === null || _resource$off2 === void 0 || _resource$off2.call(resource, "change", this.onResourceChange, this); } this.resources = null; } }, { key: "onResourceChange", value: function onResourceChange(resource) { this._dirty = true; if (resource.destroyed) { var resources = this.resources; for (var i in resources) { if (resources[i] === resource) { resources[i] = null; } } } else { this._updateKey(); } } }]); }(); exports.BindGroup = BindGroup; /***/ }), /***/ 85503: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 85580: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var getAttributeInfoFromFormat = __webpack_require__(63421); var ensureAttributes = __webpack_require__(85855); var getGlTypeFromFormat = __webpack_require__(74374); "use strict"; var topologyToGlMap = { "point-list": 0, "line-list": 1, "line-strip": 3, "triangle-list": 4, "triangle-strip": 5 }; var GlGeometrySystem = /*#__PURE__*/function () { /** @param renderer - The renderer this System works for. */ function GlGeometrySystem(renderer) { _classCallCheck(this, GlGeometrySystem); this._geometryVaoHash = /* @__PURE__ */Object.create(null); this._renderer = renderer; this._activeGeometry = null; this._activeVao = null; this.hasVao = true; this.hasInstance = true; this._renderer.renderableGC.addManagedHash(this, "_geometryVaoHash"); } /** Sets up the renderer context and necessary buffers. */ return _createClass(GlGeometrySystem, [{ key: "contextChange", value: function contextChange() { var gl = this.gl = this._renderer.gl; if (!this._renderer.context.supports.vertexArrayObject) { throw new Error("[PixiJS] Vertex Array Objects are not supported on this device"); } var nativeVaoExtension = this._renderer.context.extensions.vertexArrayObject; if (nativeVaoExtension) { gl.createVertexArray = function () { return nativeVaoExtension.createVertexArrayOES(); }; gl.bindVertexArray = function (vao) { return nativeVaoExtension.bindVertexArrayOES(vao); }; gl.deleteVertexArray = function (vao) { return nativeVaoExtension.deleteVertexArrayOES(vao); }; } var nativeInstancedExtension = this._renderer.context.extensions.vertexAttribDivisorANGLE; if (nativeInstancedExtension) { gl.drawArraysInstanced = function (a, b, c, d) { nativeInstancedExtension.drawArraysInstancedANGLE(a, b, c, d); }; gl.drawElementsInstanced = function (a, b, c, d, e) { nativeInstancedExtension.drawElementsInstancedANGLE(a, b, c, d, e); }; gl.vertexAttribDivisor = function (a, b) { return nativeInstancedExtension.vertexAttribDivisorANGLE(a, b); }; } this._activeGeometry = null; this._activeVao = null; this._geometryVaoHash = /* @__PURE__ */Object.create(null); } /** * Binds geometry so that is can be drawn. Creating a Vao if required * @param geometry - Instance of geometry to bind. * @param program - Instance of program to use vao for. */ }, { key: "bind", value: function bind(geometry, program) { var gl = this.gl; this._activeGeometry = geometry; var vao = this.getVao(geometry, program); if (this._activeVao !== vao) { this._activeVao = vao; gl.bindVertexArray(vao); } this.updateBuffers(); } /** Reset and unbind any active VAO and geometry. */ }, { key: "resetState", value: function resetState() { this.unbind(); } /** Update buffers of the currently bound geometry. */ }, { key: "updateBuffers", value: function updateBuffers() { var geometry = this._activeGeometry; var bufferSystem = this._renderer.buffer; for (var i = 0; i < geometry.buffers.length; i++) { var buffer = geometry.buffers[i]; bufferSystem.updateBuffer(buffer); } } /** * Check compatibility between a geometry and a program * @param geometry - Geometry instance. * @param program - Program instance. */ }, { key: "checkCompatibility", value: function checkCompatibility(geometry, program) { var geometryAttributes = geometry.attributes; var shaderAttributes = program._attributeData; for (var j in shaderAttributes) { if (!geometryAttributes[j]) { throw new Error("shader and geometry incompatible, geometry missing the \"".concat(j, "\" attribute")); } } } /** * Takes a geometry and program and generates a unique signature for them. * @param geometry - To get signature from. * @param program - To test geometry against. * @returns - Unique signature of the geometry and program */ }, { key: "getSignature", value: function getSignature(geometry, program) { var attribs = geometry.attributes; var shaderAttributes = program._attributeData; var strings = ["g", geometry.uid]; for (var i in attribs) { if (shaderAttributes[i]) { strings.push(i, shaderAttributes[i].location); } } return strings.join("-"); } }, { key: "getVao", value: function getVao(geometry, program) { var _this$_geometryVaoHas; return ((_this$_geometryVaoHas = this._geometryVaoHash[geometry.uid]) === null || _this$_geometryVaoHas === void 0 ? void 0 : _this$_geometryVaoHas[program._key]) || this.initGeometryVao(geometry, program); } /** * Creates or gets Vao with the same structure as the geometry and stores it on the geometry. * If vao is created, it is bound automatically. We use a shader to infer what and how to set up the * attribute locations. * @param geometry - Instance of geometry to to generate Vao for. * @param program * @param _incRefCount - Increment refCount of all geometry buffers. */ }, { key: "initGeometryVao", value: function initGeometryVao(geometry, program) { var _incRefCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var gl = this._renderer.gl; var bufferSystem = this._renderer.buffer; this._renderer.shader._getProgramData(program); this.checkCompatibility(geometry, program); var signature = this.getSignature(geometry, program); if (!this._geometryVaoHash[geometry.uid]) { this._geometryVaoHash[geometry.uid] = /* @__PURE__ */Object.create(null); geometry.on("destroy", this.onGeometryDestroy, this); } var vaoObjectHash = this._geometryVaoHash[geometry.uid]; var vao = vaoObjectHash[signature]; if (vao) { vaoObjectHash[program._key] = vao; return vao; } ensureAttributes.ensureAttributes(geometry, program._attributeData); var buffers = geometry.buffers; vao = gl.createVertexArray(); gl.bindVertexArray(vao); for (var i = 0; i < buffers.length; i++) { var buffer = buffers[i]; bufferSystem.bind(buffer); } this.activateVao(geometry, program); vaoObjectHash[program._key] = vao; vaoObjectHash[signature] = vao; gl.bindVertexArray(null); return vao; } /** * Disposes geometry. * @param geometry - Geometry with buffers. Only VAO will be disposed * @param [contextLost=false] - If context was lost, we suppress deleteVertexArray */ }, { key: "onGeometryDestroy", value: function onGeometryDestroy(geometry, contextLost) { var vaoObjectHash = this._geometryVaoHash[geometry.uid]; var gl = this.gl; if (vaoObjectHash) { if (contextLost) { for (var i in vaoObjectHash) { if (this._activeVao !== vaoObjectHash[i]) { this.unbind(); } gl.deleteVertexArray(vaoObjectHash[i]); } } this._geometryVaoHash[geometry.uid] = null; } } /** * Dispose all WebGL resources of all managed geometries. * @param [contextLost=false] - If context was lost, we suppress `gl.delete` calls */ }, { key: "destroyAll", value: function destroyAll() { var contextLost = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var gl = this.gl; for (var i in this._geometryVaoHash) { if (contextLost) { for (var j in this._geometryVaoHash[i]) { var vaoObjectHash = this._geometryVaoHash[i]; if (this._activeVao !== vaoObjectHash) { this.unbind(); } gl.deleteVertexArray(vaoObjectHash[j]); } } this._geometryVaoHash[i] = null; } } /** * Activate vertex array object. * @param geometry - Geometry instance. * @param program - Shader program instance. */ }, { key: "activateVao", value: function activateVao(geometry, program) { var gl = this._renderer.gl; var bufferSystem = this._renderer.buffer; var attributes = geometry.attributes; if (geometry.indexBuffer) { bufferSystem.bind(geometry.indexBuffer); } var lastBuffer = null; for (var j in attributes) { var attribute = attributes[j]; var buffer = attribute.buffer; var glBuffer = bufferSystem.getGlBuffer(buffer); var programAttrib = program._attributeData[j]; if (programAttrib) { var _programAttrib$format; if (lastBuffer !== glBuffer) { bufferSystem.bind(buffer); lastBuffer = glBuffer; } var location = programAttrib.location; gl.enableVertexAttribArray(location); var attributeInfo = getAttributeInfoFromFormat.getAttributeInfoFromFormat(attribute.format); var type = getGlTypeFromFormat.getGlTypeFromFormat(attribute.format); if (((_programAttrib$format = programAttrib.format) === null || _programAttrib$format === void 0 ? void 0 : _programAttrib$format.substring(1, 4)) === "int") { gl.vertexAttribIPointer(location, attributeInfo.size, type, attribute.stride, attribute.offset); } else { gl.vertexAttribPointer(location, attributeInfo.size, type, attributeInfo.normalised, attribute.stride, attribute.offset); } if (attribute.instance) { if (this.hasInstance) { var _attribute$divisor; var divisor = (_attribute$divisor = attribute.divisor) !== null && _attribute$divisor !== void 0 ? _attribute$divisor : 1; gl.vertexAttribDivisor(location, divisor); } else { throw new Error("geometry error, GPU Instancing is not supported on this device"); } } } } } /** * Draws the currently bound geometry. * @param topology - The type primitive to render. * @param size - The number of elements to be rendered. If not specified, all vertices after the * starting vertex will be drawn. * @param start - The starting vertex in the geometry to start drawing from. If not specified, * drawing will start from the first vertex. * @param instanceCount - The number of instances of the set of elements to execute. If not specified, * all instances will be drawn. */ }, { key: "draw", value: function draw(topology, size, start, instanceCount) { var gl = this._renderer.gl; var geometry = this._activeGeometry; var glTopology = topologyToGlMap[topology || geometry.topology]; instanceCount !== null && instanceCount !== void 0 ? instanceCount : instanceCount = geometry.instanceCount; if (geometry.indexBuffer) { var byteSize = geometry.indexBuffer.data.BYTES_PER_ELEMENT; var glType = byteSize === 2 ? gl.UNSIGNED_SHORT : gl.UNSIGNED_INT; if (instanceCount > 1) { gl.drawElementsInstanced(glTopology, size || geometry.indexBuffer.data.length, glType, (start || 0) * byteSize, instanceCount); } else { gl.drawElements(glTopology, size || geometry.indexBuffer.data.length, glType, (start || 0) * byteSize); } } else if (instanceCount > 1) { gl.drawArraysInstanced(glTopology, start || 0, size || geometry.getSize(), instanceCount); } else { gl.drawArrays(glTopology, start || 0, size || geometry.getSize()); } return this; } /** Unbind/reset everything. */ }, { key: "unbind", value: function unbind() { this.gl.bindVertexArray(null); this._activeVao = null; this._activeGeometry = null; } }, { key: "destroy", value: function destroy() { this._renderer = null; this.gl = null; this._activeVao = null; this._activeGeometry = null; } }]); }(); /** @ignore */ GlGeometrySystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "geometry" }; exports.GlGeometrySystem = GlGeometrySystem; /***/ }), /***/ 85855: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var warn = __webpack_require__(57371); var getAttributeInfoFromFormat = __webpack_require__(63421); "use strict"; function ensureAttributes(geometry, extractedData) { for (var i in geometry.attributes) { var attribute = geometry.attributes[i]; var attributeData = extractedData[i]; if (attributeData) { var _attribute$format, _attribute$offset, _attribute$instance; (_attribute$format = attribute.format) !== null && _attribute$format !== void 0 ? _attribute$format : attribute.format = attributeData.format; (_attribute$offset = attribute.offset) !== null && _attribute$offset !== void 0 ? _attribute$offset : attribute.offset = attributeData.offset; (_attribute$instance = attribute.instance) !== null && _attribute$instance !== void 0 ? _attribute$instance : attribute.instance = attributeData.instance; } else { warn.warn("Attribute ".concat(i, " is not present in the shader, but is present in the geometry. Unable to infer attribute details.")); } } ensureStartAndStride(geometry); } function ensureStartAndStride(geometry) { var buffers = geometry.buffers, attributes = geometry.attributes; var tempStride = {}; var tempStart = {}; for (var j in buffers) { var buffer = buffers[j]; tempStride[buffer.uid] = 0; tempStart[buffer.uid] = 0; } for (var _j in attributes) { var attribute = attributes[_j]; tempStride[attribute.buffer.uid] += getAttributeInfoFromFormat.getAttributeInfoFromFormat(attribute.format).stride; } for (var _j2 in attributes) { var _attribute$stride, _attribute$start; var _attribute = attributes[_j2]; (_attribute$stride = _attribute.stride) !== null && _attribute$stride !== void 0 ? _attribute$stride : _attribute.stride = tempStride[_attribute.buffer.uid]; (_attribute$start = _attribute.start) !== null && _attribute$start !== void 0 ? _attribute$start : _attribute.start = tempStart[_attribute.buffer.uid]; tempStart[_attribute.buffer.uid] += getAttributeInfoFromFormat.getAttributeInfoFromFormat(_attribute.format).stride; } } exports.ensureAttributes = ensureAttributes; /***/ }), /***/ 85898: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var warn = __webpack_require__(57371); var path = __webpack_require__(30710); var convertToList = __webpack_require__(28097); var isSingleItem = __webpack_require__(91208); "use strict"; var Loader = /*#__PURE__*/function () { function Loader() { var _this = this; _classCallCheck(this, Loader); this._parsers = []; this._parsersValidated = false; /** * All loader parsers registered * @type {assets.LoaderParser[]} */ this.parsers = new Proxy(this._parsers, { set: function set(target, key, value) { _this._parsersValidated = false; target[key] = value; return true; } }); /** Cache loading promises that ae currently active */ this.promiseCache = {}; } /** function used for testing */ return _createClass(Loader, [{ key: "reset", value: function reset() { this._parsersValidated = false; this.promiseCache = {}; } /** * Used internally to generate a promise for the asset to be loaded. * @param url - The URL to be loaded * @param data - any custom additional information relevant to the asset being loaded * @returns - a promise that will resolve to an Asset for example a Texture of a JSON object */ }, { key: "_getLoadPromiseAndParser", value: function _getLoadPromiseAndParser(url, data) { var _this2 = this; var result = { promise: null, parser: null }; result.promise = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var asset, parser, i, _parserX$test, parserX, _i, parser2, _parser2$testParse, _t, _t2; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: asset = null; parser = null; if (data.loadParser) { parser = _this2._parserHash[data.loadParser]; if (!parser) { warn.warn("[Assets] specified load parser \"".concat(data.loadParser, "\" not found while loading ").concat(url)); } } if (parser) { _context.n = 4; break; } i = 0; case 1: if (!(i < _this2.parsers.length)) { _context.n = 3; break; } parserX = _this2.parsers[i]; if (!(parserX.load && (_parserX$test = parserX.test) !== null && _parserX$test !== void 0 && _parserX$test.call(parserX, url, data, _this2))) { _context.n = 2; break; } parser = parserX; return _context.a(3, 3); case 2: i++; _context.n = 1; break; case 3: if (parser) { _context.n = 4; break; } warn.warn("[Assets] ".concat(url, " could not be loaded as we don't know how to parse it, ensure the correct parser has been added")); return _context.a(2, null); case 4: _context.n = 5; return parser.load(url, data, _this2); case 5: asset = _context.v; result.parser = parser; _i = 0; case 6: if (!(_i < _this2.parsers.length)) { _context.n = 12; break; } parser2 = _this2.parsers[_i]; if (!parser2.parse) { _context.n = 11; break; } _t = parser2.parse; if (!_t) { _context.n = 8; break; } _context.n = 7; return (_parser2$testParse = parser2.testParse) === null || _parser2$testParse === void 0 ? void 0 : _parser2$testParse.call(parser2, asset, data, _this2); case 7: _t = _context.v; case 8: if (!_t) { _context.n = 11; break; } _context.n = 9; return parser2.parse(asset, data, _this2); case 9: _t2 = _context.v; if (_t2) { _context.n = 10; break; } _t2 = asset; case 10: asset = _t2; result.parser = parser2; case 11: _i++; _context.n = 6; break; case 12: return _context.a(2, asset); } }, _callee); }))(); return result; } }, { key: "load", value: function () { var _load = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(assetsToLoadIn, onProgress) { var _this3 = this; var count, assets, singleAsset, assetsToLoad, total, promises; return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: if (!this._parsersValidated) { this._validateParsers(); } count = 0; assets = {}; singleAsset = isSingleItem.isSingleItem(assetsToLoadIn); assetsToLoad = convertToList.convertToList(assetsToLoadIn, function (item) { return { alias: [item], src: item, data: {} }; }); total = assetsToLoad.length; promises = assetsToLoad.map(/*#__PURE__*/function () { var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(asset) { var url, _t3; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: url = path.path.toAbsolute(asset.src); if (assets[asset.src]) { _context2.n = 4; break; } _context2.p = 1; if (!_this3.promiseCache[url]) { _this3.promiseCache[url] = _this3._getLoadPromiseAndParser(url, asset); } _context2.n = 2; return _this3.promiseCache[url].promise; case 2: assets[asset.src] = _context2.v; if (onProgress) onProgress(++count / total); _context2.n = 4; break; case 3: _context2.p = 3; _t3 = _context2.v; delete _this3.promiseCache[url]; delete assets[asset.src]; throw new Error("[Loader.load] Failed to load ".concat(url, ".\n").concat(_t3)); case 4: return _context2.a(2); } }, _callee2, null, [[1, 3]]); })); return function (_x3) { return _ref2.apply(this, arguments); }; }()); _context3.n = 1; return Promise.all(promises); case 1: return _context3.a(2, singleAsset ? assets[assetsToLoad[0].src] : assets); } }, _callee3, this); })); function load(_x, _x2) { return _load.apply(this, arguments); } return load; }() /** * Unloads one or more assets. Any unloaded assets will be destroyed, freeing up memory for your app. * The parser that created the asset, will be the one that unloads it. * @example * // Single asset: * const asset = await Loader.load('cool.png'); * * await Loader.unload('cool.png'); * * console.log(asset.destroyed); // true * @param assetsToUnloadIn - urls that you want to unload, or a single one! */ }, { key: "unload", value: (function () { var _unload = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(assetsToUnloadIn) { var _this4 = this; var assetsToUnload, promises; return _regenerator().w(function (_context5) { while (1) switch (_context5.n) { case 0: assetsToUnload = convertToList.convertToList(assetsToUnloadIn, function (item) { return { alias: [item], src: item }; }); promises = assetsToUnload.map(/*#__PURE__*/function () { var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(asset) { var url, loadPromise, _loadPromise$parser, _loadPromise$parser$u, loadedAsset; return _regenerator().w(function (_context4) { while (1) switch (_context4.n) { case 0: url = path.path.toAbsolute(asset.src); loadPromise = _this4.promiseCache[url]; if (!loadPromise) { _context4.n = 2; break; } _context4.n = 1; return loadPromise.promise; case 1: loadedAsset = _context4.v; delete _this4.promiseCache[url]; _context4.n = 2; return (_loadPromise$parser = loadPromise.parser) === null || _loadPromise$parser === void 0 || (_loadPromise$parser$u = _loadPromise$parser.unload) === null || _loadPromise$parser$u === void 0 ? void 0 : _loadPromise$parser$u.call(_loadPromise$parser, loadedAsset, asset, _this4); case 2: return _context4.a(2); } }, _callee4); })); return function (_x5) { return _ref3.apply(this, arguments); }; }()); _context5.n = 1; return Promise.all(promises); case 1: return _context5.a(2); } }, _callee5); })); function unload(_x4) { return _unload.apply(this, arguments); } return unload; }() /** validates our parsers, right now it only checks for name conflicts but we can add more here as required! */) }, { key: "_validateParsers", value: function _validateParsers() { this._parsersValidated = true; this._parserHash = this._parsers.filter(function (parser) { return parser.name; }).reduce(function (hash, parser) { if (!parser.name) { warn.warn("[Assets] loadParser should have a name"); } else if (hash[parser.name]) { warn.warn("[Assets] loadParser name conflict \"".concat(parser.name, "\"")); } return _objectSpread(_objectSpread({}, hash), {}, _defineProperty({}, parser.name, parser)); }, {}); } }]); }(); exports.Loader = Loader; /***/ }), /***/ 85973: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var mSDFBit = { name: "msdf-bit", fragment: { header: /* wgsl */"\n fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {\n \n // MSDF\n var median = msdfColor.r + msdfColor.g + msdfColor.b -\n min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -\n max(msdfColor.r, max(msdfColor.g, msdfColor.b));\n \n // SDF\n median = min(median, msdfColor.a);\n\n var screenPxDistance = distance * (median - 0.5);\n var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\n if (median < 0.01) {\n alpha = 0.0;\n } else if (median > 0.99) {\n alpha = 1.0;\n }\n\n // Gamma correction for coverage-like alpha\n var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));\n var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);\n var coverage: f32 = pow(shapeColor.a * alpha, gamma);\n\n return coverage;\n \n }\n " } }; var mSDFBitGl = { name: "msdf-bit", fragment: { header: /* glsl */"\n float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {\n \n // MSDF\n float median = msdfColor.r + msdfColor.g + msdfColor.b -\n min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -\n max(msdfColor.r, max(msdfColor.g, msdfColor.b));\n \n // SDF\n median = min(median, msdfColor.a);\n \n float screenPxDistance = distance * (median - 0.5);\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\n \n if (median < 0.01) {\n alpha = 0.0;\n } else if (median > 0.99) {\n alpha = 1.0;\n }\n\n // Gamma correction for coverage-like alpha\n float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));\n float gamma = mix(1.0, 1.0 / 2.2, luma);\n float coverage = pow(shapeColor.a * alpha, gamma); \n \n return coverage;\n }\n " } }; exports.mSDFBit = mSDFBit; exports.mSDFBitGl = mSDFBitGl; /***/ }), /***/ 86109: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _default = exports["default"] = { CANVAS: "canvas", FOREGROUND: "foreground", BACKGROUND: "background", PIXI: "pixi", ASSET_MANAGER: "asset_manager" }; /***/ }), /***/ 86325: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; __webpack_require__(23009); __webpack_require__(12980); __webpack_require__(28464); __webpack_require__(30496); __webpack_require__(95236); __webpack_require__(60595); __webpack_require__(67478); __webpack_require__(71514); __webpack_require__(48084); __webpack_require__(70784); __webpack_require__(87528); __webpack_require__(51305); "use strict"; /***/ }), /***/ 86512: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Matrix = __webpack_require__(20764); var Bounds = __webpack_require__(76631); var matrixAndBoundsPool = __webpack_require__(22727); "use strict"; var tempMatrix = new Matrix.Matrix(); var getFastGlobalBoundsMixin = { /** * Computes the global bounds for the container, considering its children and optionally * factoring in render layers. It starts by clearing the provided bounds object, then * recursively calculates the bounds, and finally applies the world transformation. * @param {boolean} [factorRenderLayers] - Whether to consider render layers in the calculation. * @param {Bounds} [bounds] - The bounds object to store the result. If not provided, a new one is created. * @returns {Bounds} The computed bounds. * @memberof scene.Container# */ getFastGlobalBounds: function getFastGlobalBounds(factorRenderLayers, bounds) { bounds || (bounds = new Bounds.Bounds()); bounds.clear(); this._getGlobalBoundsRecursive(!!factorRenderLayers, bounds, this.parentRenderLayer); if (!bounds.isValid) { bounds.set(0, 0, 0, 0); } var renderGroup = this.renderGroup || this.parentRenderGroup; bounds.applyMatrix(renderGroup.worldTransform); return bounds; }, /** * Recursively calculates the global bounds for the container and its children. * It considers visibility, measurability, and effects, and applies transformations * as necessary to compute the bounds accurately. * @param {boolean} factorRenderLayers - Whether to consider render layers in the calculation. * @param {Bounds} bounds - The bounds object to update with the calculated values. * @param {IRenderLayer} currentLayer - The current render layer being processed. * @memberof scene.Container# */ _getGlobalBoundsRecursive: function _getGlobalBoundsRecursive(factorRenderLayers, bounds, currentLayer) { var localBounds = bounds; if (factorRenderLayers && this.parentRenderLayer && this.parentRenderLayer !== currentLayer) return; if (this.localDisplayStatus !== 7 || !this.measurable) { return; } var manageEffects = !!this.effects.length; if (this.renderGroup || manageEffects) { localBounds = matrixAndBoundsPool.boundsPool.get().clear(); } if (this.boundsArea) { bounds.addRect(this.boundsArea, this.worldTransform); } else { if (this.renderPipeId) { var viewBounds = this.bounds; localBounds.addFrame(viewBounds.minX, viewBounds.minY, viewBounds.maxX, viewBounds.maxY, this.groupTransform); } var children = this.children; for (var i = 0; i < children.length; i++) { children[i]._getGlobalBoundsRecursive(factorRenderLayers, localBounds, currentLayer); } } if (manageEffects) { var advanced = false; var renderGroup = this.renderGroup || this.parentRenderGroup; for (var _i = 0; _i < this.effects.length; _i++) { if (this.effects[_i].addBounds) { if (!advanced) { advanced = true; localBounds.applyMatrix(renderGroup.worldTransform); } this.effects[_i].addBounds(localBounds, true); } } if (advanced) { localBounds.applyMatrix(renderGroup.worldTransform.copyTo(tempMatrix).invert()); bounds.addBounds(localBounds, this.relativeGroupTransform); } bounds.addBounds(localBounds); matrixAndBoundsPool.boundsPool["return"](localBounds); } else if (this.renderGroup) { bounds.addBounds(localBounds, this.relativeGroupTransform); matrixAndBoundsPool.boundsPool["return"](localBounds); } } }; exports.getFastGlobalBoundsMixin = getFastGlobalBoundsMixin; /***/ }), /***/ 86621: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes. * * Works with anything that has a `length` property and index access properties, including NodeList. * * @template {unknown} T * @param {Array<T> | ({length:number, [number]: T})} list * @param {function (item: T, index: number, list:Array<T> | ({length:number, [number]: T})):boolean} predicate * @param {Partial<Pick<ArrayConstructor['prototype'], 'find'>>?} ac `Array.prototype` by default, * allows injecting a custom implementation in tests * @returns {T | undefined} * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find */ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function find(list, predicate, ac) { if (ac === undefined) { ac = Array.prototype; } if (list && typeof ac.find === 'function') { return ac.find.call(list, predicate); } for (var i = 0; i < list.length; i++) { if (Object.prototype.hasOwnProperty.call(list, i)) { var item = list[i]; if (predicate.call(undefined, item, i, list)) { return item; } } } } /** * "Shallow freezes" an object to render it immutable. * Uses `Object.freeze` if available, * otherwise the immutability is only in the type. * * Is used to create "enum like" objects. * * @template T * @param {T} object the object to freeze * @param {Pick<ObjectConstructor, 'freeze'> = Object} oc `Object` by default, * allows to inject custom object constructor for tests * @returns {Readonly<T>} * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze */ function freeze(object, oc) { if (oc === undefined) { oc = Object; } return oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object; } /** * Since we can not rely on `Object.assign` we provide a simplified version * that is sufficient for our needs. * * @param {Object} target * @param {Object | null | undefined} source * * @returns {Object} target * @throws TypeError if target is not an object * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign */ function assign(target, source) { if (target === null || _typeof(target) !== 'object') { throw new TypeError('target is not an object'); } for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } return target; } /** * All mime types that are allowed as input to `DOMParser.parseFromString` * * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec * @see DOMParser.prototype.parseFromString */ var MIME_TYPE = freeze({ /** * `text/html`, the only mime type that triggers treating an XML document as HTML. * * @see DOMParser.SupportedType.isHTML * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration * @see https://en.wikipedia.org/wiki/HTML Wikipedia * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec */ HTML: 'text/html', /** * Helper method to check a mime type if it indicates an HTML document * * @param {string} [value] * @returns {boolean} * * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration * @see https://en.wikipedia.org/wiki/HTML Wikipedia * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring */ isHTML: function isHTML(value) { return value === MIME_TYPE.HTML; }, /** * `application/xml`, the standard mime type for XML documents. * * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303 * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia */ XML_APPLICATION: 'application/xml', /** * `text/html`, an alias for `application/xml`. * * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303 * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia */ XML_TEXT: 'text/xml', /** * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace, * but is parsed as an XML document. * * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec * @see https://en.wikipedia.org/wiki/XHTML Wikipedia */ XML_XHTML_APPLICATION: 'application/xhtml+xml', /** * `image/svg+xml`, * * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1 * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia */ XML_SVG_IMAGE: 'image/svg+xml' }); /** * Namespaces that are used in this code base. * * @see http://www.w3.org/TR/REC-xml-names */ var NAMESPACE = freeze({ /** * The XHTML namespace. * * @see http://www.w3.org/1999/xhtml */ HTML: 'http://www.w3.org/1999/xhtml', /** * Checks if `uri` equals `NAMESPACE.HTML`. * * @param {string} [uri] * * @see NAMESPACE.HTML */ isHTML: function isHTML(uri) { return uri === NAMESPACE.HTML; }, /** * The SVG namespace. * * @see http://www.w3.org/2000/svg */ SVG: 'http://www.w3.org/2000/svg', /** * The `xml:` namespace. * * @see http://www.w3.org/XML/1998/namespace */ XML: 'http://www.w3.org/XML/1998/namespace', /** * The `xmlns:` namespace * * @see https://www.w3.org/2000/xmlns/ */ XMLNS: 'http://www.w3.org/2000/xmlns/' }); exports.assign = assign; exports.find = find; exports.freeze = freeze; exports.MIME_TYPE = MIME_TYPE; exports.NAMESPACE = NAMESPACE; /***/ }), /***/ 86754: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var WGSL_TO_STD40_SIZE = { f32: 4, i32: 4, "vec2<f32>": 8, "vec3<f32>": 12, "vec4<f32>": 16, "vec2<i32>": 8, "vec3<i32>": 12, "vec4<i32>": 16, "mat2x2<f32>": 16 * 2, "mat3x3<f32>": 16 * 3, "mat4x4<f32>": 16 * 4 // TODO - not essential for now but support these in the future // int: 4, // ivec2: 8, // ivec3: 12, // ivec4: 16, // uint: 4, // uvec2: 8, // uvec3: 12, // uvec4: 16, // bool: 4, // bvec2: 8, // bvec3: 12, // bvec4: 16, // mat2: 16 * 2, // mat3: 16 * 3, // mat4: 16 * 4, }; function createUboElementsSTD40(uniformData) { var uboElements = uniformData.map(function (data) { return { data: data, offset: 0, size: 0 }; }); var chunkSize = 16; var size = 0; var offset = 0; for (var i = 0; i < uboElements.length; i++) { var uboElement = uboElements[i]; size = WGSL_TO_STD40_SIZE[uboElement.data.type]; if (!size) { throw new Error("Unknown type ".concat(uboElement.data.type)); } if (uboElement.data.size > 1) { size = Math.max(size, chunkSize) * uboElement.data.size; } var boundary = size === 12 ? 16 : size; uboElement.size = size; var curOffset = offset % chunkSize; if (curOffset > 0 && chunkSize - curOffset < boundary) { offset += (chunkSize - curOffset) % 16; } else { offset += (size - curOffset % size) % size; } uboElement.offset = offset; offset += size; } offset = Math.ceil(offset / 16) * 16; return { uboElements: uboElements, size: offset }; } exports.WGSL_TO_STD40_SIZE = WGSL_TO_STD40_SIZE; exports.createUboElementsSTD40 = createUboElementsSTD40; /***/ }), /***/ 86890: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var ExtensionType = /* @__PURE__ */function (ExtensionType2) { ExtensionType2["Application"] = "application"; ExtensionType2["WebGLPipes"] = "webgl-pipes"; ExtensionType2["WebGLPipesAdaptor"] = "webgl-pipes-adaptor"; ExtensionType2["WebGLSystem"] = "webgl-system"; ExtensionType2["WebGPUPipes"] = "webgpu-pipes"; ExtensionType2["WebGPUPipesAdaptor"] = "webgpu-pipes-adaptor"; ExtensionType2["WebGPUSystem"] = "webgpu-system"; ExtensionType2["CanvasSystem"] = "canvas-system"; ExtensionType2["CanvasPipesAdaptor"] = "canvas-pipes-adaptor"; ExtensionType2["CanvasPipes"] = "canvas-pipes"; ExtensionType2["Asset"] = "asset"; ExtensionType2["LoadParser"] = "load-parser"; ExtensionType2["ResolveParser"] = "resolve-parser"; ExtensionType2["CacheParser"] = "cache-parser"; ExtensionType2["DetectionParser"] = "detection-parser"; ExtensionType2["MaskEffect"] = "mask-effect"; ExtensionType2["BlendMode"] = "blend-mode"; ExtensionType2["TextureSource"] = "texture-source"; ExtensionType2["Environment"] = "environment"; ExtensionType2["ShapeBuilder"] = "shape-builder"; ExtensionType2["Batcher"] = "batcher"; return ExtensionType2; }(ExtensionType || {}); var normalizeExtension = function normalizeExtension(ext) { if (typeof ext === "function" || _typeof(ext) === "object" && ext.extension) { if (!ext.extension) { throw new Error("Extension class must have an extension object"); } var metadata = _typeof(ext.extension) !== "object" ? { type: ext.extension } : ext.extension; ext = _objectSpread(_objectSpread({}, metadata), {}, { ref: ext }); } if (_typeof(ext) === "object") { ext = _objectSpread({}, ext); } else { throw new Error("Invalid extension type"); } if (typeof ext.type === "string") { ext.type = [ext.type]; } return ext; }; var normalizeExtensionPriority = function normalizeExtensionPriority(ext, defaultPriority) { var _normalizeExtension$p; return (_normalizeExtension$p = normalizeExtension(ext).priority) !== null && _normalizeExtension$p !== void 0 ? _normalizeExtension$p : defaultPriority; }; var extensions = { /** @ignore */ _addHandlers: {}, /** @ignore */ _removeHandlers: {}, /** @ignore */ _queue: {}, /** * Remove extensions from PixiJS. * @param extensions - Extensions to be removed. * @returns {extensions} For chaining. */ remove: function remove() { var _this = this; for (var _len = arguments.length, extensions2 = new Array(_len), _key = 0; _key < _len; _key++) { extensions2[_key] = arguments[_key]; } extensions2.map(normalizeExtension).forEach(function (ext) { ext.type.forEach(function (type) { var _this$_removeHandlers, _this$_removeHandlers2; return (_this$_removeHandlers = (_this$_removeHandlers2 = _this._removeHandlers)[type]) === null || _this$_removeHandlers === void 0 ? void 0 : _this$_removeHandlers.call(_this$_removeHandlers2, ext); }); }); return this; }, /** * Register new extensions with PixiJS. * @param extensions - The spread of extensions to add to PixiJS. * @returns {extensions} For chaining. */ add: function add() { var _this2 = this; for (var _len2 = arguments.length, extensions2 = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { extensions2[_key2] = arguments[_key2]; } extensions2.map(normalizeExtension).forEach(function (ext) { ext.type.forEach(function (type) { var handlers = _this2._addHandlers; var queue = _this2._queue; if (!handlers[type]) { var _queue$type; queue[type] = queue[type] || []; (_queue$type = queue[type]) === null || _queue$type === void 0 || _queue$type.push(ext); } else { var _handlers$type; (_handlers$type = handlers[type]) === null || _handlers$type === void 0 || _handlers$type.call(handlers, ext); } }); }); return this; }, /** * Internal method to handle extensions by name. * @param type - The extension type. * @param onAdd - Function handler when extensions are added/registered {@link StrictExtensionFormat}. * @param onRemove - Function handler when extensions are removed/unregistered {@link StrictExtensionFormat}. * @returns {extensions} For chaining. */ handle: function handle(type, onAdd, onRemove) { var addHandlers = this._addHandlers; var removeHandlers = this._removeHandlers; if (addHandlers[type] || removeHandlers[type]) { throw new Error("Extension type ".concat(type, " already has a handler")); } addHandlers[type] = onAdd; removeHandlers[type] = onRemove; var queue = this._queue; if (queue[type]) { var _queue$type2; (_queue$type2 = queue[type]) === null || _queue$type2 === void 0 || _queue$type2.forEach(function (ext) { return onAdd(ext); }); delete queue[type]; } return this; }, /** * Handle a type, but using a map by `name` property. * @param type - Type of extension to handle. * @param map - The object map of named extensions. * @returns {extensions} For chaining. */ handleByMap: function handleByMap(type, map) { return this.handle(type, function (extension) { if (extension.name) { map[extension.name] = extension.ref; } }, function (extension) { if (extension.name) { delete map[extension.name]; } }); }, /** * Handle a type, but using a list of extensions with a `name` property. * @param type - Type of extension to handle. * @param map - The array of named extensions. * @param defaultPriority - Fallback priority if none is defined. * @returns {extensions} For chaining. */ handleByNamedList: function handleByNamedList(type, map) { var defaultPriority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; return this.handle(type, function (extension) { var index = map.findIndex(function (item) { return item.name === extension.name; }); if (index >= 0) return; map.push({ name: extension.name, value: extension.ref }); map.sort(function (a, b) { return normalizeExtensionPriority(b.value, defaultPriority) - normalizeExtensionPriority(a.value, defaultPriority); }); }, function (extension) { var index = map.findIndex(function (item) { return item.name === extension.name; }); if (index !== -1) { map.splice(index, 1); } }); }, /** * Handle a type, but using a list of extensions. * @param type - Type of extension to handle. * @param list - The list of extensions. * @param defaultPriority - The default priority to use if none is specified. * @returns {extensions} For chaining. */ handleByList: function handleByList(type, list) { var defaultPriority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; return this.handle(type, function (extension) { if (list.includes(extension.ref)) { return; } list.push(extension.ref); list.sort(function (a, b) { return normalizeExtensionPriority(b, defaultPriority) - normalizeExtensionPriority(a, defaultPriority); }); }, function (extension) { var index = list.indexOf(extension.ref); if (index !== -1) { list.splice(index, 1); } }); }, /** * Mixin the source object into the target object. * @param Target - The target object to mix into. * @param sources - The source(s) object to mix from */ mixin: function mixin(Target) { for (var _len3 = arguments.length, sources = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { sources[_key3 - 1] = arguments[_key3]; } for (var _i = 0, _sources = sources; _i < _sources.length; _i++) { var source = _sources[_i]; Object.defineProperties(Target.prototype, Object.getOwnPropertyDescriptors(source)); } } }; exports.ExtensionType = ExtensionType; exports.extensions = extensions; exports.normalizeExtensionPriority = normalizeExtensionPriority; /***/ }), /***/ 87115: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var LoaderParser = __webpack_require__(96804); var copySearchParams = __webpack_require__(16508); var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var path = __webpack_require__(30710); var BitmapFont = __webpack_require__(79826); var bitmapFontTextParser = __webpack_require__(89907); var bitmapFontXMLStringParser = __webpack_require__(70868); "use strict"; var validExtensions = [".xml", ".fnt"]; var bitmapFontCachePlugin = { extension: { type: Extensions.ExtensionType.CacheParser, name: "cacheBitmapFont" }, test: function test(asset) { return asset instanceof BitmapFont.BitmapFont; }, getCacheableAssets: function getCacheableAssets(keys, asset) { var out = {}; keys.forEach(function (key) { out[key] = asset; out["".concat(key, "-bitmap")] = asset; }); out["".concat(asset.fontFamily, "-bitmap")] = asset; return out; } }; var loadBitmapFont = { extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.Normal }, name: "loadBitmapFont", test: function test(url) { return validExtensions.includes(path.path.extname(url).toLowerCase()); }, testParse: function testParse(data) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: return _context.a(2, bitmapFontTextParser.bitmapFontTextParser.test(data) || bitmapFontXMLStringParser.bitmapFontXMLStringParser.test(data)); } }, _callee); }))(); }, parse: function parse(asset, data, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() { var bitmapFontData, src, pages, textureUrls, textureOptions, i, pageFile, imagePath, loadedTextures, textures, bitmapFont; return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: bitmapFontData = bitmapFontTextParser.bitmapFontTextParser.test(asset) ? bitmapFontTextParser.bitmapFontTextParser.parse(asset) : bitmapFontXMLStringParser.bitmapFontXMLStringParser.parse(asset); src = data.src; pages = bitmapFontData.pages; textureUrls = []; textureOptions = bitmapFontData.distanceField ? { scaleMode: "linear", alphaMode: "premultiply-alpha-on-upload", autoGenerateMipmaps: false, resolution: 1 } : {}; for (i = 0; i < pages.length; ++i) { pageFile = pages[i].file; imagePath = path.path.join(path.path.dirname(src), pageFile); imagePath = copySearchParams.copySearchParams(imagePath, src); textureUrls.push({ src: imagePath, data: textureOptions }); } _context2.n = 1; return loader.load(textureUrls); case 1: loadedTextures = _context2.v; textures = textureUrls.map(function (url) { return loadedTextures[url.src]; }); bitmapFont = new BitmapFont.BitmapFont({ data: bitmapFontData, textures: textures }, src); return _context2.a(2, bitmapFont); } }, _callee2); }))(); }, load: function load(url, _options) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() { var response; return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: _context3.n = 1; return adapter.DOMAdapter.get().fetch(url); case 1: response = _context3.v; _context3.n = 2; return response.text(); case 2: return _context3.a(2, _context3.v); } }, _callee3); }))(); }, unload: function unload(bitmapFont, _resolvedAsset, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() { return _regenerator().w(function (_context4) { while (1) switch (_context4.n) { case 0: _context4.n = 1; return Promise.all(bitmapFont.pages.map(function (page) { return loader.unload(page.texture.source._sourceOrigin); })); case 1: bitmapFont.destroy(); case 2: return _context4.a(2); } }, _callee4); }))(); } }; exports.bitmapFontCachePlugin = bitmapFontCachePlugin; exports.loadBitmapFont = loadBitmapFont; /***/ }), /***/ 87328: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var detectBasis = __webpack_require__(15698); var loadBasis = __webpack_require__(83123); __webpack_require__(34924); var createLevelBuffers = __webpack_require__(88842); var gpuFormatToBasisTranscoderFormat = __webpack_require__(73893); var setBasisTranscoderPath = __webpack_require__(9773); var loadBasisOnWorker = __webpack_require__(23237); var _const = __webpack_require__(43021); var loadDDS = __webpack_require__(39779); var parseDDS = __webpack_require__(14432); var loadKTX = __webpack_require__(79259); var parseKTX = __webpack_require__(3200); var _const$1 = __webpack_require__(57519); var loadKTX2 = __webpack_require__(94363); __webpack_require__(4833); var convertFormatIfRequired = __webpack_require__(16680); var createLevelBuffersFromKTX = __webpack_require__(41960); var getTextureFormatFromKTXTexture = __webpack_require__(87440); var glFormatToGPUFormat = __webpack_require__(59520); var gpuFormatToKTXBasisTranscoderFormat = __webpack_require__(44383); var setKTXTranscoderPath = __webpack_require__(74977); var vkFormatToGPUFormat = __webpack_require__(20780); var loadKTX2onWorker = __webpack_require__(29977); var detectCompressed = __webpack_require__(46492); var resolveCompressedTextureUrl = __webpack_require__(73169); "use strict"; exports.detectBasis = detectBasis.detectBasis; exports.loadBasis = loadBasis.loadBasis; exports.createLevelBuffers = createLevelBuffers.createLevelBuffers; exports.gpuFormatToBasisTranscoderFormat = gpuFormatToBasisTranscoderFormat.gpuFormatToBasisTranscoderFormat; exports.basisTranscoderUrls = setBasisTranscoderPath.basisTranscoderUrls; exports.setBasisTranscoderPath = setBasisTranscoderPath.setBasisTranscoderPath; exports.loadBasisOnWorker = loadBasisOnWorker.loadBasisOnWorker; exports.D3D10_RESOURCE_DIMENSION = _const.D3D10_RESOURCE_DIMENSION; exports.D3DFMT = _const.D3DFMT; exports.DDS = _const.DDS; exports.DXGI_FORMAT = _const.DXGI_FORMAT; exports.DXGI_TO_TEXTURE_FORMAT = _const.DXGI_TO_TEXTURE_FORMAT; exports.FOURCC_TO_TEXTURE_FORMAT = _const.FOURCC_TO_TEXTURE_FORMAT; exports.TEXTURE_FORMAT_BLOCK_SIZE = _const.TEXTURE_FORMAT_BLOCK_SIZE; exports.loadDDS = loadDDS.loadDDS; exports.parseDDS = parseDDS.parseDDS; exports.loadKTX = loadKTX.loadKTX; exports.parseKTX = parseKTX.parseKTX; exports.GL_INTERNAL_FORMAT = _const$1.GL_INTERNAL_FORMAT; exports.KTX = _const$1.KTX; exports.loadKTX2 = loadKTX2.loadKTX2; exports.convertFormatIfRequired = convertFormatIfRequired.convertFormatIfRequired; exports.createLevelBuffersFromKTX = createLevelBuffersFromKTX.createLevelBuffersFromKTX; exports.getTextureFormatFromKTXTexture = getTextureFormatFromKTXTexture.getTextureFormatFromKTXTexture; exports.glFormatToGPUFormat = glFormatToGPUFormat.glFormatToGPUFormat; exports.gpuFormatToKTXBasisTranscoderFormat = gpuFormatToKTXBasisTranscoderFormat.gpuFormatToKTXBasisTranscoderFormat; exports.ktxTranscoderUrls = setKTXTranscoderPath.ktxTranscoderUrls; exports.setKTXTranscoderPath = setKTXTranscoderPath.setKTXTranscoderPath; exports.vkFormatToGPUFormat = vkFormatToGPUFormat.vkFormatToGPUFormat; exports.loadKTX2onWorker = loadKTX2onWorker.loadKTX2onWorker; exports.detectCompressed = detectCompressed.detectCompressed; exports.resolveCompressedTextureUrl = resolveCompressedTextureUrl.resolveCompressedTextureUrl; exports.validFormats = resolveCompressedTextureUrl.validFormats; /***/ }), /***/ 87440: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var glFormatToGPUFormat = __webpack_require__(59520); var vkFormatToGPUFormat = __webpack_require__(20780); "use strict"; function getTextureFormatFromKTXTexture(ktxTexture) { if (ktxTexture.classId === 2) { return vkFormatToGPUFormat.vkFormatToGPUFormat(ktxTexture.vkFormat); } return glFormatToGPUFormat.glFormatToGPUFormat(ktxTexture.glInternalformat); } exports.getTextureFormatFromKTXTexture = getTextureFormatFromKTXTexture; /***/ }), /***/ 87528: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var NineSliceSpritePipe = __webpack_require__(5699); "use strict"; Extensions.extensions.add(NineSliceSpritePipe.NineSliceSpritePipe); /***/ }), /***/ 87602: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.compareQuerySelectorSpecificity = compareQuerySelectorSpecificity; exports.computeMeasureExpression = computeMeasureExpression; exports.getQuerySelectorSpecificity = getQuerySelectorSpecificity; var _DPParser = _interopRequireDefault(__webpack_require__(91291)); var _DPParseInstance = __webpack_require__(82554); var _Array = __webpack_require__(27847); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /***** css expression rules****/ // var exp = `calc(var(--abcd) + 15px + 15%)`; var elementRegexes = [['varname', /--[a-z-]+/], ['word', /[_a-zA-Z][_a-zA-Z0-9]*/], ['msnumber', /(\d+([.]\d*)?([eE][+-]?\d+)?|[.]\d+([eE][+-]?\d+)?)(vh|vw|px|%|pt)/], ['number', /(\d+([.]\d*)?([eE][+-]?\d+)?|[.]\d+([eE][+-]?\d+)?)/], ['symbol', /[^\s_a-zA-Z0-9]/], ['string', /("(?:[^"\\]|\\.)*?")|('(?:[^'\\]|\\.)*?')/]]; var rules = []; rules.push({ target: 'measure_num', elements: ['.msnumber'], toAST: function toAST(pN) { pN = pN.children[0]; return { type: "MeasureLiteral", value: parseFloat(pN.content.replace(/vh|vw|px|%|pt/, '')), unit: pN.content.match(/px|%|pt|vw|vh/)[0] }; } }); rules.push({ target: 'number', elements: ['.number'], toAST: function toAST(pN) { pN = pN.children[0]; return { type: "NumericLiteral", value: parseFloat(pN.content) }; } }); rules.push({ target: 'exp', elements: ['measure_num'], toAST: function toAST(pN) { return (0, _DPParseInstance.parsedNodeToAST)(pN.children[0]); } }); rules.push({ target: 'bracket_group', elements: ['_(', 'exp', '_)'], toAST: function toAST(parsedNode) { return (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[1]); } }); rules.push({ target: 'exp', elements: ['bracket_group'], toAST: function toAST(parsedNode) { return (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]); } }); rules.push({ target: 'variable_name', elements: ['.varname'], toAST: function toAST(parsedNode) { return { type: 'VariableName', name: parsedNode.children[0].content }; } }); rules.push({ target: 'exp', elements: ['variable_name'], toAST: function toAST(parsedNode) { return (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]); } }); ['+', '-', '*', '/'].forEach(function (op) { rules.push({ target: 'bin_op', elements: ['_' + op], toAST: function toAST(parsedNode) { return { type: "BinaryOperator", content: op }; } }); }); var operatorOrder = { '*': 5, '/': 5, '%': 5, '+': 6, '-': 6 }; var operatorTokenToAst = function operatorTokenToAst(token) { return { type: token.type, content: token.content }; }; rules.push({ target: 'exp', elements: ['exp', 'bin_op', 'exp'], // longestOnly: true,//* error when parse return (...)... ident: 'bin_op_rec', toASTChain: function toASTChain(parseNode) { var res = []; if (parseNode.children[0].rule === this) { res = res.concat(this.toASTChain(parseNode.children[0])); } else { res.push((0, _DPParseInstance.parsedNodeToAST)(parseNode.children[0])); } res.push(parseNode.children[1].children[0]); if (parseNode.children[2].rule === this) { res = res.concat(this.toASTChain(parseNode.children[2])); } else { res.push((0, _DPParseInstance.parsedNodeToAST)(parseNode.children[2])); } return res; }, toAST: function toAST(parsedNode) { var chain = this.toASTChain(parsedNode); var stack = []; var item; var newNode; while (chain.length > 0) { item = chain.shift(); if (item.content in operatorOrder) { while (stack.length >= 3 && operatorOrder[stack[stack.length - 2].content] <= operatorOrder[item.content]) { newNode = { type: 'BinaryExpression' }; newNode.right = stack.pop(); newNode.operator = operatorTokenToAst(stack.pop()); newNode.left = stack.pop(); stack.push(newNode); } } stack.push(item); } while (stack.length >= 3) { newNode = { type: 'BinaryExpression' }; newNode.right = stack.pop(); newNode.operator = operatorTokenToAst(stack.pop()); newNode.left = stack.pop(); stack.push(newNode); } return stack.pop(); } }); rules.push({ target: 'args_list', elements: ['exp'], toAST: function toAST(parsedNode) { return (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]); }, toASTChain: function toASTChain(parsedNode) { return [(0, _DPParseInstance.parsedNodeToAST)(parsedNode)]; } }); rules.push({ target: 'ident', elements: ['.word'], toAST: function toAST(parsedNode) { return { type: 'Identifier', name: parsedNode.children[0].content }; } }); rules.push({ target: 'number', elements: ['.number'], toAST: function toAST(parsedNode) { return { type: 'NumericLiteral', value: parseFloat(parsedNode.children[0].content) }; } }); rules.push({ target: 'args_list', elements: ['args_list', '_,', 'exp'], longestOnly: true, ident: 'args_list_rec', toASTChain: function toASTChain(parsedNode) { return (0, _DPParseInstance.parsedNodeToASTChain)(parsedNode.children[0]).concat((0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[2])); } }); rules.push({ target: 'function_callee', elements: ['ident'], toAST: function toAST(parsedNode) { return (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]); } }); rules.push({ target: 'function_callee', elements: ['mem_exp'], toAST: function toAST(parsedNode) { return (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]); } }); rules.push({ target: 'function_call', elements: ['function_callee', '_(', 'args_list', '_)'], toAST: function toAST(parsedNode) { return { type: 'CallExpression', arguments: parsedNode.children[2].rule.toASTChain(parsedNode.children[2]), callee: (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]) }; } }); rules.push({ target: 'function_call', elements: ['function_callee', '_(', '_)'], toAST: function toAST(parsedNode) { return { type: 'CallExpression', arguments: [], callee: (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]) }; } }); rules.push({ target: 'exp', elements: ['function_call'], toAST: function toAST(parsedNode) { return (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]); } }); rules.push({ target: 'exp', elements: ['number'], toAST: function toAST(parsedNode) { return (0, _DPParseInstance.parsedNodeToAST)(parsedNode.children[0]); } }); var cssExpressionParser = new _DPParser["default"]({ elementRegexes: elementRegexes, rules: rules }); var getScreenViewSize = function getScreenViewSize() { var div = document.createElement('div'); div.style.width = '100vw'; div.style.height = '100vh'; div.style.zIndex = '-10000'; div.style.visibility = 'hidden'; div.style.position = 'fixed'; document.body.appendChild(div); var res = div.getBoundingClientRect(); div.remove(); return { width: res.width, height: res.height }; }; var fx = { calc: function calc(x) { return x; }, 'var': function _var(x, ctx) { if (!ctx.style) { if (ctx.elt) { ctx.style = getComputedStyle(ctx.elt); } } if (ctx.style) { if (ctx.style.getPropertyValue) { return ctx.style.getPropertyValue(x); } else { return ctx.style[x]; } } throw new Error("Miss style:CSSStyleDeclaration in ctx"); }, '*': function _(x, y, ctx) { if (x && x.unit) { if (y && y.unit) { throw Error("Can not call ".concat(x.value + x.unit, " * ").concat(y.value + y.unit)); } else { return { value: x.value * y, unit: x.unit }; } } else { if (y && y.unit) { return { value: x * y.value, unit: y.unit }; } else return x * y; } }, '/': function _(x, y, ctx) { if (x && x.unit) { if (y && y.unit) { throw Error("Can not call ".concat(x.value + x.unit, " / ").concat(y.value + y.unit)); } else { return { value: x.value / y, unit: x.unit }; } } else { if (y && y.unit) { throw Error("Can not call ".concat(x, " / ").concat(y.value + y.unit)); } else return x * y; } }, '+': function add(x, y, ctx) { if (x && x.unit) { if (y && y.unit) { if (x.unit === y.unit) { return { value: x.value + y.value, unit: x.unit }; } else { return fx['+'](fx.toPx(x, ctx), fx.toPx(y, ctx)); } } else { throw Error("Can not call ".concat(x.value + x.unit, " + ").concat(y)); } } else { if (y && y.unit) { throw Error("Can not call ".concat(x, " + ").concat(y.value + y.unit)); } else return x + y; } }, '-': function add(x, y, ctx) { if (x && x.unit) { if (y && y.unit) { if (x.unit === y.unit) { return { value: x.value - y.value, unit: x.unit }; } else { return fx['+'](fx.toPx(x, ctx), fx.toPx(y, ctx)); } } else { throw Error("Can not call ".concat(x.value - x.unit, " + ").concat(y)); } } else { if (y && y.unit) { throw Error("Can not call ".concat(x, " - ").concat(y.value + y.unit)); } else return x + y; } }, toPx: function toPx(val, ctx) { switch (val.unit) { case '%': if (typeof ctx.parentSize !== "number") throw new Error("Miss parentSize:number(px) in ctx"); return { value: ctx.parentSize * val.value / 100, unit: 'px' }; case 'vh': if (!ctx.screenSize) { ctx.screenSize = getScreenViewSize(); } return { value: ctx.screenSize.height * val.value / 100, unit: 'px' }; case 'vw': if (!ctx.screenSize) { ctx.screenSize = getScreenViewSize(); } return { value: ctx.screenSize.width * val.value / 100, unit: 'px' }; default: break; } return val; } }; var visitors = { CallExpression: function CallExpression(astNode, ctx) { var args = astNode.arguments.map(function (it) { return accept(it, ctx); }); args.push(ctx); return fx[astNode.callee.name].apply(null, args); }, BinaryExpression: function BinaryExpression(astNode, ctx) { var left = accept(astNode.left, ctx); var right = accept(astNode.right, ctx); var func = fx[astNode.operator.content]; return func(left, right, ctx); }, MeasureLiteral: function MeasureLiteral(astNode, ctx) { return { value: astNode.value, unit: astNode.unit }; }, NumericLiteral: function NumericLiteral(astNode, ctx) { return astNode.value; }, VariableName: function VariableName(astNode, ctx) { return astNode.name; } }; var accept = function accept(astNode, ctx) { return visitors[astNode.type](astNode, ctx); }; /** * * @param {string} exp * @param {{parentSize?: number, screenViewSize?:{width: number, height: number}, style?:CSSStyleDeclaration|Object, elt:AElement|any}} ctx * @param {boolean=} debug * @returns {*|null} */ function computeMeasureExpression(exp, ctx, debug) { try { var p = cssExpressionParser.parse(exp, 'exp'); if (p.ast) { return accept(p.ast, ctx); } return null; } catch (error) { return null; } } function getQuerySelectorSpecificity(selector) { var inline = 0; var idCount = 0; var classCount = 0; var tagCount = 0; // Remove pseudo-elements selector = selector.replace(/::\w+/g, ''); // Check for inline styles (not directly calculable from selector string) if (selector.includes('style="')) { inline = 1; } // Count ID selectors idCount = (selector.match(/#[\w-]+/g) || []).length; // Count class selectors, attributes selectors, and pseudo-classes classCount = (selector.match(/\.[\w-]+/g) || []).length + (selector.match(/\[[^\]]+\]/g) || []).length + (selector.match(/:(?!:)[\w-]+/g) || []).length; // Count element selectors and pseudo-elements tagCount = (selector.match(/^[\w-]+|\s[\w-]+/g) || []).length; return [inline, idCount, classCount, tagCount]; } function compareQuerySelectorSpecificity(selector1, selector2) { var specificity1 = getQuerySelectorSpecificity(selector1); var specificity2 = getQuerySelectorSpecificity(selector2); return (0, _Array.arrayLexicographicalCompare)(selector1, specificity2); } /***/ }), /***/ 87661: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Container = __webpack_require__(47719); var _const = __webpack_require__(20105); var Ticker = __webpack_require__(6014); "use strict"; var _PrepareBase = /*#__PURE__*/function () { /** * @param {rendering.Renderer} renderer - A reference to the current renderer */ function _PrepareBase(renderer) { var _this = this; _classCallCheck(this, _PrepareBase); /** called per frame by the ticker, defer processing to next tick */ this._tick = function () { _this.timeout = setTimeout(_this._processQueue, 0); }; /** process the queue up to max item limit per frame */ this._processQueue = function () { var queue = _this.queue; var itemsProcessed = 0; while (queue.length && itemsProcessed < _PrepareBase.uploadsPerFrame) { var queueItem = queue.shift(); _this.uploadQueueItem(queueItem); itemsProcessed++; } if (queue.length) { Ticker.Ticker.system.addOnce(_this._tick, _this, _const.UPDATE_PRIORITY.UTILITY); } else { _this._resolve(); } }; this.renderer = renderer; this.queue = []; this.resolves = []; } /** * Return a copy of the queue * @returns {PrepareQueueItem[]} The queue */ return _createClass(_PrepareBase, [{ key: "getQueue", value: function getQueue() { return _toConsumableArray(this.queue); } /** * Add a textures or graphics resource to the queue * @param {PrepareSourceItem | PrepareSourceItem[]} resource */ }, { key: "add", value: function add(resource) { var resourceArray = Array.isArray(resource) ? resource : [resource]; var _iterator = _createForOfIteratorHelper(resourceArray), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var resourceItem = _step.value; if (resourceItem instanceof Container.Container) { this._addContainer(resourceItem); } else { this.resolveQueueItem(resourceItem, this.queue); } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } return this; } /** * Recursively add a container and its children to the queue * @param {Container} container - The container to add to the queue */ }, { key: "_addContainer", value: function _addContainer(container) { this.resolveQueueItem(container, this.queue); var _iterator2 = _createForOfIteratorHelper(container.children), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var child = _step2.value; this._addContainer(child); } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } } /** * Upload all the textures and graphics to the GPU (optionally add more resources to the queue first) * @param {PrepareSourceItem | PrepareSourceItem[] | undefined} resource */ }, { key: "upload", value: function upload(resource) { var _this2 = this; if (resource) { this.add(resource); } return new Promise(function (resolve) { if (_this2.queue.length) { _this2.resolves.push(resolve); _this2.dedupeQueue(); Ticker.Ticker.system.addOnce(_this2._tick, _this2, _const.UPDATE_PRIORITY.UTILITY); } else { resolve(); } }); } /** eliminate duplicates before processing */ }, { key: "dedupeQueue", value: function dedupeQueue() { var hash = /* @__PURE__ */Object.create(null); var nextUnique = 0; for (var i = 0; i < this.queue.length; i++) { var current = this.queue[i]; if (!hash[current.uid]) { hash[current.uid] = true; this.queue[nextUnique++] = current; } } this.queue.length = nextUnique; } /** Call all the resolve callbacks */ }, { key: "_resolve", value: function _resolve() { var resolves = this.resolves; var array = resolves.slice(0); resolves.length = 0; var _iterator3 = _createForOfIteratorHelper(array), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { var resolve = _step3.value; resolve(); } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } } }]); }(); /** The number of uploads to process per frame */ _PrepareBase.uploadsPerFrame = 4; var PrepareBase = _PrepareBase; exports.PrepareBase = PrepareBase; /***/ }), /***/ 88129: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _excluded = ["width", "alignment", "miterLimit", "cap", "join", "pixelLine"]; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Color = __webpack_require__(98828); var Texture = __webpack_require__(73782); var FillGradient = __webpack_require__(57315); var FillPattern = __webpack_require__(95745); "use strict"; function isColorLike(value) { return Color.Color.isColorLike(value); } function isFillPattern(value) { return value instanceof FillPattern.FillPattern; } function isFillGradient(value) { return value instanceof FillGradient.FillGradient; } function isTexture(value) { return value instanceof Texture.Texture; } function handleColorLike(fill, value, defaultStyle) { var temp = Color.Color.shared.setValue(value !== null && value !== void 0 ? value : 0); fill.color = temp.toNumber(); fill.alpha = temp.alpha === 1 ? defaultStyle.alpha : temp.alpha; fill.texture = Texture.Texture.WHITE; return _objectSpread(_objectSpread({}, defaultStyle), fill); } function handleTexture(fill, value, defaultStyle) { fill.texture = value; return _objectSpread(_objectSpread({}, defaultStyle), fill); } function handleFillPattern(fill, value, defaultStyle) { fill.fill = value; fill.color = 16777215; fill.texture = value.texture; fill.matrix = value.transform; return _objectSpread(_objectSpread({}, defaultStyle), fill); } function handleFillGradient(fill, value, defaultStyle) { value.buildGradient(); fill.fill = value; fill.color = 16777215; fill.texture = value.texture; fill.matrix = value.transform; fill.textureSpace = value.textureSpace; return _objectSpread(_objectSpread({}, defaultStyle), fill); } function handleFillObject(value, defaultStyle) { var style = _objectSpread(_objectSpread({}, defaultStyle), value); var color = Color.Color.shared.setValue(style.color); style.alpha *= color.alpha; style.color = color.toNumber(); return style; } function toFillStyle(value, defaultStyle) { if (value === void 0 || value === null) { return null; } var fill = {}; var objectStyle = value; if (isColorLike(value)) { return handleColorLike(fill, value, defaultStyle); } else if (isTexture(value)) { return handleTexture(fill, value, defaultStyle); } else if (isFillPattern(value)) { return handleFillPattern(fill, value, defaultStyle); } else if (isFillGradient(value)) { return handleFillGradient(fill, value, defaultStyle); } else if (objectStyle.fill && isFillPattern(objectStyle.fill)) { return handleFillPattern(objectStyle, objectStyle.fill, defaultStyle); } else if (objectStyle.fill && isFillGradient(objectStyle.fill)) { return handleFillGradient(objectStyle, objectStyle.fill, defaultStyle); } return handleFillObject(objectStyle, defaultStyle); } function toStrokeStyle(value, defaultStyle) { var width = defaultStyle.width, alignment = defaultStyle.alignment, miterLimit = defaultStyle.miterLimit, cap = defaultStyle.cap, join = defaultStyle.join, pixelLine = defaultStyle.pixelLine, rest = _objectWithoutProperties(defaultStyle, _excluded); var fill = toFillStyle(value, rest); if (!fill) { return null; } return _objectSpread({ width: width, alignment: alignment, miterLimit: miterLimit, cap: cap, join: join, pixelLine: pixelLine }, fill); } exports.toFillStyle = toFillStyle; exports.toStrokeStyle = toStrokeStyle; /***/ }), /***/ 88370: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 88545: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function unpremultiplyAlpha(pixels) { if (pixels instanceof Uint8ClampedArray) { pixels = new Uint8Array(pixels.buffer); } var n = pixels.length; for (var i = 0; i < n; i += 4) { var alpha = pixels[i + 3]; if (alpha !== 0) { var a = 255.001 / alpha; pixels[i] = pixels[i] * a + 0.5; pixels[i + 1] = pixels[i + 1] * a + 0.5; pixels[i + 2] = pixels[i + 2] * a + 0.5; } } } exports.unpremultiplyAlpha = unpremultiplyAlpha; /***/ }), /***/ 88699: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var adapter = __webpack_require__(72450); var pow2 = __webpack_require__(52878); "use strict"; var CanvasPoolClass = /*#__PURE__*/function () { function CanvasPoolClass(canvasOptions) { _classCallCheck(this, CanvasPoolClass); this._canvasPool = /* @__PURE__ */Object.create(null); this.canvasOptions = canvasOptions || {}; this.enableFullScreen = false; } /** * Creates texture with params that were specified in pool constructor. * @param pixelWidth - Width of texture in pixels. * @param pixelHeight - Height of texture in pixels. */ return _createClass(CanvasPoolClass, [{ key: "_createCanvasAndContext", value: function _createCanvasAndContext(pixelWidth, pixelHeight) { var canvas = adapter.DOMAdapter.get().createCanvas(); canvas.width = pixelWidth; canvas.height = pixelHeight; var context = canvas.getContext("2d"); return { canvas: canvas, context: context }; } /** * Gets a Power-of-Two render texture or fullScreen texture * @param minWidth - The minimum width of the render texture. * @param minHeight - The minimum height of the render texture. * @param resolution - The resolution of the render texture. * @returns The new render texture. */ }, { key: "getOptimalCanvasAndContext", value: function getOptimalCanvasAndContext(minWidth, minHeight) { var resolution = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; minWidth = Math.ceil(minWidth * resolution - 1e-6); minHeight = Math.ceil(minHeight * resolution - 1e-6); minWidth = pow2.nextPow2(minWidth); minHeight = pow2.nextPow2(minHeight); var key = (minWidth << 17) + (minHeight << 1); if (!this._canvasPool[key]) { this._canvasPool[key] = []; } var canvasAndContext = this._canvasPool[key].pop(); if (!canvasAndContext) { canvasAndContext = this._createCanvasAndContext(minWidth, minHeight); } return canvasAndContext; } /** * Place a render texture back into the pool. * @param canvasAndContext */ }, { key: "returnCanvasAndContext", value: function returnCanvasAndContext(canvasAndContext) { var canvas = canvasAndContext.canvas; var width = canvas.width, height = canvas.height; var key = (width << 17) + (height << 1); canvasAndContext.context.clearRect(0, 0, width, height); this._canvasPool[key].push(canvasAndContext); } }, { key: "clear", value: function clear() { this._canvasPool = {}; } }]); }(); var CanvasPool = new CanvasPoolClass(); exports.CanvasPool = CanvasPool; exports.CanvasPoolClass = CanvasPoolClass; /***/ }), /***/ 88750: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var warn = __webpack_require__(57371); "use strict"; function addBits(srcParts, parts, name) { if (srcParts) { for (var i in srcParts) { var id = i.toLocaleLowerCase(); var part = parts[id]; if (part) { var sanitisedPart = srcParts[i]; if (i === "header") { sanitisedPart = sanitisedPart.replace(/@in\s+[^;]+;\s*/g, "").replace(/@out\s+[^;]+;\s*/g, ""); } if (name) { part.push("//----".concat(name, "----//")); } part.push(sanitisedPart); } else { warn.warn("".concat(i, " placement hook does not exist in shader")); } } } } exports.addBits = addBits; /***/ }), /***/ 88798: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 88842: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function createLevelBuffers(basisTexture, basisTranscoderFormat) { var images = basisTexture.getNumImages(); var levels = basisTexture.getNumLevels(0); var success = basisTexture.startTranscoding(); if (!success) { throw new Error("startTranscoding failed"); } var levelBuffers = []; for (var levelIndex = 0; levelIndex < levels; ++levelIndex) { for (var sliceIndex = 0; sliceIndex < images; ++sliceIndex) { var transcodeSize = basisTexture.getImageTranscodedSizeInBytes(sliceIndex, levelIndex, basisTranscoderFormat); var levelBuffer = new Uint8Array(transcodeSize); var success2 = basisTexture.transcodeImage(levelBuffer, sliceIndex, levelIndex, basisTranscoderFormat, 1, 0); if (!success2) { throw new Error("transcodeImage failed"); } levelBuffers.push(levelBuffer); } } return levelBuffers; } exports.createLevelBuffers = createLevelBuffers; /***/ }), /***/ 89675: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function pointInTriangle(px, py, x1, y1, x2, y2, x3, y3) { var v2x = x3 - x1; var v2y = y3 - y1; var v1x = x2 - x1; var v1y = y2 - y1; var v0x = px - x1; var v0y = py - y1; var dot00 = v2x * v2x + v2y * v2y; var dot01 = v2x * v1x + v2y * v1y; var dot02 = v2x * v0x + v2y * v0y; var dot11 = v1x * v1x + v1y * v1y; var dot12 = v1x * v0x + v1y * v0y; var invDenom = 1 / (dot00 * dot11 - dot01 * dot01); var u = (dot11 * dot02 - dot01 * dot12) * invDenom; var v = (dot00 * dot12 - dot01 * dot02) * invDenom; return u >= 0 && v >= 0 && u + v < 1; } exports.pointInTriangle = pointInTriangle; /***/ }), /***/ 89907: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } var bitmapFontTextParser = { test: function test(data) { return typeof data === "string" && data.startsWith("info face="); }, parse: function parse(txt) { var _rawData$distanceFiel; var items = txt.match(/^[a-z]+\s+.+$/gm); var rawData = { info: [], common: [], page: [], "char": [], chars: [], kerning: [], kernings: [], distanceField: [] }; for (var i in items) { var name = items[i].match(/^[a-z]+/gm)[0]; var attributeList = items[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm); var itemData = {}; for (var i2 in attributeList) { var split = attributeList[i2].split("="); var key = split[0]; var strValue = split[1].replace(/"/gm, ""); var floatValue = parseFloat(strValue); var value = isNaN(floatValue) ? strValue : floatValue; itemData[key] = value; } rawData[name].push(itemData); } var font = { chars: {}, pages: [], lineHeight: 0, fontSize: 0, fontFamily: "", distanceField: null, baseLineOffset: 0 }; var _rawData$info = _slicedToArray(rawData.info, 1), info = _rawData$info[0]; var _rawData$common = _slicedToArray(rawData.common, 1), common = _rawData$common[0]; var _ref = (_rawData$distanceFiel = rawData.distanceField) !== null && _rawData$distanceFiel !== void 0 ? _rawData$distanceFiel : [], _ref2 = _slicedToArray(_ref, 1), distanceField = _ref2[0]; if (distanceField) { font.distanceField = { range: parseInt(distanceField.distanceRange, 10), type: distanceField.fieldType }; } font.fontSize = parseInt(info.size, 10); font.fontFamily = info.face; font.lineHeight = parseInt(common.lineHeight, 10); var page = rawData.page; for (var _i = 0; _i < page.length; _i++) { font.pages.push({ id: parseInt(page[_i].id, 10) || 0, file: page[_i].file }); } var map = {}; font.baseLineOffset = font.lineHeight - parseInt(common.base, 10); var _char = rawData["char"]; for (var _i2 = 0; _i2 < _char.length; _i2++) { var _ref3, _charNode$letter; var charNode = _char[_i2]; var id = parseInt(charNode.id, 10); var letter = (_ref3 = (_charNode$letter = charNode.letter) !== null && _charNode$letter !== void 0 ? _charNode$letter : charNode["char"]) !== null && _ref3 !== void 0 ? _ref3 : String.fromCharCode(id); if (letter === "space") letter = " "; map[id] = letter; font.chars[letter] = { id: id, // texture deets.. page: parseInt(charNode.page, 10) || 0, x: parseInt(charNode.x, 10), y: parseInt(charNode.y, 10), width: parseInt(charNode.width, 10), height: parseInt(charNode.height, 10), xOffset: parseInt(charNode.xoffset, 10), yOffset: parseInt(charNode.yoffset, 10), xAdvance: parseInt(charNode.xadvance, 10), kerning: {} }; } var kerning = rawData.kerning || []; for (var _i3 = 0; _i3 < kerning.length; _i3++) { var first = parseInt(kerning[_i3].first, 10); var second = parseInt(kerning[_i3].second, 10); var amount = parseInt(kerning[_i3].amount, 10); font.chars[map[second]].kerning[map[first]] = amount; } return font; } }; exports.bitmapFontTextParser = bitmapFontTextParser; /***/ }), /***/ 89914: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var FilterEffect = __webpack_require__(51856); var MaskFilter = __webpack_require__(9012); var Bounds = __webpack_require__(76631); var getGlobalBounds = __webpack_require__(27182); var Sprite = __webpack_require__(27615); var PoolGroup = __webpack_require__(47505); var Texture = __webpack_require__(73782); var TexturePool = __webpack_require__(53248); var types = __webpack_require__(9634); "use strict"; var tempBounds = new Bounds.Bounds(); var AlphaMaskEffect = /*#__PURE__*/function (_FilterEffect$FilterE) { function AlphaMaskEffect() { var _this; _classCallCheck(this, AlphaMaskEffect); _this = _callSuper(this, AlphaMaskEffect); _this.filters = [new MaskFilter.MaskFilter({ sprite: new Sprite.Sprite(Texture.Texture.EMPTY), inverse: false, resolution: "inherit", antialias: "inherit" })]; return _this; } _inherits(AlphaMaskEffect, _FilterEffect$FilterE); return _createClass(AlphaMaskEffect, [{ key: "sprite", get: function get() { return this.filters[0].sprite; }, set: function set(value) { this.filters[0].sprite = value; } }, { key: "inverse", get: function get() { return this.filters[0].inverse; }, set: function set(value) { this.filters[0].inverse = value; } }]); }(FilterEffect.FilterEffect); var AlphaMaskPipe = /*#__PURE__*/function () { function AlphaMaskPipe(renderer) { _classCallCheck(this, AlphaMaskPipe); this._activeMaskStage = []; this._renderer = renderer; } return _createClass(AlphaMaskPipe, [{ key: "push", value: function push(mask, maskedContainer, instructionSet) { var renderer = this._renderer; renderer.renderPipes.batch["break"](instructionSet); instructionSet.add({ renderPipeId: "alphaMask", action: "pushMaskBegin", mask: mask, inverse: maskedContainer._maskOptions.inverse, canBundle: false, maskedContainer: maskedContainer }); mask.inverse = maskedContainer._maskOptions.inverse; if (mask.renderMaskToTexture) { var maskContainer = mask.mask; maskContainer.includeInBuild = true; maskContainer.collectRenderables(instructionSet, renderer, null); maskContainer.includeInBuild = false; } renderer.renderPipes.batch["break"](instructionSet); instructionSet.add({ renderPipeId: "alphaMask", action: "pushMaskEnd", mask: mask, maskedContainer: maskedContainer, inverse: maskedContainer._maskOptions.inverse, canBundle: false }); } }, { key: "pop", value: function pop(mask, _maskedContainer, instructionSet) { var renderer = this._renderer; renderer.renderPipes.batch["break"](instructionSet); instructionSet.add({ renderPipeId: "alphaMask", action: "popMaskEnd", mask: mask, inverse: _maskedContainer._maskOptions.inverse, canBundle: false }); } }, { key: "execute", value: function execute(instruction) { var renderer = this._renderer; var renderMask = instruction.mask.renderMaskToTexture; if (instruction.action === "pushMaskBegin") { var filterEffect = PoolGroup.BigPool.get(AlphaMaskEffect); filterEffect.inverse = instruction.inverse; if (renderMask) { instruction.mask.mask.measurable = true; var bounds = getGlobalBounds.getGlobalBounds(instruction.mask.mask, true, tempBounds); instruction.mask.mask.measurable = false; bounds.ceil(); var colorTextureSource = renderer.renderTarget.renderTarget.colorTexture.source; var filterTexture = TexturePool.TexturePool.getOptimalTexture(bounds.width, bounds.height, colorTextureSource._resolution, colorTextureSource.antialias); renderer.renderTarget.push(filterTexture, true); renderer.globalUniforms.push({ offset: bounds, worldColor: 4294967295 }); var sprite = filterEffect.sprite; sprite.texture = filterTexture; sprite.worldTransform.tx = bounds.minX; sprite.worldTransform.ty = bounds.minY; this._activeMaskStage.push({ filterEffect: filterEffect, maskedContainer: instruction.maskedContainer, filterTexture: filterTexture }); } else { filterEffect.sprite = instruction.mask.mask; this._activeMaskStage.push({ filterEffect: filterEffect, maskedContainer: instruction.maskedContainer }); } } else if (instruction.action === "pushMaskEnd") { var maskData = this._activeMaskStage[this._activeMaskStage.length - 1]; if (renderMask) { if (renderer.type === types.RendererType.WEBGL) { renderer.renderTarget.finishRenderPass(); } renderer.renderTarget.pop(); renderer.globalUniforms.pop(); } renderer.filter.push({ renderPipeId: "filter", action: "pushFilter", container: maskData.maskedContainer, filterEffect: maskData.filterEffect, canBundle: false }); } else if (instruction.action === "popMaskEnd") { renderer.filter.pop(); var _maskData = this._activeMaskStage.pop(); if (renderMask) { TexturePool.TexturePool.returnTexture(_maskData.filterTexture); } PoolGroup.BigPool["return"](_maskData.filterEffect); } } }, { key: "destroy", value: function destroy() { this._renderer = null; this._activeMaskStage = null; } }]); }(); /** @ignore */ AlphaMaskPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "alphaMask" }; exports.AlphaMaskPipe = AlphaMaskPipe; /***/ }), /***/ 90216: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var adapter = __webpack_require__(72450); var Extensions = __webpack_require__(86890); var Texture = __webpack_require__(73782); var GlTexture = __webpack_require__(10485); var glUploadBufferImageResource = __webpack_require__(45394); var glUploadCompressedTextureResource = __webpack_require__(33173); var glUploadImageResource = __webpack_require__(13864); var glUploadVideoResource = __webpack_require__(18410); var applyStyleParams = __webpack_require__(2818); var mapFormatToGlFormat = __webpack_require__(99229); var mapFormatToGlInternalFormat = __webpack_require__(6088); var mapFormatToGlType = __webpack_require__(96230); __webpack_require__(88545); "use strict"; var BYTES_PER_PIXEL = 4; var GlTextureSystem = /*#__PURE__*/function () { function GlTextureSystem(renderer) { _classCallCheck(this, GlTextureSystem); this.managedTextures = []; this._glTextures = /* @__PURE__ */Object.create(null); this._glSamplers = /* @__PURE__ */Object.create(null); this._boundTextures = []; this._activeTextureLocation = -1; this._boundSamplers = /* @__PURE__ */Object.create(null); this._uploads = { image: glUploadImageResource.glUploadImageResource, buffer: glUploadBufferImageResource.glUploadBufferImageResource, video: glUploadVideoResource.glUploadVideoResource, compressed: glUploadCompressedTextureResource.glUploadCompressedTextureResource }; this._premultiplyAlpha = false; // TODO - separate samplers will be a cool thing to add, but not right now! this._useSeparateSamplers = false; this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_glTextures"); this._renderer.renderableGC.addManagedHash(this, "_glSamplers"); } return _createClass(GlTextureSystem, [{ key: "contextChange", value: function contextChange(gl) { this._gl = gl; if (!this._mapFormatToInternalFormat) { this._mapFormatToInternalFormat = mapFormatToGlInternalFormat.mapFormatToGlInternalFormat(gl, this._renderer.context.extensions); this._mapFormatToType = mapFormatToGlType.mapFormatToGlType(gl); this._mapFormatToFormat = mapFormatToGlFormat.mapFormatToGlFormat(gl); } this._glTextures = /* @__PURE__ */Object.create(null); this._glSamplers = /* @__PURE__ */Object.create(null); this._boundSamplers = /* @__PURE__ */Object.create(null); this._premultiplyAlpha = false; for (var i = 0; i < 16; i++) { this.bind(Texture.Texture.EMPTY, i); } } }, { key: "initSource", value: function initSource(source) { this.bind(source); } }, { key: "bind", value: function bind(texture) { var location = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var source = texture.source; if (texture) { this.bindSource(source, location); if (this._useSeparateSamplers) { this._bindSampler(source.style, location); } } else { this.bindSource(null, location); if (this._useSeparateSamplers) { this._bindSampler(null, location); } } } }, { key: "bindSource", value: function bindSource(source) { var location = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var gl = this._gl; source._touched = this._renderer.textureGC.count; if (this._boundTextures[location] !== source) { this._boundTextures[location] = source; this._activateLocation(location); source || (source = Texture.Texture.EMPTY.source); var glTexture = this.getGlSource(source); gl.bindTexture(glTexture.target, glTexture.texture); } } }, { key: "_bindSampler", value: function _bindSampler(style) { var location = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var gl = this._gl; if (!style) { this._boundSamplers[location] = null; gl.bindSampler(location, null); return; } var sampler = this._getGlSampler(style); if (this._boundSamplers[location] !== sampler) { this._boundSamplers[location] = sampler; gl.bindSampler(location, sampler); } } }, { key: "unbind", value: function unbind(texture) { var source = texture.source; var boundTextures = this._boundTextures; var gl = this._gl; for (var i = 0; i < boundTextures.length; i++) { if (boundTextures[i] === source) { this._activateLocation(i); var glTexture = this.getGlSource(source); gl.bindTexture(glTexture.target, null); boundTextures[i] = null; } } } }, { key: "_activateLocation", value: function _activateLocation(location) { if (this._activeTextureLocation !== location) { this._activeTextureLocation = location; this._gl.activeTexture(this._gl.TEXTURE0 + location); } } }, { key: "_initSource", value: function _initSource(source) { var gl = this._gl; var glTexture = new GlTexture.GlTexture(gl.createTexture()); glTexture.type = this._mapFormatToType[source.format]; glTexture.internalFormat = this._mapFormatToInternalFormat[source.format]; glTexture.format = this._mapFormatToFormat[source.format]; if (source.autoGenerateMipmaps && (this._renderer.context.supports.nonPowOf2mipmaps || source.isPowerOfTwo)) { var biggestDimension = Math.max(source.width, source.height); source.mipLevelCount = Math.floor(Math.log2(biggestDimension)) + 1; } this._glTextures[source.uid] = glTexture; if (!this.managedTextures.includes(source)) { source.on("update", this.onSourceUpdate, this); source.on("resize", this.onSourceUpdate, this); source.on("styleChange", this.onStyleChange, this); source.on("destroy", this.onSourceDestroy, this); source.on("unload", this.onSourceUnload, this); source.on("updateMipmaps", this.onUpdateMipmaps, this); this.managedTextures.push(source); } this.onSourceUpdate(source); this.updateStyle(source, false); return glTexture; } }, { key: "onStyleChange", value: function onStyleChange(source) { this.updateStyle(source, false); } }, { key: "updateStyle", value: function updateStyle(source, firstCreation) { var gl = this._gl; var glTexture = this.getGlSource(source); gl.bindTexture(gl.TEXTURE_2D, glTexture.texture); this._boundTextures[this._activeTextureLocation] = source; applyStyleParams.applyStyleParams(source.style, gl, source.mipLevelCount > 1, this._renderer.context.extensions.anisotropicFiltering, "texParameteri", gl.TEXTURE_2D, // will force a clamp to edge if the texture is not a power of two !this._renderer.context.supports.nonPowOf2wrapping && !source.isPowerOfTwo, firstCreation); } }, { key: "onSourceUnload", value: function onSourceUnload(source) { var glTexture = this._glTextures[source.uid]; if (!glTexture) return; this.unbind(source); this._glTextures[source.uid] = null; this._gl.deleteTexture(glTexture.texture); } }, { key: "onSourceUpdate", value: function onSourceUpdate(source) { var gl = this._gl; var glTexture = this.getGlSource(source); gl.bindTexture(gl.TEXTURE_2D, glTexture.texture); this._boundTextures[this._activeTextureLocation] = source; var premultipliedAlpha = source.alphaMode === "premultiply-alpha-on-upload"; if (this._premultiplyAlpha !== premultipliedAlpha) { this._premultiplyAlpha = premultipliedAlpha; gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultipliedAlpha); } if (this._uploads[source.uploadMethodId]) { this._uploads[source.uploadMethodId].upload(source, glTexture, gl, this._renderer.context.webGLVersion); } else { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, source.pixelWidth, source.pixelHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } if (source.autoGenerateMipmaps && source.mipLevelCount > 1) { this.onUpdateMipmaps(source, false); } } }, { key: "onUpdateMipmaps", value: function onUpdateMipmaps(source) { var bind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (bind) this.bindSource(source, 0); var glTexture = this.getGlSource(source); this._gl.generateMipmap(glTexture.target); } }, { key: "onSourceDestroy", value: function onSourceDestroy(source) { source.off("destroy", this.onSourceDestroy, this); source.off("update", this.onSourceUpdate, this); source.off("resize", this.onSourceUpdate, this); source.off("unload", this.onSourceUnload, this); source.off("styleChange", this.onStyleChange, this); source.off("updateMipmaps", this.onUpdateMipmaps, this); this.managedTextures.splice(this.managedTextures.indexOf(source), 1); this.onSourceUnload(source); } }, { key: "_initSampler", value: function _initSampler(style) { var gl = this._gl; var glSampler = this._gl.createSampler(); this._glSamplers[style._resourceId] = glSampler; applyStyleParams.applyStyleParams(style, gl, this._boundTextures[this._activeTextureLocation].mipLevelCount > 1, this._renderer.context.extensions.anisotropicFiltering, "samplerParameteri", glSampler, false, true); return this._glSamplers[style._resourceId]; } }, { key: "_getGlSampler", value: function _getGlSampler(sampler) { return this._glSamplers[sampler._resourceId] || this._initSampler(sampler); } }, { key: "getGlSource", value: function getGlSource(source) { return this._glTextures[source.uid] || this._initSource(source); } }, { key: "generateCanvas", value: function generateCanvas(texture) { var _this$getPixels = this.getPixels(texture), pixels = _this$getPixels.pixels, width = _this$getPixels.width, height = _this$getPixels.height; var canvas = adapter.DOMAdapter.get().createCanvas(); canvas.width = width; canvas.height = height; var ctx = canvas.getContext("2d"); if (ctx) { var imageData = ctx.createImageData(width, height); imageData.data.set(pixels); ctx.putImageData(imageData, 0, 0); } return canvas; } }, { key: "getPixels", value: function getPixels(texture) { var resolution = texture.source.resolution; var frame = texture.frame; var width = Math.max(Math.round(frame.width * resolution), 1); var height = Math.max(Math.round(frame.height * resolution), 1); var pixels = new Uint8Array(BYTES_PER_PIXEL * width * height); var renderer = this._renderer; var renderTarget = renderer.renderTarget.getRenderTarget(texture); var glRenterTarget = renderer.renderTarget.getGpuRenderTarget(renderTarget); var gl = renderer.gl; gl.bindFramebuffer(gl.FRAMEBUFFER, glRenterTarget.resolveTargetFramebuffer); gl.readPixels(Math.round(frame.x * resolution), Math.round(frame.y * resolution), width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); if (false) // removed by dead control flow {} return { pixels: new Uint8ClampedArray(pixels.buffer), width: width, height: height }; } }, { key: "destroy", value: function destroy() { var _this = this; this.managedTextures.slice().forEach(function (source) { return _this.onSourceDestroy(source); }); this.managedTextures = null; this._renderer = null; } }, { key: "resetState", value: function resetState() { this._activeTextureLocation = -1; this._boundTextures.fill(Texture.Texture.EMPTY.source); this._boundSamplers = /* @__PURE__ */Object.create(null); } }]); }(); /** @ignore */ GlTextureSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem], name: "texture" }; exports.GlTextureSystem = GlTextureSystem; /***/ }), /***/ 90844: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var uidCache = { "default": -1 }; function uid() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "default"; if (uidCache[name] === void 0) { uidCache[name] = -1; } return ++uidCache[name]; } function resetUids() { for (var key in uidCache) { delete uidCache[key]; } } exports.resetUids = resetUids; exports.uid = uid; /***/ }), /***/ 90882: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var SoftLightBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function SoftLightBlend() { _classCallCheck(this, SoftLightBlend); return _callSuper(this, SoftLightBlend, [{ gl: { functions: "\n float softLight(float base, float blend)\n {\n return (blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));\n }\n\n vec3 blendSoftLight(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n softLight(base.r, blend.r),\n softLight(base.g, blend.g),\n softLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn softLight(base: f32, blend: f32) -> f32\n {\n return select(2.0 * base * blend + base * base * (1.0 - 2.0 * blend), sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend), blend < 0.5);\n }\n\n fn blendSoftLight(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>\n {\n let blended: vec3<f32> = vec3<f32>(\n softLight(base.r, blend.r),\n softLight(base.g, blend.g),\n softLight(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(SoftLightBlend, _BlendModeFilter$Blen); return _createClass(SoftLightBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ SoftLightBlend.extension = { name: "soft-light", type: Extensions.ExtensionType.BlendMode }; exports.SoftLightBlend = SoftLightBlend; /***/ }), /***/ 90914: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 91058: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Point = __webpack_require__(75544); var uid = __webpack_require__(90844); var warn = __webpack_require__(57371); var parseSVGPath = __webpack_require__(91281); var ShapePath = __webpack_require__(71012); "use strict"; var GraphicsPath = /*#__PURE__*/function () { /** * Creates a `GraphicsPath` instance optionally from an SVG path string or an array of `PathInstruction`. * @param instructions - An SVG path string or an array of `PathInstruction` objects. * @param signed */ function GraphicsPath(instructions) { var signed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; _classCallCheck(this, GraphicsPath); this.instructions = []; /** unique id for this graphics path */ this.uid = uid.uid("graphicsPath"); this._dirty = true; this.checkForHoles = signed; if (typeof instructions === "string") { parseSVGPath.parseSVGPath(instructions, this); } else { var _instructions$slice; this.instructions = (_instructions$slice = instructions === null || instructions === void 0 ? void 0 : instructions.slice()) !== null && _instructions$slice !== void 0 ? _instructions$slice : []; } } /** * Provides access to the internal shape path, ensuring it is up-to-date with the current instructions. * @returns The `ShapePath` instance associated with this `GraphicsPath`. */ return _createClass(GraphicsPath, [{ key: "shapePath", get: function get() { if (!this._shapePath) { this._shapePath = new ShapePath.ShapePath(this); } if (this._dirty) { this._dirty = false; this._shapePath.buildPath(); } return this._shapePath; } /** * Adds another `GraphicsPath` to this path, optionally applying a transformation. * @param path - The `GraphicsPath` to add. * @param transform - An optional transformation to apply to the added path. * @returns The instance of the current object for chaining. */ }, { key: "addPath", value: function addPath(path, transform) { path = path.clone(); this.instructions.push({ action: "addPath", data: [path, transform] }); this._dirty = true; return this; } }, { key: "arc", value: function arc() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } this.instructions.push({ action: "arc", data: args }); this._dirty = true; return this; } }, { key: "arcTo", value: function arcTo() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } this.instructions.push({ action: "arcTo", data: args }); this._dirty = true; return this; } }, { key: "arcToSvg", value: function arcToSvg() { for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } this.instructions.push({ action: "arcToSvg", data: args }); this._dirty = true; return this; } }, { key: "bezierCurveTo", value: function bezierCurveTo() { for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } this.instructions.push({ action: "bezierCurveTo", data: args }); this._dirty = true; return this; } /** * Adds a cubic Bezier curve to the path. * It requires two points: the second control point and the end point. The first control point is assumed to be * The starting point is the last point in the current path. * @param cp2x - The x-coordinate of the second control point. * @param cp2y - The y-coordinate of the second control point. * @param x - The x-coordinate of the end point. * @param y - The y-coordinate of the end point. * @param smoothness - Optional parameter to adjust the smoothness of the curve. * @returns The instance of the current object for chaining. */ }, { key: "bezierCurveToShort", value: function bezierCurveToShort(cp2x, cp2y, x, y, smoothness) { var last = this.instructions[this.instructions.length - 1]; var lastPoint = this.getLastPoint(Point.Point.shared); var cp1x = 0; var cp1y = 0; if (!last || last.action !== "bezierCurveTo") { cp1x = lastPoint.x; cp1y = lastPoint.y; } else { cp1x = last.data[2]; cp1y = last.data[3]; var currentX = lastPoint.x; var currentY = lastPoint.y; cp1x = currentX + (currentX - cp1x); cp1y = currentY + (currentY - cp1y); } this.instructions.push({ action: "bezierCurveTo", data: [cp1x, cp1y, cp2x, cp2y, x, y, smoothness] }); this._dirty = true; return this; } /** * Closes the current path by drawing a straight line back to the start. * If the shape is already closed or there are no points in the path, this method does nothing. * @returns The instance of the current object for chaining. */ }, { key: "closePath", value: function closePath() { this.instructions.push({ action: "closePath", data: [] }); this._dirty = true; return this; } }, { key: "ellipse", value: function ellipse() { for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } this.instructions.push({ action: "ellipse", data: args }); this._dirty = true; return this; } }, { key: "lineTo", value: function lineTo() { for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6]; } this.instructions.push({ action: "lineTo", data: args }); this._dirty = true; return this; } }, { key: "moveTo", value: function moveTo() { for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { args[_key7] = arguments[_key7]; } this.instructions.push({ action: "moveTo", data: args }); return this; } }, { key: "quadraticCurveTo", value: function quadraticCurveTo() { for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { args[_key8] = arguments[_key8]; } this.instructions.push({ action: "quadraticCurveTo", data: args }); this._dirty = true; return this; } /** * Adds a quadratic curve to the path. It uses the previous point as the control point. * @param x - The x-coordinate of the end point. * @param y - The y-coordinate of the end point. * @param smoothness - Optional parameter to adjust the smoothness of the curve. * @returns The instance of the current object for chaining. */ }, { key: "quadraticCurveToShort", value: function quadraticCurveToShort(x, y, smoothness) { var last = this.instructions[this.instructions.length - 1]; var lastPoint = this.getLastPoint(Point.Point.shared); var cpx1 = 0; var cpy1 = 0; if (!last || last.action !== "quadraticCurveTo") { cpx1 = lastPoint.x; cpy1 = lastPoint.y; } else { cpx1 = last.data[0]; cpy1 = last.data[1]; var currentX = lastPoint.x; var currentY = lastPoint.y; cpx1 = currentX + (currentX - cpx1); cpy1 = currentY + (currentY - cpy1); } this.instructions.push({ action: "quadraticCurveTo", data: [cpx1, cpy1, x, y, smoothness] }); this._dirty = true; return this; } /** * Draws a rectangle shape. This method adds a new rectangle path to the current drawing. * @param x - The x-coordinate of the top-left corner of the rectangle. * @param y - The y-coordinate of the top-left corner of the rectangle. * @param w - The width of the rectangle. * @param h - The height of the rectangle. * @param transform - An optional `Matrix` object to apply a transformation to the rectangle. * @returns The instance of the current object for chaining. */ }, { key: "rect", value: function rect(x, y, w, h, transform) { this.instructions.push({ action: "rect", data: [x, y, w, h, transform] }); this._dirty = true; return this; } /** * Draws a circle shape. This method adds a new circle path to the current drawing. * @param x - The x-coordinate of the center of the circle. * @param y - The y-coordinate of the center of the circle. * @param radius - The radius of the circle. * @param transform - An optional `Matrix` object to apply a transformation to the circle. * @returns The instance of the current object for chaining. */ }, { key: "circle", value: function circle(x, y, radius, transform) { this.instructions.push({ action: "circle", data: [x, y, radius, transform] }); this._dirty = true; return this; } }, { key: "roundRect", value: function roundRect() { for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { args[_key9] = arguments[_key9]; } this.instructions.push({ action: "roundRect", data: args }); this._dirty = true; return this; } }, { key: "poly", value: function poly() { for (var _len0 = arguments.length, args = new Array(_len0), _key0 = 0; _key0 < _len0; _key0++) { args[_key0] = arguments[_key0]; } this.instructions.push({ action: "poly", data: args }); this._dirty = true; return this; } }, { key: "regularPoly", value: function regularPoly() { for (var _len1 = arguments.length, args = new Array(_len1), _key1 = 0; _key1 < _len1; _key1++) { args[_key1] = arguments[_key1]; } this.instructions.push({ action: "regularPoly", data: args }); this._dirty = true; return this; } }, { key: "roundPoly", value: function roundPoly() { for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { args[_key10] = arguments[_key10]; } this.instructions.push({ action: "roundPoly", data: args }); this._dirty = true; return this; } }, { key: "roundShape", value: function roundShape() { for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { args[_key11] = arguments[_key11]; } this.instructions.push({ action: "roundShape", data: args }); this._dirty = true; return this; } }, { key: "filletRect", value: function filletRect() { for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { args[_key12] = arguments[_key12]; } this.instructions.push({ action: "filletRect", data: args }); this._dirty = true; return this; } }, { key: "chamferRect", value: function chamferRect() { for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) { args[_key13] = arguments[_key13]; } this.instructions.push({ action: "chamferRect", data: args }); this._dirty = true; return this; } /** * Draws a star shape centered at a specified location. This method allows for the creation * of stars with a variable number of points, outer radius, optional inner radius, and rotation. * The star is drawn as a closed polygon with alternating outer and inner vertices to create the star's points. * An optional transformation can be applied to scale, rotate, or translate the star as needed. * @param x - The x-coordinate of the center of the star. * @param y - The y-coordinate of the center of the star. * @param points - The number of points of the star. * @param radius - The outer radius of the star (distance from the center to the outer points). * @param innerRadius - Optional. The inner radius of the star * (distance from the center to the inner points between the outer points). * If not provided, defaults to half of the `radius`. * @param rotation - Optional. The rotation of the star in radians, where 0 is aligned with the y-axis. * Defaults to 0, meaning one point is directly upward. * @param transform - An optional `Matrix` object to apply a transformation to the star. * This can include rotations, scaling, and translations. * @returns The instance of the current object for chaining further drawing commands. */ // eslint-disable-next-line max-len }, { key: "star", value: function star(x, y, points, radius, innerRadius, rotation, transform) { innerRadius || (innerRadius = radius / 2); var startAngle = -1 * Math.PI / 2 + rotation; var len = points * 2; var delta = Math.PI * 2 / len; var polygon = []; for (var i = 0; i < len; i++) { var r = i % 2 ? innerRadius : radius; var angle = i * delta + startAngle; polygon.push(x + r * Math.cos(angle), y + r * Math.sin(angle)); } this.poly(polygon, true, transform); return this; } /** * Creates a copy of the current `GraphicsPath` instance. This method supports both shallow and deep cloning. * A shallow clone copies the reference of the instructions array, while a deep clone creates a new array and * copies each instruction individually, ensuring that modifications to the instructions of the cloned `GraphicsPath` * do not affect the original `GraphicsPath` and vice versa. * @param deep - A boolean flag indicating whether the clone should be deep. * @returns A new `GraphicsPath` instance that is a clone of the current instance. */ }, { key: "clone", value: function clone() { var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var newGraphicsPath2D = new GraphicsPath(); newGraphicsPath2D.checkForHoles = this.checkForHoles; if (!deep) { newGraphicsPath2D.instructions = this.instructions.slice(); } else { for (var i = 0; i < this.instructions.length; i++) { var instruction = this.instructions[i]; newGraphicsPath2D.instructions.push({ action: instruction.action, data: instruction.data.slice() }); } } return newGraphicsPath2D; } }, { key: "clear", value: function clear() { this.instructions.length = 0; this._dirty = true; return this; } /** * Applies a transformation matrix to all drawing instructions within the `GraphicsPath`. * This method enables the modification of the path's geometry according to the provided * transformation matrix, which can include translations, rotations, scaling, and skewing. * * Each drawing instruction in the path is updated to reflect the transformation, * ensuring the visual representation of the path is consistent with the applied matrix. * * Note: The transformation is applied directly to the coordinates and control points of the drawing instructions, * not to the path as a whole. This means the transformation's effects are baked into the individual instructions, * allowing for fine-grained control over the path's appearance. * @param matrix - A `Matrix` object representing the transformation to apply. * @returns The instance of the current object for chaining further operations. */ }, { key: "transform", value: function transform(matrix) { if (matrix.isIdentity()) return this; var a = matrix.a; var b = matrix.b; var c = matrix.c; var d = matrix.d; var tx = matrix.tx; var ty = matrix.ty; var x = 0; var y = 0; var cpx1 = 0; var cpy1 = 0; var cpx2 = 0; var cpy2 = 0; var rx = 0; var ry = 0; for (var i = 0; i < this.instructions.length; i++) { var instruction = this.instructions[i]; var data = instruction.data; switch (instruction.action) { case "moveTo": case "lineTo": x = data[0]; y = data[1]; data[0] = a * x + c * y + tx; data[1] = b * x + d * y + ty; break; case "bezierCurveTo": cpx1 = data[0]; cpy1 = data[1]; cpx2 = data[2]; cpy2 = data[3]; x = data[4]; y = data[5]; data[0] = a * cpx1 + c * cpy1 + tx; data[1] = b * cpx1 + d * cpy1 + ty; data[2] = a * cpx2 + c * cpy2 + tx; data[3] = b * cpx2 + d * cpy2 + ty; data[4] = a * x + c * y + tx; data[5] = b * x + d * y + ty; break; case "quadraticCurveTo": cpx1 = data[0]; cpy1 = data[1]; x = data[2]; y = data[3]; data[0] = a * cpx1 + c * cpy1 + tx; data[1] = b * cpx1 + d * cpy1 + ty; data[2] = a * x + c * y + tx; data[3] = b * x + d * y + ty; break; case "arcToSvg": x = data[5]; y = data[6]; rx = data[0]; ry = data[1]; data[0] = a * rx + c * ry; data[1] = b * rx + d * ry; data[5] = a * x + c * y + tx; data[6] = b * x + d * y + ty; break; case "circle": data[4] = adjustTransform(data[3], matrix); break; case "rect": data[4] = adjustTransform(data[4], matrix); break; case "ellipse": data[8] = adjustTransform(data[8], matrix); break; case "roundRect": data[5] = adjustTransform(data[5], matrix); break; case "addPath": data[0].transform(matrix); break; case "poly": data[2] = adjustTransform(data[2], matrix); break; default: warn.warn("unknown transform action", instruction.action); break; } } this._dirty = true; return this; } }, { key: "bounds", get: function get() { return this.shapePath.bounds; } /** * Retrieves the last point from the current drawing instructions in the `GraphicsPath`. * This method is useful for operations that depend on the path's current endpoint, * such as connecting subsequent shapes or paths. It supports various drawing instructions, * ensuring the last point's position is accurately determined regardless of the path's complexity. * * If the last instruction is a `closePath`, the method iterates backward through the instructions * until it finds an actionable instruction that defines a point (e.g., `moveTo`, `lineTo`, * `quadraticCurveTo`, etc.). For compound paths added via `addPath`, it recursively retrieves * the last point from the nested path. * @param out - A `Point` object where the last point's coordinates will be stored. * This object is modified directly to contain the result. * @returns The `Point` object containing the last point's coordinates. */ }, { key: "getLastPoint", value: function getLastPoint(out) { var index = this.instructions.length - 1; var lastInstruction = this.instructions[index]; if (!lastInstruction) { out.x = 0; out.y = 0; return out; } while (lastInstruction.action === "closePath") { index--; if (index < 0) { out.x = 0; out.y = 0; return out; } lastInstruction = this.instructions[index]; } switch (lastInstruction.action) { case "moveTo": case "lineTo": out.x = lastInstruction.data[0]; out.y = lastInstruction.data[1]; break; case "quadraticCurveTo": out.x = lastInstruction.data[2]; out.y = lastInstruction.data[3]; break; case "bezierCurveTo": out.x = lastInstruction.data[4]; out.y = lastInstruction.data[5]; break; case "arc": case "arcToSvg": out.x = lastInstruction.data[5]; out.y = lastInstruction.data[6]; break; case "addPath": lastInstruction.data[0].getLastPoint(out); break; } return out; } }]); }(); function adjustTransform(currentMatrix, transform) { if (currentMatrix) { return currentMatrix.prepend(transform); } return transform.clone(); } exports.GraphicsPath = GraphicsPath; /***/ }), /***/ 91131: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = safeThrow; function safeThrow(error) { var func = function func() { if (error.stack) { try { error.message += '\n' + error.stack; } catch (e) { //can not modify message } } throw error; }; if (window.Thread && window.Thread.setTimeout) { window.Thread.setTimeout({ func: func, time: 1, type: 'background', args: [], stack: error.stack || "" }); } else { setTimeout(func, 1); } } /***/ }), /***/ 91208: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var isSingleItem = function isSingleItem(item) { return !Array.isArray(item); }; exports.isSingleItem = isSingleItem; /***/ }), /***/ 91281: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var parse = __webpack_require__(41794); var warn = __webpack_require__(57371); "use strict"; function parseSVGPath(svgPath, path) { var commands = parse(svgPath); var subpaths = []; var currentSubPath = null; var lastX = 0; var lastY = 0; for (var i = 0; i < commands.length; i++) { var command = commands[i]; var type = command[0]; var data = command; switch (type) { case "M": lastX = data[1]; lastY = data[2]; path.moveTo(lastX, lastY); break; case "m": lastX += data[1]; lastY += data[2]; path.moveTo(lastX, lastY); break; case "H": lastX = data[1]; path.lineTo(lastX, lastY); break; case "h": lastX += data[1]; path.lineTo(lastX, lastY); break; case "V": lastY = data[1]; path.lineTo(lastX, lastY); break; case "v": lastY += data[1]; path.lineTo(lastX, lastY); break; case "L": lastX = data[1]; lastY = data[2]; path.lineTo(lastX, lastY); break; case "l": lastX += data[1]; lastY += data[2]; path.lineTo(lastX, lastY); break; case "C": lastX = data[5]; lastY = data[6]; path.bezierCurveTo(data[1], data[2], // First control point data[3], data[4], // Second control point lastX, lastY // End point ); break; case "c": path.bezierCurveTo(lastX + data[1], lastY + data[2], // First control point lastX + data[3], lastY + data[4], // Second control point lastX + data[5], lastY + data[6] // End point ); lastX += data[5]; lastY += data[6]; break; case "S": lastX = data[3]; lastY = data[4]; path.bezierCurveToShort(data[1], data[2], // Control point lastX, lastY // End point ); break; case "s": path.bezierCurveToShort(lastX + data[1], lastY + data[2], // Control point lastX + data[3], lastY + data[4] // End point ); lastX += data[3]; lastY += data[4]; break; case "Q": lastX = data[3]; lastY = data[4]; path.quadraticCurveTo(data[1], data[2], // Control point lastX, lastY // End point ); break; case "q": path.quadraticCurveTo(lastX + data[1], lastY + data[2], // Control point lastX + data[3], lastY + data[4] // End point ); lastX += data[3]; lastY += data[4]; break; case "T": lastX = data[1]; lastY = data[2]; path.quadraticCurveToShort(lastX, lastY // End point ); break; case "t": lastX += data[1]; lastY += data[2]; path.quadraticCurveToShort(lastX, lastY // End point ); break; case "A": lastX = data[6]; lastY = data[7]; path.arcToSvg(data[1], // rx data[2], // ry data[3], // x-axis-rotation data[4], // large-arc-flag data[5], // sweep-flag lastX, lastY // End point ); break; case "a": lastX += data[6]; lastY += data[7]; path.arcToSvg(data[1], // rx data[2], // ry data[3], // x-axis-rotation data[4], // large-arc-flag data[5], // sweep-flag lastX, lastY // End point ); break; case "Z": case "z": path.closePath(); if (subpaths.length > 0) { currentSubPath = subpaths.pop(); if (currentSubPath) { lastX = currentSubPath.startX; lastY = currentSubPath.startY; } else { lastX = 0; lastY = 0; } } currentSubPath = null; break; default: warn.warn("Unknown SVG path command: ".concat(type)); } if (type !== "Z" && type !== "z") { if (currentSubPath === null) { currentSubPath = { startX: lastX, startY: lastY }; subpaths.push(currentSubPath); } } } return path; } exports.parseSVGPath = parseSVGPath; /***/ }), /***/ 91291: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _DPTokenizer = _interopRequireDefault(__webpack_require__(98687)); var _DPParseInstance = _interopRequireDefault(__webpack_require__(82554)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /*** * @typedef Rule * @property {string} target * @property {string[]} elements */ /*** * * @param {{rules?:Array, elementRegexes?:Array}}opt * @constructor */ function DPParser(opt) { opt = opt || {}; if (opt.rules) { this.rules = opt.rules; } this.targets = {}; this.tokenizer = new _DPTokenizer["default"](opt); this.computeTarget(); } /**** * @type {Rule[]} */ DPParser.prototype.rules = []; DPParser.prototype.computeTarget = function () { this.rules.reduce(function (ac, rule) { var target = ac[rule.target]; if (!target) { target = { rules: [] }; ac[rule.target] = target; } target.rules.push(rule); return ac; }, this.targets); }; /*** * * @param {string|[]}source * @param target * @returns {DPParseInstance} */ DPParser.prototype.parse = function (source, target) { return new _DPParseInstance["default"](this, source, target); }; var _default = exports["default"] = DPParser; /***/ }), /***/ 91494: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fileExist = fileExist; exports.saveAs = saveAs; exports.saveTextAs = saveTextAs; var _BrowserDetector = _interopRequireDefault(__webpack_require__(14233)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /*** * @typedef {{revokeTimeout?: number, autoBom?:boolean }} FileSaverOpts * */ function fileExist(url) { var xhr = new XMLHttpRequest(); xhr.open('HEAD', url, true); return new Promise(function (resolve) { xhr.onreadystatechange = function () { if (this.readyState === 4) { resolve(xhr.status === 200); } }; xhr.onerror = function (err) {}; xhr.send(); }); } /*** * * @param url * @param name * @param {FileSaverOpts} opts */ function download(url, name, opts) { var xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.responseType = 'blob'; xhr.onload = function () { saveAs(xhr.response, name, opts); }; xhr.onerror = function () { console.error('Could not download: ' + url); }; xhr.send(null); } function bom(blob, opts) { if (_typeof(opts) === undefined) opts = { autoBom: false };else if (_typeof(opts) !== 'object') opts = { autoBom: !opts }; if (opts.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { return new Blob([String.fromCharCode(0xFEFF), blob], { type: blob.type }); } return blob; } function corsEnabled(url) { var xhr = new XMLHttpRequest(); return new Promise(function (resolve) { xhr.onload = function () { resolve(xhr.status >= 200 && xhr.status < 299); }; xhr.onerror = function () { resolve(xhr.status >= 200 && xhr.status < 299); }; xhr.open('HEAD', url, true); xhr.send(); }); } function click(node) { try { node.dispatchEvent(new MouseEvent('click')); } catch (e) { var evt = document.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); node.dispatchEvent(evt); } } function normalSaveAs(blob, name, opts) { var URL = window.URL || window.webkitURL; var a = document.createElement('a'); name = name || blob.name || 'download'; a.download = name; a.rel = 'noopener'; if (typeof blob === 'string') { a.href = blob; if (a.origin !== location.origin) { corsEnabled(a.href).then(function (result) { if (result) { download(blob, name, opts); } else { a.target = '_blank'; click(a); } }); } else { click(a); } } else { a.href = URL.createObjectURL(blob); setTimeout(function () {}, opts && opts.revokeTimeout || 4E4); setTimeout(function () { click(a); }, 0); } } function msSaveAs(blob, name, opts) { name = name || blob.name || 'download'; if (typeof blob === 'string') { corsEnabled(blob).then(function (result) { if (result) { download(blob, name, opts); } else { var a = document.createElement('a'); a.href = blob; a.target = '_blank'; setTimeout(function () { click(a); }); } }); } else { navigator.msSaveOrOpenBlob(bom(blob, opts), name); } } function popupSaveAs(blob, name, opts, popup) { if (typeof blob === 'string') { download(blob, name, opts); return; } popup = popup || open('', '_blank'); if (popup) { popup.document.title = name || 'download'; popup.document.body.innerText = "downloading..."; } name = name || blob.name || 'download'; blob.name = name; var force = blob.type === 'application/octet-stream'; var isSafari = _BrowserDetector["default"].isSafari; var isChromeIOS = _BrowserDetector["default"].isChromeIOS; var isMacOSWebView = _BrowserDetector["default"].isMacOSWebView; var isSafariUnder13 = _BrowserDetector["default"].browser.type === 'safari' && parseFloat(_BrowserDetector["default"].browser.version) < 13; if ((!isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== 'undefined' & !isSafariUnder13) { var reader = new FileReader(); reader.onloadend = function () { var url = reader.result; url = isChromeIOS ? url : url.replace(/^data:[^;]*/, 'data:attachment/file'); if (popup) popup.location.href = url;else location = url; popup = null; }; reader.readAsDataURL(blob); } else { var URL = window.URL || window.webkitURL; var url = URL.createObjectURL(blob); if (popup) popup.location.href = url;else location.href = url; popup = null; setTimeout(function () { URL.revokeObjectURL(blob); }, opts && opts.revokeTimeout || 4E4); } } /*** * * @param {string | File | Blob}blob * @param {string=} name * @param {Object=} opts * @param {Object=} popup */ function saveAs(blob, name, opts, popup) { if ((typeof window === "undefined" ? "undefined" : _typeof(window)) !== "object" || window !== self) { console.error("FileSaver is not support!"); } else if ('wkSaveAs' in navigator) { navigator.wkSaveAs(blob, name, opts); } else if ('download' in HTMLAnchorElement.prototype && !_BrowserDetector["default"].isMacOSWebView) { normalSaveAs(blob, name, opts); } else if ('msSaveOrOpenBlob' in navigator) { msSaveAs(blob, name, opts); } else { setTimeout(function () { popupSaveAs(blob, name, opts, popup); }, 100); } } function saveTextAs(text, name, opts) { var blob = new Blob([text], { type: 'text/plain' }); saveAs(blob, name, opts); } /***/ }), /***/ 91743: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Buffer = __webpack_require__(59832); var _const = __webpack_require__(33843); var Geometry = __webpack_require__(18964); var getAttributeInfoFromFormat = __webpack_require__(63421); var ViewableBuffer = __webpack_require__(73803); var createIndicesForQuads = __webpack_require__(33925); var generateParticleUpdateFunction = __webpack_require__(34413); "use strict"; var ParticleBuffer = /*#__PURE__*/function () { function ParticleBuffer(options) { var _options$size; _classCallCheck(this, ParticleBuffer); this._size = 0; this._generateParticleUpdateCache = {}; var size = this._size = (_options$size = options.size) !== null && _options$size !== void 0 ? _options$size : 1e3; var properties = options.properties; var staticVertexSize = 0; var dynamicVertexSize = 0; for (var i in properties) { var property = properties[i]; var attributeInfo = getAttributeInfoFromFormat.getAttributeInfoFromFormat(property.format); if (property.dynamic) { dynamicVertexSize += attributeInfo.stride; } else { staticVertexSize += attributeInfo.stride; } } this._dynamicStride = dynamicVertexSize / 4; this._staticStride = staticVertexSize / 4; this.staticAttributeBuffer = new ViewableBuffer.ViewableBuffer(size * 4 * staticVertexSize); this.dynamicAttributeBuffer = new ViewableBuffer.ViewableBuffer(size * 4 * dynamicVertexSize); this.indexBuffer = createIndicesForQuads.createIndicesForQuads(size); var geometry = new Geometry.Geometry(); var dynamicOffset = 0; var staticOffset = 0; this._staticBuffer = new Buffer.Buffer({ data: new Float32Array(1), label: "static-particle-buffer", shrinkToFit: false, usage: _const.BufferUsage.VERTEX | _const.BufferUsage.COPY_DST }); this._dynamicBuffer = new Buffer.Buffer({ data: new Float32Array(1), label: "dynamic-particle-buffer", shrinkToFit: false, usage: _const.BufferUsage.VERTEX | _const.BufferUsage.COPY_DST }); for (var _i in properties) { var _property = properties[_i]; var _attributeInfo = getAttributeInfoFromFormat.getAttributeInfoFromFormat(_property.format); if (_property.dynamic) { geometry.addAttribute(_property.attributeName, { buffer: this._dynamicBuffer, stride: this._dynamicStride * 4, offset: dynamicOffset * 4, format: _property.format }); dynamicOffset += _attributeInfo.size; } else { geometry.addAttribute(_property.attributeName, { buffer: this._staticBuffer, stride: this._staticStride * 4, offset: staticOffset * 4, format: _property.format }); staticOffset += _attributeInfo.size; } } geometry.addIndex(this.indexBuffer); var uploadFunction = this.getParticleUpdate(properties); this._dynamicUpload = uploadFunction.dynamicUpdate; this._staticUpload = uploadFunction.staticUpdate; this.geometry = geometry; } return _createClass(ParticleBuffer, [{ key: "getParticleUpdate", value: function getParticleUpdate(properties) { var key = getParticleSyncKey(properties); if (this._generateParticleUpdateCache[key]) { return this._generateParticleUpdateCache[key]; } this._generateParticleUpdateCache[key] = this.generateParticleUpdate(properties); return this._generateParticleUpdateCache[key]; } }, { key: "generateParticleUpdate", value: function generateParticleUpdate(properties) { return generateParticleUpdateFunction.generateParticleUpdateFunction(properties); } }, { key: "update", value: function update(particles, uploadStatic) { if (particles.length > this._size) { uploadStatic = true; this._size = Math.max(particles.length, this._size * 1.5 | 0); this.staticAttributeBuffer = new ViewableBuffer.ViewableBuffer(this._size * this._staticStride * 4 * 4); this.dynamicAttributeBuffer = new ViewableBuffer.ViewableBuffer(this._size * this._dynamicStride * 4 * 4); this.indexBuffer = createIndicesForQuads.createIndicesForQuads(this._size); this.geometry.indexBuffer.setDataWithSize(this.indexBuffer, this.indexBuffer.byteLength, true); } var dynamicAttributeBuffer = this.dynamicAttributeBuffer; this._dynamicUpload(particles, dynamicAttributeBuffer.float32View, dynamicAttributeBuffer.uint32View); this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View, particles.length * this._dynamicStride * 4, true); if (uploadStatic) { var staticAttributeBuffer = this.staticAttributeBuffer; this._staticUpload(particles, staticAttributeBuffer.float32View, staticAttributeBuffer.uint32View); this._staticBuffer.setDataWithSize(staticAttributeBuffer.float32View, particles.length * this._staticStride * 4, true); } } }, { key: "destroy", value: function destroy() { this._staticBuffer.destroy(); this._dynamicBuffer.destroy(); this.geometry.destroy(); } }]); }(); function getParticleSyncKey(properties) { var keyGen = []; for (var key in properties) { var property = properties[key]; keyGen.push(key, property.code, property.dynamic ? "d" : "s"); } return keyGen.join("_"); } exports.ParticleBuffer = ParticleBuffer; /***/ }), /***/ 91938: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var Batcher = __webpack_require__(55403); var BatchGeometry = __webpack_require__(31932); var DefaultShader = __webpack_require__(51080); "use strict"; var defaultShader = null; var _DefaultBatcher = /*#__PURE__*/function (_Batcher$Batcher) { function _DefaultBatcher() { var _this; _classCallCheck(this, _DefaultBatcher); _this = _callSuper(this, _DefaultBatcher, arguments); _this.geometry = new BatchGeometry.BatchGeometry(); _this.shader = defaultShader || (defaultShader = new DefaultShader.DefaultShader(_this.maxTextures)); _this.name = _DefaultBatcher.extension.name; /** The size of one attribute. 1 = 32 bit. x, y, u, v, color, textureIdAndRound -> total = 6 */ _this.vertexSize = 6; return _this; } /** * Packs the attributes of a DefaultBatchableMeshElement into the provided views. * @param element - The DefaultBatchableMeshElement to pack. * @param float32View - The Float32Array view to pack into. * @param uint32View - The Uint32Array view to pack into. * @param index - The starting index in the views. * @param textureId - The texture ID to use. */ _inherits(_DefaultBatcher, _Batcher$Batcher); return _createClass(_DefaultBatcher, [{ key: "packAttributes", value: function packAttributes(element, float32View, uint32View, index, textureId) { var textureIdAndRound = textureId << 16 | element.roundPixels & 65535; var wt = element.transform; var a = wt.a; var b = wt.b; var c = wt.c; var d = wt.d; var tx = wt.tx; var ty = wt.ty; var positions = element.positions, uvs = element.uvs; var argb = element.color; var offset = element.attributeOffset; var end = offset + element.attributeSize; for (var i = offset; i < end; i++) { var i2 = i * 2; var x = positions[i2]; var y = positions[i2 + 1]; float32View[index++] = a * x + c * y + tx; float32View[index++] = d * y + b * x + ty; float32View[index++] = uvs[i2]; float32View[index++] = uvs[i2 + 1]; uint32View[index++] = argb; uint32View[index++] = textureIdAndRound; } } /** * Packs the attributes of a DefaultBatchableQuadElement into the provided views. * @param element - The DefaultBatchableQuadElement to pack. * @param float32View - The Float32Array view to pack into. * @param uint32View - The Uint32Array view to pack into. * @param index - The starting index in the views. * @param textureId - The texture ID to use. */ }, { key: "packQuadAttributes", value: function packQuadAttributes(element, float32View, uint32View, index, textureId) { var texture = element.texture; var wt = element.transform; var a = wt.a; var b = wt.b; var c = wt.c; var d = wt.d; var tx = wt.tx; var ty = wt.ty; var bounds = element.bounds; var w0 = bounds.maxX; var w1 = bounds.minX; var h0 = bounds.maxY; var h1 = bounds.minY; var uvs = texture.uvs; var argb = element.color; var textureIdAndRound = textureId << 16 | element.roundPixels & 65535; float32View[index + 0] = a * w1 + c * h1 + tx; float32View[index + 1] = d * h1 + b * w1 + ty; float32View[index + 2] = uvs.x0; float32View[index + 3] = uvs.y0; uint32View[index + 4] = argb; uint32View[index + 5] = textureIdAndRound; float32View[index + 6] = a * w0 + c * h1 + tx; float32View[index + 7] = d * h1 + b * w0 + ty; float32View[index + 8] = uvs.x1; float32View[index + 9] = uvs.y1; uint32View[index + 10] = argb; uint32View[index + 11] = textureIdAndRound; float32View[index + 12] = a * w0 + c * h0 + tx; float32View[index + 13] = d * h0 + b * w0 + ty; float32View[index + 14] = uvs.x2; float32View[index + 15] = uvs.y2; uint32View[index + 16] = argb; uint32View[index + 17] = textureIdAndRound; float32View[index + 18] = a * w1 + c * h0 + tx; float32View[index + 19] = d * h0 + b * w1 + ty; float32View[index + 20] = uvs.x3; float32View[index + 21] = uvs.y3; uint32View[index + 22] = argb; uint32View[index + 23] = textureIdAndRound; } }]); }(Batcher.Batcher); /** @ignore */ _DefaultBatcher.extension = { type: [Extensions.ExtensionType.Batcher], name: "default" }; var DefaultBatcher = _DefaultBatcher; exports.DefaultBatcher = DefaultBatcher; /***/ }), /***/ 91945: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function getSVGUrl(text, style, resolution, fontCSS, htmlTextData) { var domElement = htmlTextData.domElement, styleElement = htmlTextData.styleElement, svgRoot = htmlTextData.svgRoot; domElement.innerHTML = "<style>".concat(style.cssStyle, "</style><div style='padding:0;'>").concat(text, "</div>"); domElement.setAttribute("style", "transform: scale(".concat(resolution, ");transform-origin: top left; display: inline-block")); styleElement.textContent = fontCSS; var _htmlTextData$image = htmlTextData.image, width = _htmlTextData$image.width, height = _htmlTextData$image.height; svgRoot.setAttribute("width", width.toString()); svgRoot.setAttribute("height", height.toString()); return new XMLSerializer().serializeToString(svgRoot); } exports.getSVGUrl = getSVGUrl; /***/ }), /***/ 92393: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["gpu", "gl"]; function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var Shader = __webpack_require__(27866); var State = __webpack_require__(84938); "use strict"; var _Filter = /*#__PURE__*/function (_Shader$Shader) { /** * @param options - The optional parameters of this filter. */ function _Filter(options) { var _this; _classCallCheck(this, _Filter); options = _objectSpread(_objectSpread({}, _Filter.defaultOptions), options); _this = _callSuper(this, _Filter, [options]); /** If enabled is true the filter is applied, if false it will not. */ _this.enabled = true; /** * The gpu state the filter requires to render. * @internal * @ignore */ _this._state = State.State.for2d(); _this.blendMode = options.blendMode; _this.padding = options.padding; if (typeof options.antialias === "boolean") { _this.antialias = options.antialias ? "on" : "off"; } else { _this.antialias = options.antialias; } _this.resolution = options.resolution; _this.blendRequired = options.blendRequired; _this.clipToViewport = options.clipToViewport; _this.addResource("uTexture", 0, 1); return _this; } /** * Applies the filter * @param filterManager - The renderer to retrieve the filter from * @param input - The input render target. * @param output - The target to output to. * @param clearMode - Should the output be cleared before rendering to it */ _inherits(_Filter, _Shader$Shader); return _createClass(_Filter, [{ key: "apply", value: function apply(filterManager, input, output, clearMode) { filterManager.applyFilter(this, input, output, clearMode); } /** * Get the blend mode of the filter. * @default "normal" */ }, { key: "blendMode", get: function get() { return this._state.blendMode; } /** Sets the blend mode of the filter. */, set: function set(value) { this._state.blendMode = value; } /** * A short hand function to create a filter based of a vertex and fragment shader src. * @param options * @returns A shiny new PixiJS filter! */ }], [{ key: "from", value: function from(options) { var gpu = options.gpu, gl = options.gl, rest = _objectWithoutProperties(options, _excluded); var gpuProgram; var glProgram; if (gpu) { gpuProgram = GpuProgram.GpuProgram.from(gpu); } if (gl) { glProgram = GlProgram.GlProgram.from(gl); } return new _Filter(_objectSpread({ gpuProgram: gpuProgram, glProgram: glProgram }, rest)); } }]); }(Shader.Shader); /** * The default filter settings * @static */ _Filter.defaultOptions = { blendMode: "normal", resolution: 1, padding: 0, antialias: "off", blendRequired: false, clipToViewport: true }; var Filter = _Filter; exports.Filter = Filter; /***/ }), /***/ 92718: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var fragment = "varying vec2 vUV;\nvarying vec4 vColor;\n\nuniform sampler2D uTexture;\n\nvoid main(void){\n vec4 color = texture2D(uTexture, vUV) * vColor;\n gl_FragColor = color;\n}"; exports["default"] = fragment; /***/ }), /***/ 92828: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); "use strict"; var buildRectangle = { extension: { type: Extensions.ExtensionType.ShapeBuilder, name: "rectangle" }, build: function build(shape, points) { var rectData = shape; var x = rectData.x; var y = rectData.y; var width = rectData.width; var height = rectData.height; if (!(width >= 0 && height >= 0)) { return points; } points[0] = x; points[1] = y; points[2] = x + width; points[3] = y; points[4] = x + width; points[5] = y + height; points[6] = x; points[7] = y + height; return points; }, triangulate: function triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) { var count = 0; verticesOffset *= verticesStride; vertices[verticesOffset + count] = points[0]; vertices[verticesOffset + count + 1] = points[1]; count += verticesStride; vertices[verticesOffset + count] = points[2]; vertices[verticesOffset + count + 1] = points[3]; count += verticesStride; vertices[verticesOffset + count] = points[6]; vertices[verticesOffset + count + 1] = points[7]; count += verticesStride; vertices[verticesOffset + count] = points[4]; vertices[verticesOffset + count + 1] = points[5]; count += verticesStride; var verticesIndex = verticesOffset / verticesStride; indices[indicesOffset++] = verticesIndex; indices[indicesOffset++] = verticesIndex + 1; indices[indicesOffset++] = verticesIndex + 2; indices[indicesOffset++] = verticesIndex + 1; indices[indicesOffset++] = verticesIndex + 3; indices[indicesOffset++] = verticesIndex + 2; } }; exports.buildRectangle = buildRectangle; /***/ }), /***/ 92893: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function removeStructAndGroupDuplicates(vertexStructsAndGroups, fragmentStructsAndGroups) { var structNameSet = /* @__PURE__ */new Set(); var dupeGroupKeySet = /* @__PURE__ */new Set(); var structs = [].concat(_toConsumableArray(vertexStructsAndGroups.structs), _toConsumableArray(fragmentStructsAndGroups.structs)).filter(function (struct) { if (structNameSet.has(struct.name)) { return false; } structNameSet.add(struct.name); return true; }); var groups = [].concat(_toConsumableArray(vertexStructsAndGroups.groups), _toConsumableArray(fragmentStructsAndGroups.groups)).filter(function (group) { var key = "".concat(group.name, "-").concat(group.binding); if (dupeGroupKeySet.has(key)) { return false; } dupeGroupKeySet.add(key); return true; }); return { structs: structs, groups: groups }; } exports.removeStructAndGroupDuplicates = removeStructAndGroupDuplicates; /***/ }), /***/ 92989: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var blockDataMap = { "bc1-rgba-unorm": { blockBytes: 8, blockWidth: 4, blockHeight: 4 }, "bc2-rgba-unorm": { blockBytes: 16, blockWidth: 4, blockHeight: 4 }, "bc3-rgba-unorm": { blockBytes: 16, blockWidth: 4, blockHeight: 4 }, "bc7-rgba-unorm": { blockBytes: 16, blockWidth: 4, blockHeight: 4 }, "etc1-rgb-unorm": { blockBytes: 8, blockWidth: 4, blockHeight: 4 }, "etc2-rgba8unorm": { blockBytes: 16, blockWidth: 4, blockHeight: 4 }, "astc-4x4-unorm": { blockBytes: 16, blockWidth: 4, blockHeight: 4 } }; var defaultBlockData = { blockBytes: 4, blockWidth: 1, blockHeight: 1 }; var gpuUploadCompressedTextureResource = { type: "compressed", upload: function upload(source, gpuTexture, gpu) { var mipWidth = source.pixelWidth; var mipHeight = source.pixelHeight; var blockData = blockDataMap[source.format] || defaultBlockData; for (var i = 0; i < source.resource.length; i++) { var levelBuffer = source.resource[i]; var bytesPerRow = Math.ceil(mipWidth / blockData.blockWidth) * blockData.blockBytes; gpu.device.queue.writeTexture({ texture: gpuTexture, mipLevel: i }, levelBuffer, { offset: 0, bytesPerRow: bytesPerRow }, { width: Math.ceil(mipWidth / blockData.blockWidth) * blockData.blockWidth, height: Math.ceil(mipHeight / blockData.blockHeight) * blockData.blockHeight, depthOrArrayLayers: 1 }); mipWidth = Math.max(mipWidth >> 1, 1); mipHeight = Math.max(mipHeight >> 1, 1); } } }; exports.blockDataMap = blockDataMap; exports.gpuUploadCompressedTextureResource = gpuUploadCompressedTextureResource; /***/ }), /***/ 93068: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Pool = /*#__PURE__*/function () { /** * Constructs a new Pool. * @param ClassType - The constructor of the items in the pool. * @param {number} [initialSize] - The initial size of the pool. */ function Pool(ClassType, initialSize) { _classCallCheck(this, Pool); this._pool = []; this._count = 0; this._index = 0; this._classType = ClassType; if (initialSize) { this.prepopulate(initialSize); } } /** * Prepopulates the pool with a given number of items. * @param total - The number of items to add to the pool. */ return _createClass(Pool, [{ key: "prepopulate", value: function prepopulate(total) { for (var i = 0; i < total; i++) { this._pool[this._index++] = new this._classType(); } this._count += total; } /** * Gets an item from the pool. Calls the item's `init` method if it exists. * If there are no items left in the pool, a new one will be created. * @param {unknown} [data] - Optional data to pass to the item's constructor. * @returns {T} The item from the pool. */ }, { key: "get", value: function get(data) { var _item$init, _item; var item; if (this._index > 0) { item = this._pool[--this._index]; } else { item = new this._classType(); } (_item$init = (_item = item).init) === null || _item$init === void 0 || _item$init.call(_item, data); return item; } /** * Returns an item to the pool. Calls the item's `reset` method if it exists. * @param {T} item - The item to return to the pool. */ }, { key: "return", value: function _return(item) { var _item$reset; (_item$reset = item.reset) === null || _item$reset === void 0 || _item$reset.call(item); this._pool[this._index++] = item; } /** * Gets the number of items in the pool. * @readonly * @member {number} */ }, { key: "totalSize", get: function get() { return this._count; } /** * Gets the number of items in the pool that are free to use without needing to create more. * @readonly * @member {number} */ }, { key: "totalFree", get: function get() { return this._index; } /** * Gets the number of items in the pool that are currently in use. * @readonly * @member {number} */ }, { key: "totalUsed", get: function get() { return this._count - this._index; } /** clears the pool - mainly used for debugging! */ }, { key: "clear", value: function clear() { this._pool.length = 0; this._index = 0; } }]); }(); exports.Pool = Pool; /***/ }), /***/ 93169: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var Extensions = __webpack_require__(86890); var BlendModeFilter = __webpack_require__(8948); "use strict"; var DivideBlend = /*#__PURE__*/function (_BlendModeFilter$Blen) { function DivideBlend() { _classCallCheck(this, DivideBlend); return _callSuper(this, DivideBlend, [{ gl: { functions: "\n float divide(float base, float blend)\n {\n return (blend > 0.0) ? clamp(base / blend, 0.0, 1.0) : 1.0;\n }\n\n vec3 blendDivide(vec3 base, vec3 blend, float opacity)\n {\n vec3 blended = vec3(\n divide(base.r, blend.r),\n divide(base.g, blend.g),\n divide(base.b, blend.b)\n );\n\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n finalColor = vec4(blendDivide(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;\n " }, gpu: { functions: "\n fn divide(base: f32, blend: f32) -> f32\n {\n return select(1.0, clamp(base / blend, 0.0, 1.0), blend > 0.0);\n }\n\n fn blendDivide(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>\n {\n let blended = vec3<f32>(\n divide(base.r, blend.r),\n divide(base.g, blend.g),\n divide(base.b, blend.b)\n );\n return (blended * opacity + base * (1.0 - opacity));\n }\n ", main: "\n out = vec4<f32>(blendDivide(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;\n " } }]); } _inherits(DivideBlend, _BlendModeFilter$Blen); return _createClass(DivideBlend); }(BlendModeFilter.BlendModeFilter); /** @ignore */ DivideBlend.extension = { name: "divide", type: Extensions.ExtensionType.BlendMode }; exports.DivideBlend = DivideBlend; /***/ }), /***/ 93213: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _excluded = ["text", "resolution", "style", "anchor", "width", "height", "roundPixels"]; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var ObservablePoint = __webpack_require__(14823); var deprecation = __webpack_require__(11225); var ViewContainer = __webpack_require__(23804); "use strict"; var AbstractText = /*#__PURE__*/function (_ViewContainer$ViewCo) { function AbstractText(options, styleClass) { var _this; _classCallCheck(this, AbstractText); var text = options.text, resolution = options.resolution, style = options.style, anchor = options.anchor, width = options.width, height = options.height, roundPixels = options.roundPixels, rest = _objectWithoutProperties(options, _excluded); _this = _callSuper(this, AbstractText, [_objectSpread({}, rest)]); _this.batched = true; _this._resolution = null; _this._autoResolution = true; _this._didTextUpdate = true; _this._styleClass = styleClass; _this.text = text !== null && text !== void 0 ? text : ""; _this.style = style; _this.resolution = resolution !== null && resolution !== void 0 ? resolution : null; _this.allowChildren = false; _this._anchor = new ObservablePoint.ObservablePoint({ _onUpdate: function _onUpdate() { _this.onViewUpdate(); } }); if (anchor) _this.anchor = anchor; _this.roundPixels = roundPixels !== null && roundPixels !== void 0 ? roundPixels : false; if (width !== void 0) _this.width = width; if (height !== void 0) _this.height = height; return _this; } /** * The anchor sets the origin point of the text. * The default is `(0,0)`, this means the text's origin is the top left. * * Setting the anchor to `(0.5,0.5)` means the text's origin is centered. * * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner. * * If you pass only single parameter, it will set both x and y to the same value as shown in the example below. * @example * import { Text } from 'pixi.js'; * * const text = new Text('hello world'); * text.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5). */ _inherits(AbstractText, _ViewContainer$ViewCo); return _createClass(AbstractText, [{ key: "anchor", get: function get() { return this._anchor; }, set: function set(value) { typeof value === "number" ? this._anchor.set(value) : this._anchor.copyFrom(value); } /** Set the copy for the text object. To split a line you can use '\n'. */ }, { key: "text", get: function get() { return this._text; } /** * The resolution / device pixel ratio of the canvas. * @default 1 */, set: function set(value) { value = value.toString(); if (this._text === value) return; this._text = value; this.onViewUpdate(); } }, { key: "resolution", get: function get() { return this._resolution; }, set: function set(value) { this._autoResolution = value === null; this._resolution = value; this.onViewUpdate(); } }, { key: "style", get: function get() { return this._style; } /** * Set the style of the text. * * Set up an event listener to listen for changes on the style object and mark the text as dirty. * * If setting the `style` can also be partial {@link AnyTextStyleOptions}. * @type { * text.TextStyle | * Partial<text.TextStyle> | * text.TextStyleOptions | * text.HTMLTextStyle | * Partial<text.HTMLTextStyle> | * text.HTMLTextStyleOptions * } */, set: function set(style) { var _this$_style; style || (style = {}); (_this$_style = this._style) === null || _this$_style === void 0 || _this$_style.off("update", this.onViewUpdate, this); if (style instanceof this._styleClass) { this._style = style; } else { this._style = new this._styleClass(style); } this._style.on("update", this.onViewUpdate, this); this.onViewUpdate(); } /** The width of the sprite, setting this will actually modify the scale to achieve the value set. */ }, { key: "width", get: function get() { return Math.abs(this.scale.x) * this.bounds.width; }, set: function set(value) { this._setWidth(value, this.bounds.width); } /** The height of the sprite, setting this will actually modify the scale to achieve the value set. */ }, { key: "height", get: function get() { return Math.abs(this.scale.y) * this.bounds.height; }, set: function set(value) { this._setHeight(value, this.bounds.height); } /** * Retrieves the size of the Text as a [Size]{@link Size} object. * This is faster than get the width and height separately. * @param out - Optional object to store the size in. * @returns - The size of the Text. */ }, { key: "getSize", value: function getSize(out) { out || (out = {}); out.width = Math.abs(this.scale.x) * this.bounds.width; out.height = Math.abs(this.scale.y) * this.bounds.height; return out; } /** * Sets the size of the Text to the specified width and height. * This is faster than setting the width and height separately. * @param value - This can be either a number or a [Size]{@link Size} object. * @param height - The height to set. Defaults to the value of `width` if not provided. */ }, { key: "setSize", value: function setSize(value, height) { if (_typeof(value) === "object") { var _value$height; height = (_value$height = value.height) !== null && _value$height !== void 0 ? _value$height : value.width; value = value.width; } else { height !== null && height !== void 0 ? height : height = value; } value !== void 0 && this._setWidth(value, this.bounds.width); height !== void 0 && this._setHeight(height, this.bounds.height); } /** * Checks if the text contains the given point. * @param point - The point to check */ }, { key: "containsPoint", value: function containsPoint(point) { var width = this.bounds.width; var height = this.bounds.height; var x1 = -width * this.anchor.x; var y1 = 0; if (point.x >= x1 && point.x <= x1 + width) { y1 = -height * this.anchor.y; if (point.y >= y1 && point.y <= y1 + height) return true; } return false; } }, { key: "onViewUpdate", value: function onViewUpdate() { if (!this.didViewUpdate) this._didTextUpdate = true; _superPropGet(AbstractText, "onViewUpdate", this, 3)([]); } }, { key: "_getKey", value: function _getKey() { return "".concat(this.text, ":").concat(this._style.styleKey, ":").concat(this._resolution); } /** * Destroys this text renderable and optionally its style texture. * @param options - Options parameter. A boolean will act as if all options * have been set to that value * @param {boolean} [options.texture=false] - Should it destroy the texture of the text style * @param {boolean} [options.textureSource=false] - Should it destroy the textureSource of the text style * @param {boolean} [options.style=false] - Should it destroy the style of the text */ }, { key: "destroy", value: function destroy() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; _superPropGet(AbstractText, "destroy", this, 3)([options]); this.owner = null; this._bounds = null; this._anchor = null; if (typeof options === "boolean" ? options : options === null || options === void 0 ? void 0 : options.style) { this._style.destroy(options); } this._style = null; this._text = null; } }]); }(ViewContainer.ViewContainer); function ensureTextOptions(args, name) { var _args$; var options = (_args$ = args[0]) !== null && _args$ !== void 0 ? _args$ : {}; if (typeof options === "string" || args[1]) { deprecation.deprecation(deprecation.v8_0_0, "use new ".concat(name, "({ text: \"hi!\", style }) instead")); options = { text: options, style: args[1] }; } return options; } exports.AbstractText = AbstractText; exports.ensureTextOptions = ensureTextOptions; /***/ }), /***/ 93381: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Ticker = __webpack_require__(6014); "use strict"; var uid = 1; var SchedulerSystem = /*#__PURE__*/function () { function SchedulerSystem() { _classCallCheck(this, SchedulerSystem); this._tasks = []; /** a small off set to apply to the repeat schedules. This is just to make sure they run at slightly different times */ this._offset = 0; } /** Initializes the scheduler system and starts the ticker. */ return _createClass(SchedulerSystem, [{ key: "init", value: function init() { Ticker.Ticker.system.add(this._update, this); } /** * Schedules a repeating task. * @param func - The function to execute. * @param duration - The interval duration in milliseconds. * @param useOffset - this will spread out tasks so that they do not all run at the same time * @returns The unique identifier for the scheduled task. */ }, { key: "repeat", value: function repeat(func, duration) { var useOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var id = uid++; var offset = 0; if (useOffset) { this._offset += 1e3; offset = this._offset; } this._tasks.push({ func: func, duration: duration, start: performance.now(), offset: offset, last: performance.now(), repeat: true, id: id }); return id; } /** * Cancels a scheduled task. * @param id - The unique identifier of the task to cancel. */ }, { key: "cancel", value: function cancel(id) { for (var i = 0; i < this._tasks.length; i++) { if (this._tasks[i].id === id) { this._tasks.splice(i, 1); return; } } } /** * Updates and executes the scheduled tasks. * @private */ }, { key: "_update", value: function _update() { var now = performance.now(); for (var i = 0; i < this._tasks.length; i++) { var task = this._tasks[i]; if (now - task.offset - task.last >= task.duration) { var elapsed = now - task.start; task.func(elapsed); task.last = now; } } } /** * Destroys the scheduler system and removes all tasks. * @internal * @ignore */ }, { key: "destroy", value: function destroy() { Ticker.Ticker.system.remove(this._update, this); this._tasks.length = 0; } }]); }(); /** @ignore */ SchedulerSystem.extension = { type: [Extensions.ExtensionType.WebGLSystem, Extensions.ExtensionType.WebGPUSystem, Extensions.ExtensionType.CanvasSystem], name: "scheduler", priority: 0 }; exports.SchedulerSystem = SchedulerSystem; /***/ }), /***/ 93527: /***/ ((module) => { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return '@media ' + item[2] + '{' + content + '}'; } else { return content; } }).join(''); }; // import a list of modules into the list list.i = function (modules, mediaQuery) { if (typeof modules === 'string') { modules = [[null, modules, '']]; } var alreadyImportedModules = {}; for (var i = 0; i < this.length; i++) { var id = this[i][0]; if (id != null) { alreadyImportedModules[id] = true; } } for (i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if (item[0] == null || !alreadyImportedModules[item[0]]) { if (mediaQuery && !item[2]) { item[2] = mediaQuery; } else if (mediaQuery) { item[2] = '(' + item[2] + ') and (' + mediaQuery + ')'; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /***/ 93839: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Matrix = __webpack_require__(20764); var PoolGroup = __webpack_require__(47505); var BatchableSprite = __webpack_require__(42517); var executeInstructions = __webpack_require__(38224); "use strict"; var tempMatrix = new Matrix.Matrix(); var RenderGroupPipe = /*#__PURE__*/function () { function RenderGroupPipe(renderer) { _classCallCheck(this, RenderGroupPipe); this._renderer = renderer; } return _createClass(RenderGroupPipe, [{ key: "addRenderGroup", value: function addRenderGroup(renderGroup, instructionSet) { if (renderGroup.isCachedAsTexture) { this._addRenderableCacheAsTexture(renderGroup, instructionSet); } else { this._addRenderableDirect(renderGroup, instructionSet); } } }, { key: "execute", value: function execute(renderGroup) { if (!renderGroup.isRenderable) return; if (renderGroup.isCachedAsTexture) { this._executeCacheAsTexture(renderGroup); } else { this._executeDirect(renderGroup); } } }, { key: "destroy", value: function destroy() { this._renderer = null; } }, { key: "_addRenderableDirect", value: function _addRenderableDirect(renderGroup, instructionSet) { this._renderer.renderPipes.batch["break"](instructionSet); if (renderGroup._batchableRenderGroup) { PoolGroup.BigPool["return"](renderGroup._batchableRenderGroup); renderGroup._batchableRenderGroup = null; } instructionSet.add(renderGroup); } }, { key: "_addRenderableCacheAsTexture", value: function _addRenderableCacheAsTexture(renderGroup, instructionSet) { var _renderGroup$_batchab; var batchableRenderGroup = (_renderGroup$_batchab = renderGroup._batchableRenderGroup) !== null && _renderGroup$_batchab !== void 0 ? _renderGroup$_batchab : renderGroup._batchableRenderGroup = PoolGroup.BigPool.get(BatchableSprite.BatchableSprite); batchableRenderGroup.renderable = renderGroup.root; batchableRenderGroup.transform = renderGroup.root.relativeGroupTransform; batchableRenderGroup.texture = renderGroup.texture; batchableRenderGroup.bounds = renderGroup._textureBounds; instructionSet.add(renderGroup); this._renderer.renderPipes.batch.addToBatch(batchableRenderGroup, instructionSet); } }, { key: "_executeCacheAsTexture", value: function _executeCacheAsTexture(renderGroup) { if (renderGroup.textureNeedsUpdate) { renderGroup.textureNeedsUpdate = false; var worldTransformMatrix = tempMatrix.identity().translate(-renderGroup._textureBounds.x, -renderGroup._textureBounds.y); this._renderer.renderTarget.push(renderGroup.texture, true, null, renderGroup.texture.frame); this._renderer.globalUniforms.push({ worldTransformMatrix: worldTransformMatrix, worldColor: 4294967295 }); executeInstructions.executeInstructions(renderGroup, this._renderer.renderPipes); this._renderer.renderTarget.finishRenderPass(); this._renderer.renderTarget.pop(); this._renderer.globalUniforms.pop(); } renderGroup._batchableRenderGroup._batcher.updateElement(renderGroup._batchableRenderGroup); renderGroup._batchableRenderGroup._batcher.geometry.buffers[0].update(); } }, { key: "_executeDirect", value: function _executeDirect(renderGroup) { this._renderer.globalUniforms.push({ worldTransformMatrix: renderGroup.inverseParentTextureTransform, worldColor: renderGroup.worldColorAlpha }); executeInstructions.executeInstructions(renderGroup, this._renderer.renderPipes); this._renderer.globalUniforms.pop(); } }]); }(); RenderGroupPipe.extension = { type: [Extensions.ExtensionType.WebGLPipes, Extensions.ExtensionType.WebGPUPipes, Extensions.ExtensionType.CanvasPipes], name: "renderGroup" }; exports.RenderGroupPipe = RenderGroupPipe; /***/ }), /***/ 93938: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _OOP = __webpack_require__(64181); var _AbstractScene = _interopRequireDefault(__webpack_require__(33186)); var _FCore = __webpack_require__(49997); var _MainMenuScene = _interopRequireDefault(__webpack_require__(40918)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * @extends AbstractScene * @constructor */ function SummaryScene() { _AbstractScene["default"].apply(this, arguments); } (0, _OOP.mixClass)(SummaryScene, _AbstractScene["default"]); SummaryScene.prototype.create = function () { var _this = this; this.$ref = (0, _FCore._)({ tag: 'img', style: { width: '100%', height: '100%', position: 'absolute', left: '0', top: '0', zIndex: 9999, opacity: 0.3 * 0 }, props: { src: 'assets/result_board.jpg' } }); this.$bg = (0, _FCore._)({ "class": 'as-summary-bg' }); this.$gui = (0, _FCore._)({ "class": 'as-summary-gui', child: [{ "class": 'as-summary-header', child: [{ tag: 'button', "class": ['as-img-btn', 'as-summary-tab-btn'], child: [{ tag: 'img', attr: { src: 'assets/tab_btn_1.png' } }, { "class": 'as-img-btn-text', attr: { 'data-text': "TÙY CHỌN" } }] }, { tag: 'button', "class": ['as-img-btn', 'as-summary-tab-btn'], style: { left: '240px' }, child: [{ tag: 'img', attr: { src: 'assets/tab_btn_2.png' } }, { "class": 'as-img-btn-text', attr: { 'data-text': "TÍCH LŨY" } }] }, { tag: 'button', "class": ['as-img-btn', 'as-summary-tab-btn'], style: { left: '500px' }, child: [{ tag: 'img', attr: { src: 'assets/tab_btn_3.png' } }, { "class": 'as-img-btn-text', attr: { 'data-text': "THÔNG TIN" } }] }] }, { "class": 'as-summary-body', child: { tag: 'img', attr: { src: 'assets/box1.png' } } }, { tag: 'button', "class": 'as-img-btn', child: { tag: 'img', "class": 'as-summary-close-btn', attr: { src: 'assets/close_btn.png' } }, on: { click: function click() { _this.close(); } } }] }); this.$tabBtns = (0, _FCore.$$)('.as-summary-tab-btn', this.$gui); this.$body = (0, _FCore.$)('.as-summary-body', this.$gui); this.$tabContens = []; this.$tabContens.push((0, _FCore._)({ tag: 'img', "class": 'as-summary-content', style: { width: '1000px', left: '90px', top: '70px' }, attr: { src: 'assets/option_content.png' } })); this.$tabContens.push((0, _FCore._)({ tag: 'img', "class": 'as-summary-content', style: { width: '800px', left: '140px', top: '70px' }, attr: { src: 'assets/summary_content.png' } })); this.$tabContens.push((0, _FCore._)({ "class": 'as-summary-content', style: { width: '1000px', height: '500px', left: '90px', top: '70px' }, child: [{ tag: 'a', attr: { href: 'https://www.youtube.com/watch?v=7X1Fhk-hysw', target: '_blank', rel: 'noopener noreferrer' }, style: { pointerEvents: 'initial', fontFamily: 'inherit', display: 'flex', alignItems: 'center' }, child: [{ tag: 'img', style: { width: '200px', borderRadius: '40px' }, attr: { src: 'assets/youtube.avif' } }, { style: { padding: '50px', fontSize: '50px' }, child: { text: 'Xem trên YouTube' } }] }] })); this.$body.addChild(this.$tabContens); this.$tabBtns.forEach(function (btn, index) { btn.on('click', function () { _this.activeTab(index); }); }); }; SummaryScene.prototype.activeTab = function (index) { this.$tabBtns.forEach(function (btn, i) { if (i === index) { btn.addClass('as-active'); } else { btn.removeClass('as-active'); } }); this.$tabContens.forEach(function (ct, i) { if (i === index) { ct.addClass('as-active'); } else { ct.removeClass('as-active'); } }); }; SummaryScene.prototype.close = function () { var _this2 = this; this.$gui.addStyle('transition', 'transform 0.5s ease-in-out, opacity 0.2s ease-in-out'); this.$gui.addStyle('transform', 'scale(1)'); this.$gui.addStyle('opacity', '1'); requestAnimationFrame(function () { _this2.$gui.addStyle('transform', 'scale(0)'); _this2.$gui.addStyle('opacity', '0'); }); setTimeout(function () { _this2.app.startScene(_MainMenuScene["default"]); }, 500); }; SummaryScene.prototype.onStart = function () { var _this3 = this; this.$ref.addTo(this.$foreground); this.$gui.addTo(this.$foreground); this.$bg.addTo(this.$background); this.$gui.addStyle('transition', 'transform 0.5s ease-in-out, opacity 0.5s ease-in-out'); this.$gui.addStyle('transform', 'scale(0)'); this.$gui.addStyle('opacity', '0'); setTimeout(function () { _this3.$gui.addStyle('transform', 'scale(1)'); _this3.$gui.addStyle('opacity', '1'); }, 200); }; SummaryScene.prototype.onResume = function () { this.activeTab(0); }; SummaryScene.prototype.onStop = function () { this.$bg.remove(); this.$gui.remove(); }; var _default = exports["default"] = SummaryScene; /***/ }), /***/ 93942: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var Culler = __webpack_require__(10541); "use strict"; var CullerPlugin = /*#__PURE__*/function () { function CullerPlugin() { _classCallCheck(this, CullerPlugin); } return _createClass(CullerPlugin, null, [{ key: "init", value: function init() { var _this = this; this._renderRef = this.render.bind(this); this.render = function () { Culler.Culler.shared.cull(_this.stage, _this.renderer.screen); _this.renderer.render({ container: _this.stage }); }; } }, { key: "destroy", value: function destroy() { this.render = this._renderRef; } }]); }(); /** @ignore */ CullerPlugin.extension = { priority: 10, type: Extensions.ExtensionType.Application, name: "culler" }; exports.CullerPlugin = CullerPlugin; /***/ }), /***/ 94278: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _EventEmitter = _interopRequireDefault(__webpack_require__(35513)); var _BrowserDetector = _interopRequireDefault(__webpack_require__(14233)); var _OOP = _interopRequireDefault(__webpack_require__(64181)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /*** * @augments Node * @augments ChildNode * @augments ParentNode * @augments Element * @augments HTMLElement * @augments EventEmitter * @augments ElementCSSInlineStyle * @constructor */ function AElement() { _EventEmitter["default"].call(this); this._azar_extendAttributes = this._azar_extendAttributes || {}; this._azar_extendTags = {}; this.eventHandler = {}; } _OOP["default"].mixClass(AElement, _EventEmitter["default"]); AElement.prototype.init = function (props) { Object.assign(this, props || {}); }; AElement.prototype.eventHandler = {}; /*** * run super-class method */ AElement.prototype["super"] = function () {/* nope */ }; /** * @typedef {Object} AttributeDefiner * @property {Function} set * @property {Function} get * @property {Function} remove * * @param {String} key * @param {AttributeDefiner} def */ AElement.prototype.defineAttribute = function (key, def) { this._azar_extendAttributes[key] = def; }; AElement.prototype.defineAttributes = function (defs) { for (var key in defs) { this.defineAttribute(key, defs[key]); } }; AElement.prototype.attr = function () { if (arguments.length === 1) { if (typeof arguments[0] == 'string') { if (this._azar_extendAttributes[arguments[0]]) { return this._azar_extendAttributes[arguments[0]].get.call(this); } else return this.getAttribute(arguments[0]); } else { for (var key in arguments[0]) { this.attr(key, arguments[0][key]); } } } else { if (arguments.length == 2) { if (arguments[1] === null || arguments[1] === undefined) { if (this._azar_extendAttributes[arguments[0]]) { this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]); } else this.removeAttribute(arguments[0]); } else { if (this._azar_extendAttributes[arguments[0]]) { this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]); } else { this.setAttribute(arguments[0], arguments[1]); } } } } return this; }; /*** * add style * @param {CSSStyleDeclaration|string|{}} arg0 * @param {string} arg1 * @returns {this} */ /** * add style * @param {CSSStyleDeclaration|string|{}} arg0 * @param {string|[]=} arg1 * @returns {this} */ AElement.prototype.addStyle = function (arg0, arg1) { if (typeof arg0 == 'string') { if (arg0.indexOf('-') >= 0) { if (arg1 && arg1.forEach) { this.style.setProperty.apply(this.style, [arg0].concat(arg1)); } else { this.style.setProperty(arg0, arg1); } } else { this.style[arg0] = arg1; } } else { for (var key in arg0) this.addStyle(key, arg0[key]); } return this; }; /*** * * @param {string|string[]|CSSStyleDeclaration} arg0 * @returns {this} */ AElement.prototype.removeStyle = function (arg0) { var key; if (arg0.charAt) { if (arg0.indexOf('-') >= 0) { this.style.removeProperty(arg0); } else { this.style[arg0] = null; delete this.style[arg0]; } } else { if (arg0.map && arg0.forEach) { for (var i = 0; i < arg0.length; ++i) this.removeStyle(arg0[i]); } else { for (key in arg0) this.removeStyle(key); } } return this; }; AElement.prototype.addChild = function (child) { if (child.indexOf && child.map && child.forEach) { for (var i = 0; i < child.length; ++i) this.appendChild(child[i]); } else this.appendChild(child); return this; }; AElement.prototype.addTo = function (parent) { if (parent && parent.appendChild) { if (parent.addChild) parent.addChild(this);else parent.appendChild(this); } else throw Error("Can not append to " + parent + "!"); return this; }; AElement.prototype.selfRemove = function () { if (this.parentElement) this.parentElement.removeChild(this); return this; }; AElement.prototype.selfReplace = function (newNode) { if (this.parentElement) this.parentElement.replaceChild(newNode, this); return this; }; AElement.prototype.clearChild = function () { while (this.lastChild) { this.removeChild(this.lastChild); } return this; }; /** * * @param {string|Array} className * @returns {Boolean} */ AElement.prototype.hasClass = function (className) { return this.classList.contains(className); }; /** * * @param {string|Array} className * @returns {this} */ AElement.prototype.addClass = function (className) { if (className && className.forEach && className.map) { for (var i = 0; i < className.length; ++i) this.classList.add(className[i]); } else this.classList.add(className); return this; }; /** * * @param {string|Array} className * @returns {this} */ AElement.prototype.removeClass = function (className) { if (className && className.forEach && className.map) { for (var i = 0; i < className.length; ++i) this.classList.remove(className[i]); } else this.classList.remove(className); return this; }; AElement.prototype.getComputedStyleValue = function (key) { return window.getComputedStyle(this).getPropertyValue(key); }; AElement.prototype.getFontSize = function () { return parseFloat(this.getComputedStyleValue('font-size').replace('px', '')); }; AElement.prototype.findChildAfter = function (obj) { var r = 0; for (var i = 0; i < this.childNodes.length; ++i) { if (obj == this.childNodes[i]) { r = i + 1; break; } } if (this.childNodes[r]) return this.childNodes[r]; return undefined; }; AElement.prototype.findChildBefore = function (obj) { var r = 0; for (var i = 0; i < this.childNodes.length; ++i) { if (obj == this.childNodes[i]) { r = i - 1; break; } } if (this.childNodes[r]) return this.childNodes[r]; return undefined; }; AElement.prototype.addChildBefore = function (newItem, bf) { this.insertBefore(newItem, bf); return this; }; AElement.prototype.addChildAfter = function (newItem, at) { var atIdx; if (at) { atIdx = Array.prototype.indexOf.call(this.childNodes, at); if (atIdx >= 0) { this.insertBefore(newItem, this.childNodes[atIdx + 1]); } else { throw new Error("Failed to execute 'addChildAfter' on 'Node': The node before which the new node is to be inserted is not a child of this node."); } } else { this.insertBefore(newItem, this.firstChild); } return this; }; /** * @returns {DOMRect} */ AElement.prototype.getBoundingRecursiveRect = function (depth) { if (depth === undefined) depth = 10000; var current, next; var oo = 1000000; var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 }; var stacks = [{ e: this, d: 0 }]; while (stacks.length > 0) { current = stacks.pop(); if (current.e.getBoundingClientRect) { var cRect = current.e.getBoundingClientRect(); if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue; ac.left = Math.min(ac.left, cRect.left); ac.top = Math.min(ac.top, cRect.top); ac.bottom = Math.max(ac.bottom, cRect.bottom); ac.right = Math.max(ac.right, cRect.right); ac.height = ac.bottom - ac.top; ac.width = ac.right - ac.left; var childNodes = current.e.childNodes; if (childNodes && childNodes.length > 0 && current.d < depth) { for (var i = 0; i < childNodes.length; ++i) { next = { e: childNodes[i], d: current.d + 1 }; stacks.push(next); } } } } return ac; }; /*** * * @param parent * @returns {boolean} */ AElement.prototype.isDescendantOf = function (parent) { if (!parent || !parent.childNodes || !parent.childNodes.length) return false; var child = this; while (child) { if (child === parent) return true; child = child.parentNode; } return false; }; /*************************** **********************/ AElement.prototype.getCSSRules = function () { var sheets = document.styleSheets; var ret = []; this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector || this.msMatchesSelector || this.oMatchesSelector; for (var i in sheets) { if (sheets[i].href) continue; //because can not access, you must clone link node instead var rules = sheets[i].rules || sheets[i].cssRules; for (var r in rules) { if (this.matches(rules[r].selectorText)) { ret.push(rules[r]); } } } return ret; }; /*** * @returns {Promise} */ /*** * WARNING: this function may be unsafe */ AElement.prototype.afterDisplayed = function (requestTimesOut) { if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33; // var tracer = new Error(); var current = this; return new Promise(function (resolve, reject) { function trace() { if (requestTimesOut < 0) { // reject(tracer); // if (absol.BUILD && absol.BUILD.version == "DEBUG") // console.warn("Element not displayed", trace); } else { requestTimesOut--; var bound = current.getBoundingClientRect(); if (bound.width > 0 || bound.height > 0) { resolve(); } else { setTimeout(trace, 33); return; } } } trace(); }); }; !function () { var origin = AElement.prototype.on; if (_BrowserDetector["default"].isSafari && !_BrowserDetector["default"].isMobile && false) // removed by dead control flow {} if (_BrowserDetector["default"].isFirefox && false) // removed by dead control flow {} }(); AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed", "ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase", "explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource", "mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region", "relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type", "deltaMode", "deltaX", "deltaY", "deltaZ"]; var _default = exports["default"] = AElement; /***/ }), /***/ 94363: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } var LoaderParser = __webpack_require__(96804); var createTexture = __webpack_require__(49698); var checkExtension = __webpack_require__(59230); var Extensions = __webpack_require__(86890); var CompressedSource = __webpack_require__(49326); var getSupportedTextureFormats = __webpack_require__(10144); var loadKTX2onWorker = __webpack_require__(29977); "use strict"; var loadKTX2 = { extension: { type: Extensions.ExtensionType.LoadParser, priority: LoaderParser.LoaderParserPriority.High, name: "loadKTX2" }, name: "loadKTX2", test: function test(url) { return checkExtension.checkExtension(url, ".ktx2"); }, load: function load(url, _asset, loader) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() { var supportedTextures, textureOptions, compressedTextureSource; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: _context.n = 1; return getSupportedTextureFormats.getSupportedTextureFormats(); case 1: supportedTextures = _context.v; _context.n = 2; return loadKTX2onWorker.loadKTX2onWorker(url, supportedTextures); case 2: textureOptions = _context.v; compressedTextureSource = new CompressedSource.CompressedSource(textureOptions); return _context.a(2, createTexture.createTexture(compressedTextureSource, loader, url)); } }, _callee); }))(); }, unload: function unload(texture) { return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() { return _regenerator().w(function (_context2) { while (1) switch (_context2.n) { case 0: if (Array.isArray(texture)) { texture.forEach(function (t) { return t.destroy(true); }); } else { texture.destroy(true); } case 1: return _context2.a(2); } }, _callee2); }))(); } }; exports.loadKTX2 = loadKTX2; /***/ }), /***/ 94641: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var buildCircle = { extension: { type: Extensions.ExtensionType.ShapeBuilder, name: "circle" }, build: function build(shape, points) { var x; var y; var dx; var dy; var rx; var ry; if (shape.type === "circle") { var circle = shape; x = circle.x; y = circle.y; rx = ry = circle.radius; dx = dy = 0; } else if (shape.type === "ellipse") { var ellipse = shape; x = ellipse.x; y = ellipse.y; rx = ellipse.halfWidth; ry = ellipse.halfHeight; dx = dy = 0; } else { var roundedRect = shape; var halfWidth = roundedRect.width / 2; var halfHeight = roundedRect.height / 2; x = roundedRect.x + halfWidth; y = roundedRect.y + halfHeight; rx = ry = Math.max(0, Math.min(roundedRect.radius, Math.min(halfWidth, halfHeight))); dx = halfWidth - rx; dy = halfHeight - ry; } if (!(rx >= 0 && ry >= 0 && dx >= 0 && dy >= 0)) { return points; } var n = Math.ceil(2.3 * Math.sqrt(rx + ry)); var m = n * 8 + (dx ? 4 : 0) + (dy ? 4 : 0); if (m === 0) { return points; } if (n === 0) { points[0] = points[6] = x + dx; points[1] = points[3] = y + dy; points[2] = points[4] = x - dx; points[5] = points[7] = y - dy; return points; } var j1 = 0; var j2 = n * 4 + (dx ? 2 : 0) + 2; var j3 = j2; var j4 = m; var x0 = dx + rx; var y0 = dy; var x1 = x + x0; var x2 = x - x0; var y1 = y + y0; points[j1++] = x1; points[j1++] = y1; points[--j2] = y1; points[--j2] = x2; if (dy) { var y22 = y - y0; points[j3++] = x2; points[j3++] = y22; points[--j4] = y22; points[--j4] = x1; } for (var i = 1; i < n; i++) { var a = Math.PI / 2 * (i / n); var x02 = dx + Math.cos(a) * rx; var y02 = dy + Math.sin(a) * ry; var x12 = x + x02; var x22 = x - x02; var y12 = y + y02; var _y = y - y02; points[j1++] = x12; points[j1++] = y12; points[--j2] = y12; points[--j2] = x22; points[j3++] = x22; points[j3++] = _y; points[--j4] = _y; points[--j4] = x12; } x0 = dx; y0 = dy + ry; x1 = x + x0; x2 = x - x0; y1 = y + y0; var y2 = y - y0; points[j1++] = x1; points[j1++] = y1; points[--j4] = y2; points[--j4] = x1; if (dx) { points[j1++] = x2; points[j1++] = y1; points[--j4] = y2; points[--j4] = x2; } return points; }, triangulate: function triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) { if (points.length === 0) { return; } var centerX = 0; var centerY = 0; for (var i = 0; i < points.length; i += 2) { centerX += points[i]; centerY += points[i + 1]; } centerX /= points.length / 2; centerY /= points.length / 2; var count = verticesOffset; vertices[count * verticesStride] = centerX; vertices[count * verticesStride + 1] = centerY; var centerIndex = count++; for (var _i = 0; _i < points.length; _i += 2) { vertices[count * verticesStride] = points[_i]; vertices[count * verticesStride + 1] = points[_i + 1]; if (_i > 0) { indices[indicesOffset++] = count; indices[indicesOffset++] = centerIndex; indices[indicesOffset++] = count - 1; } count++; } indices[indicesOffset++] = centerIndex + 1; indices[indicesOffset++] = centerIndex; indices[indicesOffset++] = count - 1; } }; var buildEllipse = _objectSpread(_objectSpread({}, buildCircle), {}, { extension: _objectSpread(_objectSpread({}, buildCircle.extension), {}, { name: "ellipse" }) }); var buildRoundedRectangle = _objectSpread(_objectSpread({}, buildCircle), {}, { extension: _objectSpread(_objectSpread({}, buildCircle.extension), {}, { name: "roundedRectangle" }) }); exports.buildCircle = buildCircle; exports.buildEllipse = buildEllipse; exports.buildRoundedRectangle = buildRoundedRectangle; /***/ }), /***/ 94813: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var detectVideoAlphaMode = __webpack_require__(29501); var isMobile = __webpack_require__(27126); var isSafari = __webpack_require__(33552); var isWebGLSupported = __webpack_require__(67073); var isWebGPUSupported = __webpack_require__(50132); var unsafeEvalSupported = __webpack_require__(70688); var getCanvasBoundingBox = __webpack_require__(82525); var _const = __webpack_require__(22718); var clean = __webpack_require__(35775); var removeItems = __webpack_require__(6602); var uid = __webpack_require__(90844); var updateQuadBounds = __webpack_require__(28275); var ViewableBuffer = __webpack_require__(73803); var globalHooks = __webpack_require__(28488); var deprecation = __webpack_require__(11225); var logDebugTexture = __webpack_require__(14827); var logScene = __webpack_require__(84189); var warn = __webpack_require__(57371); var NOOP = __webpack_require__(6036); var Transform = __webpack_require__(20806); var getResolutionOfUrl = __webpack_require__(40230); var path = __webpack_require__(30710); var Pool = __webpack_require__(93068); var PoolGroup = __webpack_require__(47505); var sayHello = __webpack_require__(59668); __webpack_require__(71172); __webpack_require__(15464); "use strict"; exports.detectVideoAlphaMode = detectVideoAlphaMode.detectVideoAlphaMode; exports.isMobile = isMobile.isMobile; exports.isSafari = isSafari.isSafari; exports.isWebGLSupported = isWebGLSupported.isWebGLSupported; exports.isWebGPUSupported = isWebGPUSupported.isWebGPUSupported; exports.unsafeEvalSupported = unsafeEvalSupported.unsafeEvalSupported; exports.getCanvasBoundingBox = getCanvasBoundingBox.getCanvasBoundingBox; exports.DATA_URI = _const.DATA_URI; exports.VERSION = _const.VERSION; exports.cleanArray = clean.cleanArray; exports.cleanHash = clean.cleanHash; exports.removeItems = removeItems.removeItems; exports.resetUids = uid.resetUids; exports.uid = uid.uid; exports.updateQuadBounds = updateQuadBounds.updateQuadBounds; exports.ViewableBuffer = ViewableBuffer.ViewableBuffer; exports.ApplicationInitHook = globalHooks.ApplicationInitHook; exports.RendererInitHook = globalHooks.RendererInitHook; exports.deprecation = deprecation.deprecation; exports.v8_0_0 = deprecation.v8_0_0; exports.v8_3_4 = deprecation.v8_3_4; exports.logDebugTexture = logDebugTexture.logDebugTexture; exports.logRenderGroupScene = logScene.logRenderGroupScene; exports.logScene = logScene.logScene; exports.warn = warn.warn; exports.NOOP = NOOP.NOOP; exports.Transform = Transform.Transform; exports.getResolutionOfUrl = getResolutionOfUrl.getResolutionOfUrl; exports.path = path.path; exports.Pool = Pool.Pool; exports.BigPool = PoolGroup.BigPool; exports.PoolGroupClass = PoolGroup.PoolGroupClass; exports.sayHello = sayHello.sayHello; /***/ }), /***/ 95033: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var removeItems = __webpack_require__(6602); var deprecation = __webpack_require__(11225); "use strict"; var childrenHelperMixin = { allowChildren: true, /** * Removes all children from this container that are within the begin and end indexes. * @param beginIndex - The beginning position. * @param endIndex - The ending position. Default value is size of the container. * @returns - List of removed children * @memberof scene.Container# */ removeChildren: function removeChildren() { var beginIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var endIndex = arguments.length > 1 ? arguments[1] : undefined; var end = endIndex !== null && endIndex !== void 0 ? endIndex : this.children.length; var range = end - beginIndex; var removed = []; if (range > 0 && range <= end) { for (var i = end - 1; i >= beginIndex; i--) { var child = this.children[i]; if (!child) continue; removed.push(child); child.parent = null; } removeItems.removeItems(this.children, beginIndex, end); var renderGroup = this.renderGroup || this.parentRenderGroup; if (renderGroup) { renderGroup.removeChildren(removed); } for (var _i = 0; _i < removed.length; ++_i) { this.emit("childRemoved", removed[_i], this, _i); removed[_i].emit("removed", this); } if (removed.length > 0) { this._didViewChangeTick++; } return removed; } else if (range === 0 && this.children.length === 0) { return removed; } throw new RangeError("removeChildren: numeric values are outside the acceptable range."); }, /** * Removes a child from the specified index position. * @param index - The index to get the child from * @returns The child that was removed. * @memberof scene.Container# */ removeChildAt: function removeChildAt(index) { var child = this.getChildAt(index); return this.removeChild(child); }, /** * Returns the child at the specified index * @param index - The index to get the child at * @returns - The child at the given index, if any. * @memberof scene.Container# */ getChildAt: function getChildAt(index) { if (index < 0 || index >= this.children.length) { throw new Error("getChildAt: Index (".concat(index, ") does not exist.")); } return this.children[index]; }, /** * Changes the position of an existing child in the container * @param child - The child Container instance for which you want to change the index number * @param index - The resulting index number for the child container * @memberof scene.Container# */ setChildIndex: function setChildIndex(child, index) { if (index < 0 || index >= this.children.length) { throw new Error("The index ".concat(index, " supplied is out of bounds ").concat(this.children.length)); } this.getChildIndex(child); this.addChildAt(child, index); }, /** * Returns the index position of a child Container instance * @param child - The Container instance to identify * @returns - The index position of the child container to identify * @memberof scene.Container# */ getChildIndex: function getChildIndex(child) { var index = this.children.indexOf(child); if (index === -1) { throw new Error("The supplied Container must be a child of the caller"); } return index; }, /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown. * If the child is already in this container, it will be moved to the specified index. * @param {Container} child - The child to add. * @param {number} index - The absolute index where the child will be positioned at the end of the operation. * @returns {Container} The child that was added. * @memberof scene.Container# */ addChildAt: function addChildAt(child, index) { if (!this.allowChildren) { deprecation.deprecation(deprecation.v8_0_0, "addChildAt: Only Containers will be allowed to add children in v8.0.0"); } var children = this.children; if (index < 0 || index > children.length) { throw new Error("".concat(child, "addChildAt: The index ").concat(index, " supplied is out of bounds ").concat(children.length)); } if (child.parent) { var currentIndex = child.parent.children.indexOf(child); if (child.parent === this && currentIndex === index) { return child; } if (currentIndex !== -1) { child.parent.children.splice(currentIndex, 1); } } if (index === children.length) { children.push(child); } else { children.splice(index, 0, child); } child.parent = this; child.didChange = true; child._updateFlags = 15; var renderGroup = this.renderGroup || this.parentRenderGroup; if (renderGroup) { renderGroup.addChild(child); } if (this.sortableChildren) this.sortDirty = true; this.emit("childAdded", child, this, index); child.emit("added", this); return child; }, /** * Swaps the position of 2 Containers within this container. * @param child - First container to swap * @param child2 - Second container to swap * @memberof scene.Container# */ swapChildren: function swapChildren(child, child2) { if (child === child2) { return; } var index1 = this.getChildIndex(child); var index2 = this.getChildIndex(child2); this.children[index1] = child2; this.children[index2] = child; var renderGroup = this.renderGroup || this.parentRenderGroup; if (renderGroup) { renderGroup.structureDidChange = true; } this._didContainerChangeTick++; }, /** * Remove the Container from its parent Container. If the Container has no parent, do nothing. * @memberof scene.Container# */ removeFromParent: function removeFromParent() { var _this$parent; (_this$parent = this.parent) === null || _this$parent === void 0 || _this$parent.removeChild(this); }, /** * Reparent the child to this container, keeping the same worldTransform. * @param child - The child to reparent * @returns The first child that was reparented. * @memberof scene.Container# */ reparentChild: function reparentChild() { var _this = this; for (var _len = arguments.length, child = new Array(_len), _key = 0; _key < _len; _key++) { child[_key] = arguments[_key]; } if (child.length === 1) { return this.reparentChildAt(child[0], this.children.length); } child.forEach(function (c) { return _this.reparentChildAt(c, _this.children.length); }); return child[0]; }, /** * Reparent the child to this container at the specified index, keeping the same worldTransform. * @param child - The child to reparent * @param index - The index to reparent the child to * @memberof scene.Container# */ reparentChildAt: function reparentChildAt(child, index) { if (child.parent === this) { this.setChildIndex(child, index); return child; } var childMat = child.worldTransform.clone(); child.removeFromParent(); this.addChildAt(child, index); var newMatrix = this.worldTransform.clone(); newMatrix.invert(); childMat.prepend(newMatrix); child.setFromMatrix(childMat); return child; } }; exports.childrenHelperMixin = childrenHelperMixin; /***/ }), /***/ 95120: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); var State = __webpack_require__(84938); var GpuBlendModesToPixi = __webpack_require__(2422); "use strict"; var GpuStateSystem = /*#__PURE__*/function () { function GpuStateSystem() { _classCallCheck(this, GpuStateSystem); this.defaultState = new State.State(); this.defaultState.blend = true; } return _createClass(GpuStateSystem, [{ key: "contextChange", value: function contextChange(gpu) { this.gpu = gpu; } /** * Gets the blend mode data for the current state * @param state - The state to get the blend mode from */ }, { key: "getColorTargets", value: function getColorTargets(state) { var blend = GpuBlendModesToPixi.GpuBlendModesToPixi[state.blendMode] || GpuBlendModesToPixi.GpuBlendModesToPixi.normal; return [{ format: "bgra8unorm", writeMask: 0, blend: blend }]; } }, { key: "destroy", value: function destroy() { this.gpu = null; } }]); }(); /** @ignore */ GpuStateSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "state" }; exports.GpuStateSystem = GpuStateSystem; /***/ }), /***/ 95236: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); var MeshPipe = __webpack_require__(80871); "use strict"; Extensions.extensions.add(MeshPipe.MeshPipe); /***/ }), /***/ 95745: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Matrix = __webpack_require__(20764); var uid = __webpack_require__(90844); "use strict"; var repetitionMap = { repeat: { addressModeU: "repeat", addressModeV: "repeat" }, "repeat-x": { addressModeU: "repeat", addressModeV: "clamp-to-edge" }, "repeat-y": { addressModeU: "clamp-to-edge", addressModeV: "repeat" }, "no-repeat": { addressModeU: "clamp-to-edge", addressModeV: "clamp-to-edge" } }; var FillPattern = /*#__PURE__*/function () { function FillPattern(texture, repetition) { _classCallCheck(this, FillPattern); /** unique id for this fill pattern */ this.uid = uid.uid("fillPattern"); this.transform = new Matrix.Matrix(); this._styleKey = null; this.texture = texture; this.transform.scale(1 / texture.frame.width, 1 / texture.frame.height); if (repetition) { texture.source.style.addressModeU = repetitionMap[repetition].addressModeU; texture.source.style.addressModeV = repetitionMap[repetition].addressModeV; } } return _createClass(FillPattern, [{ key: "setTransform", value: function setTransform(transform) { var texture = this.texture; this.transform.copyFrom(transform); this.transform.invert(); this.transform.scale(1 / texture.frame.width, 1 / texture.frame.height); this._styleKey = null; } }, { key: "styleKey", get: function get() { if (this._styleKey) return this._styleKey; this._styleKey = "fill-pattern-".concat(this.uid, "-").concat(this.texture.uid, "-").concat(this.transform.toArray().join("-")); return this._styleKey; } }]); }(); exports.FillPattern = FillPattern; /***/ }), /***/ 95822: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var adapter = __webpack_require__(72450); "use strict"; function mapWebGLBlendModesToPixi(gl) { var blendMap = {}; blendMap.normal = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; blendMap.add = [gl.ONE, gl.ONE]; blendMap.multiply = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; blendMap.screen = [gl.ONE, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; blendMap.none = [0, 0]; blendMap["normal-npm"] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; blendMap["add-npm"] = [gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE]; blendMap["screen-npm"] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; blendMap.erase = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA]; var isWebGl2 = !(gl instanceof adapter.DOMAdapter.get().getWebGLRenderingContext()); if (isWebGl2) { blendMap.min = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.MIN, gl.MIN]; blendMap.max = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.MAX, gl.MAX]; } else { var ext = gl.getExtension("EXT_blend_minmax"); if (ext) { blendMap.min = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, ext.MIN_EXT, ext.MIN_EXT]; blendMap.max = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, ext.MAX_EXT, ext.MAX_EXT]; } } return blendMap; } exports.mapWebGLBlendModesToPixi = mapWebGLBlendModesToPixi; /***/ }), /***/ 95865: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Extensions = __webpack_require__(86890); "use strict"; var BindGroupSystem = /*#__PURE__*/function () { function BindGroupSystem(renderer) { _classCallCheck(this, BindGroupSystem); this._hash = /* @__PURE__ */Object.create(null); this._renderer = renderer; this._renderer.renderableGC.addManagedHash(this, "_hash"); } return _createClass(BindGroupSystem, [{ key: "contextChange", value: function contextChange(gpu) { this._gpu = gpu; } }, { key: "getBindGroup", value: function getBindGroup(bindGroup, program, groupIndex) { bindGroup._updateKey(); var gpuBindGroup = this._hash[bindGroup._key] || this._createBindGroup(bindGroup, program, groupIndex); return gpuBindGroup; } }, { key: "_createBindGroup", value: function _createBindGroup(group, program, groupIndex) { var device = this._gpu.device; var groupLayout = program.layout[groupIndex]; var entries = []; var renderer = this._renderer; for (var j in groupLayout) { var _group$resources$j; var resource = (_group$resources$j = group.resources[j]) !== null && _group$resources$j !== void 0 ? _group$resources$j : group.resources[groupLayout[j]]; var gpuResource = void 0; if (resource._resourceType === "uniformGroup") { var uniformGroup = resource; renderer.ubo.updateUniformGroup(uniformGroup); var buffer = uniformGroup.buffer; gpuResource = { buffer: renderer.buffer.getGPUBuffer(buffer), offset: 0, size: buffer.descriptor.size }; } else if (resource._resourceType === "buffer") { var _buffer = resource; gpuResource = { buffer: renderer.buffer.getGPUBuffer(_buffer), offset: 0, size: _buffer.descriptor.size }; } else if (resource._resourceType === "bufferResource") { var bufferResource = resource; gpuResource = { buffer: renderer.buffer.getGPUBuffer(bufferResource.buffer), offset: bufferResource.offset, size: bufferResource.size }; } else if (resource._resourceType === "textureSampler") { var sampler = resource; gpuResource = renderer.texture.getGpuSampler(sampler); } else if (resource._resourceType === "textureSource") { var texture = resource; gpuResource = renderer.texture.getGpuSource(texture).createView({}); } entries.push({ binding: groupLayout[j], resource: gpuResource }); } var layout = renderer.shader.getProgramData(program).bindGroups[groupIndex]; var gpuBindGroup = device.createBindGroup({ layout: layout, entries: entries }); this._hash[group._key] = gpuBindGroup; return gpuBindGroup; } }, { key: "destroy", value: function destroy() { for (var _i = 0, _Object$keys = Object.keys(this._hash); _i < _Object$keys.length; _i++) { var key = _Object$keys[_i]; this._hash[key] = null; } this._hash = null; this._renderer = null; } }]); }(); /** @ignore */ BindGroupSystem.extension = { type: [Extensions.ExtensionType.WebGPUSystem], name: "bindGroup" }; exports.BindGroupSystem = BindGroupSystem; /***/ }), /***/ 96212: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.randomArbitrary = randomArbitrary; exports.randomInt = randomInt; exports.randomPick = randomPick; /** * Returns a random number between min (inclusive) and max (exclusive) */ function randomArbitrary(min, max) { return Math.random() * (max - min) + min; } /** * Returns a random integer between min (inclusive) and max (inclusive) * Using Math.round() will give you a non-uniform distribution! */ function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function randomPick(arr) { var id = randomInt(0, arr.length - 1); return arr[id]; } /***/ }), /***/ 96230: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function mapFormatToGlType(gl) { return { // 8-bit formats r8unorm: gl.UNSIGNED_BYTE, r8snorm: gl.BYTE, r8uint: gl.UNSIGNED_BYTE, r8sint: gl.BYTE, // 16-bit formats r16uint: gl.UNSIGNED_SHORT, r16sint: gl.SHORT, r16float: gl.HALF_FLOAT, rg8unorm: gl.UNSIGNED_BYTE, rg8snorm: gl.BYTE, rg8uint: gl.UNSIGNED_BYTE, rg8sint: gl.BYTE, // 32-bit formats r32uint: gl.UNSIGNED_INT, r32sint: gl.INT, r32float: gl.FLOAT, rg16uint: gl.UNSIGNED_SHORT, rg16sint: gl.SHORT, rg16float: gl.HALF_FLOAT, rgba8unorm: gl.UNSIGNED_BYTE, "rgba8unorm-srgb": gl.UNSIGNED_BYTE, // Packed 32-bit formats rgba8snorm: gl.BYTE, rgba8uint: gl.UNSIGNED_BYTE, rgba8sint: gl.BYTE, bgra8unorm: gl.UNSIGNED_BYTE, "bgra8unorm-srgb": gl.UNSIGNED_BYTE, rgb9e5ufloat: gl.UNSIGNED_INT_5_9_9_9_REV, rgb10a2unorm: gl.UNSIGNED_INT_2_10_10_10_REV, rg11b10ufloat: gl.UNSIGNED_INT_10F_11F_11F_REV, // 64-bit formats rg32uint: gl.UNSIGNED_INT, rg32sint: gl.INT, rg32float: gl.FLOAT, rgba16uint: gl.UNSIGNED_SHORT, rgba16sint: gl.SHORT, rgba16float: gl.HALF_FLOAT, // 128-bit formats rgba32uint: gl.UNSIGNED_INT, rgba32sint: gl.INT, rgba32float: gl.FLOAT, // Depth/stencil formats stencil8: gl.UNSIGNED_BYTE, depth16unorm: gl.UNSIGNED_SHORT, depth24plus: gl.UNSIGNED_INT, "depth24plus-stencil8": gl.UNSIGNED_INT_24_8, depth32float: gl.FLOAT, "depth32float-stencil8": gl.FLOAT_32_UNSIGNED_INT_24_8_REV }; } exports.mapFormatToGlType = mapFormatToGlType; /***/ }), /***/ 96388: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 96406: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var CustomRenderPipe = __webpack_require__(7705); var RenderGroupPipe = __webpack_require__(93839); var RenderGroupSystem = __webpack_require__(14342); var SpritePipe = __webpack_require__(73707); var globalHooks = __webpack_require__(28488); var BatcherPipe = __webpack_require__(61087); var AlphaMaskPipe = __webpack_require__(89914); var ColorMaskPipe = __webpack_require__(42682); var StencilMaskPipe = __webpack_require__(28010); var BackgroundSystem = __webpack_require__(52481); var BlendModePipe = __webpack_require__(73155); var ExtractSystem = __webpack_require__(41267); var GenerateTextureSystem = __webpack_require__(66304); var GlobalUniformSystem = __webpack_require__(78115); var SchedulerSystem = __webpack_require__(93381); var HelloSystem = __webpack_require__(34102); var RenderableGCSystem = __webpack_require__(52070); var TextureGCSystem = __webpack_require__(19977); var ViewSystem = __webpack_require__(79679); "use strict"; var SharedSystems = [BackgroundSystem.BackgroundSystem, GlobalUniformSystem.GlobalUniformSystem, HelloSystem.HelloSystem, ViewSystem.ViewSystem, RenderGroupSystem.RenderGroupSystem, TextureGCSystem.TextureGCSystem, GenerateTextureSystem.GenerateTextureSystem, ExtractSystem.ExtractSystem, globalHooks.RendererInitHook, RenderableGCSystem.RenderableGCSystem, SchedulerSystem.SchedulerSystem]; var SharedRenderPipes = [BlendModePipe.BlendModePipe, BatcherPipe.BatcherPipe, SpritePipe.SpritePipe, RenderGroupPipe.RenderGroupPipe, AlphaMaskPipe.AlphaMaskPipe, StencilMaskPipe.StencilMaskPipe, ColorMaskPipe.ColorMaskPipe, CustomRenderPipe.CustomRenderPipe]; exports.SharedRenderPipes = SharedRenderPipes; exports.SharedSystems = SharedSystems; /***/ }), /***/ 96465: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Extensions = __webpack_require__(86890); "use strict"; var buildTriangle = { extension: { type: Extensions.ExtensionType.ShapeBuilder, name: "triangle" }, build: function build(shape, points) { points[0] = shape.x; points[1] = shape.y; points[2] = shape.x2; points[3] = shape.y2; points[4] = shape.x3; points[5] = shape.y3; return points; }, triangulate: function triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) { var count = 0; verticesOffset *= verticesStride; vertices[verticesOffset + count] = points[0]; vertices[verticesOffset + count + 1] = points[1]; count += verticesStride; vertices[verticesOffset + count] = points[2]; vertices[verticesOffset + count + 1] = points[3]; count += verticesStride; vertices[verticesOffset + count] = points[4]; vertices[verticesOffset + count + 1] = points[5]; var verticesIndex = verticesOffset / verticesStride; indices[indicesOffset++] = verticesIndex; indices[indicesOffset++] = verticesIndex + 1; indices[indicesOffset++] = verticesIndex + 2; } }; exports.buildTriangle = buildTriangle; /***/ }), /***/ 96804: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var LoaderParserPriority = /* @__PURE__ */function (LoaderParserPriority2) { LoaderParserPriority2[LoaderParserPriority2["Low"] = 0] = "Low"; LoaderParserPriority2[LoaderParserPriority2["Normal"] = 1] = "Normal"; LoaderParserPriority2[LoaderParserPriority2["High"] = 2] = "High"; return LoaderParserPriority2; }(LoaderParserPriority || {}); exports.LoaderParserPriority = LoaderParserPriority; /***/ }), /***/ 96847: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var textureBatchBitGpuCache = {}; function generateBindingSrc(maxTextures) { var src = []; if (maxTextures === 1) { src.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"); src.push("@group(1) @binding(1) var textureSampler1: sampler;"); } else { var bindingIndex = 0; for (var i = 0; i < maxTextures; i++) { src.push("@group(1) @binding(".concat(bindingIndex++, ") var textureSource").concat(i + 1, ": texture_2d<f32>;")); src.push("@group(1) @binding(".concat(bindingIndex++, ") var textureSampler").concat(i + 1, ": sampler;")); } } return src.join("\n"); } function generateSampleSrc(maxTextures) { var src = []; if (maxTextures === 1) { src.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);"); } else { src.push("switch vTextureId {"); for (var i = 0; i < maxTextures; i++) { if (i === maxTextures - 1) { src.push(" default:{"); } else { src.push(" case ".concat(i, ":{")); } src.push(" outColor = textureSampleGrad(textureSource".concat(i + 1, ", textureSampler").concat(i + 1, ", vUV, uvDx, uvDy);")); src.push(" break;}"); } src.push("}"); } return src.join("\n"); } function generateTextureBatchBit(maxTextures) { if (!textureBatchBitGpuCache[maxTextures]) { textureBatchBitGpuCache[maxTextures] = { name: "texture-batch-bit", vertex: { header: "\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n ", main: "\n vTextureId = aTextureIdAndRound.y;\n ", end: "\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n " }, fragment: { header: "\n @in @interpolate(flat) vTextureId: u32;\n\n ".concat(generateBindingSrc(maxTextures), "\n "), main: "\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ".concat(generateSampleSrc(maxTextures), "\n ") } }; } return textureBatchBitGpuCache[maxTextures]; } var textureBatchBitGlCache = {}; function generateSampleGlSrc(maxTextures) { var src = []; for (var i = 0; i < maxTextures; i++) { if (i > 0) { src.push("else"); } if (i < maxTextures - 1) { src.push("if(vTextureId < ".concat(i, ".5)")); } src.push("{"); src.push("\toutColor = texture(uTextures[".concat(i, "], vUV);")); src.push("}"); } return src.join("\n"); } function generateTextureBatchBitGl(maxTextures) { if (!textureBatchBitGlCache[maxTextures]) { textureBatchBitGlCache[maxTextures] = { name: "texture-batch-bit", vertex: { header: "\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n ", main: "\n vTextureId = aTextureIdAndRound.y;\n ", end: "\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n " }, fragment: { header: "\n in float vTextureId;\n\n uniform sampler2D uTextures[".concat(maxTextures, "];\n\n "), main: "\n\n ".concat(generateSampleGlSrc(maxTextures), "\n ") } }; } return textureBatchBitGlCache[maxTextures]; } exports.generateTextureBatchBit = generateTextureBatchBit; exports.generateTextureBatchBitGl = generateTextureBatchBitGl; /***/ }), /***/ 97018: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var localUniformMSDFBit = { name: "local-uniform-msdf-bit", vertex: { header: /* wgsl */"\n struct LocalUniforms {\n uColor:vec4<f32>,\n uTransformMatrix:mat3x3<f32>,\n uDistance: f32,\n uRound:f32,\n }\n\n @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ", main: /* wgsl */"\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n ", end: /* wgsl */"\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n " }, fragment: { header: /* wgsl */"\n struct LocalUniforms {\n uColor:vec4<f32>,\n uTransformMatrix:mat3x3<f32>,\n uDistance: f32\n }\n\n @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ", main: /* wgsl */" \n outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));\n " } }; var localUniformMSDFBitGl = { name: "local-uniform-msdf-bit", vertex: { header: /* glsl */"\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n ", main: /* glsl */"\n vColor *= uColor;\n modelMatrix *= uTransformMatrix;\n ", end: /* glsl */"\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n " }, fragment: { header: /* glsl */"\n uniform float uDistance;\n ", main: /* glsl */" \n outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));\n " } }; exports.localUniformMSDFBit = localUniformMSDFBit; exports.localUniformMSDFBitGl = localUniformMSDFBitGl; /***/ }), /***/ 97177: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 97754: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var GlProgram = __webpack_require__(23896); var GpuProgram = __webpack_require__(57974); var compileHighShader = __webpack_require__(14075); var defaultProgramTemplate = __webpack_require__(46484); var globalUniformsBit = __webpack_require__(31359); "use strict"; function compileHighShaderGpuProgram(_ref) { var bits = _ref.bits, name = _ref.name; var source = compileHighShader.compileHighShader({ template: { fragment: defaultProgramTemplate.fragmentGPUTemplate, vertex: defaultProgramTemplate.vertexGPUTemplate }, bits: [globalUniformsBit.globalUniformsBit].concat(_toConsumableArray(bits)) }); return GpuProgram.GpuProgram.from({ name: name, vertex: { source: source.vertex, entryPoint: "main" }, fragment: { source: source.fragment, entryPoint: "main" } }); } function compileHighShaderGlProgram(_ref2) { var bits = _ref2.bits, name = _ref2.name; return new GlProgram.GlProgram(_objectSpread({ name: name }, compileHighShader.compileHighShaderGl({ template: { vertex: defaultProgramTemplate.vertexGlTemplate, fragment: defaultProgramTemplate.fragmentGlTemplate }, bits: [globalUniformsBit.globalUniformsBitGl].concat(_toConsumableArray(bits)) }))); } exports.compileHighShaderGlProgram = compileHighShaderGlProgram; exports.compileHighShaderGpuProgram = compileHighShaderGpuProgram; /***/ }), /***/ 97779: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AbstractEnemy = AbstractEnemy; exports.BoCanhCung = BoCanhCung; exports.BoRep = BoRep; exports.BoTri = BoTri; exports.NamBenh = NamBenh; exports.OcSen = OcSen; exports.Sau = Sau; exports.ViKhuan = ViKhuan; var _stringGenerate = __webpack_require__(356); var _pixi = __webpack_require__(3635); var _util = __webpack_require__(19330); var _OOP = __webpack_require__(64181); var _Vec = _interopRequireDefault(__webpack_require__(28239)); var _Rectangle = _interopRequireDefault(__webpack_require__(34478)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } /** * * @param {Level1Scene|AbstractScene|PreviewScene} scene * @constructor */ function AbstractEnemy(scene) { this.scene = scene; this.id = (0, _stringGenerate.randomIdent)(8); this.x = this.scene.mosterHome.x; this.y = this.scene.mosterHome.y; this.id = (0, _stringGenerate.randomIdent)(8); this.texture = this.scene.assetMng.getTexture(this.imageRes); this.sprite = new _pixi.Sprite(this.texture); this.sprite.x = -this.imageOffset.x; this.sprite.y = -this.imageOffset.y; this.stand = new _pixi.Container(); this.stand.addChild(this.sprite); this.root = new _pixi.Container(); this.root.addChild(this.stand); this.scene.pLiveObject.addChild(this.root); this.scaleKeyFrame = Math.random(); this.root.x = (this.x + 0.5) * 108; this.root.y = (this.y + 0.5) * 108; this.scene.enemies[this.id] = this; this.moveKeyFrame = -1; this.exited = false; this.root.zIndex = this.y * 12 + this.x; this.scene.pLiveObject.sortChildren(); this.slowRemainingTime = 0; } AbstractEnemy.prototype.type = 'enemy'; AbstractEnemy.prototype.imageSize = { width: 131, height: 131 }; AbstractEnemy.prototype.imageOffset = { y: 109, x: 131 / 2 }; AbstractEnemy.prototype.scaleDuration = 1000; AbstractEnemy.prototype.attack = 1; AbstractEnemy.prototype.imageRes = 'bo_tri'; AbstractEnemy.prototype.minScale = 0.9; AbstractEnemy.prototype.maxScale = 1; AbstractEnemy.prototype.width = 1; AbstractEnemy.prototype.height = 1; AbstractEnemy.prototype.speed = 0.5; AbstractEnemy.prototype.coins = 3; AbstractEnemy.prototype.hp = 60; AbstractEnemy.prototype.update = function (deltaTime) { this.updateAni(deltaTime); this.updateMove(deltaTime); this.updateExit(deltaTime); }; AbstractEnemy.prototype.updateExit = function (deltaTime) { if (this.exited) return; var wayCells = this.scene.wayCells; if (this.moveKeyFrame < wayCells.length - 1) return; this.exited = true; this.scene.protectedTarget.beDamaged(this.attack); this.remove(); }; AbstractEnemy.prototype.updateMove = function (deltaTime) { if (this.exited) return; var speed = this.speed; if (this.slowRemainingTime > 0) { speed *= 0.7; this.slowRemainingTime -= deltaTime; } this.moveKeyFrame += deltaTime / 1000 * speed; var wayCells = this.scene.wayCells; var fromIdx = Math.floor(this.moveKeyFrame); var toIdx = fromIdx + 1; var fromCell, toCell; var A; var B; var t = this.moveKeyFrame - fromIdx; if (fromIdx < 0) { fromCell = this.scene.mosterHome; } else if (fromIdx >= wayCells.length) { fromCell = this.scene.protectedTarget; } else { fromCell = wayCells[fromIdx]; } if (toIdx < 0) { toCell = this.scene.mosterHome; } else if (toIdx >= wayCells.length) { toCell = this.scene.protectedTarget; } else { toCell = wayCells[toIdx]; } A = new _Vec["default"](fromCell.x, fromCell.y); B = new _Vec["default"](toCell.x, toCell.y); var N = B.sub(A).mult(t); var C = A.add(N); if (A.x > B.x && this.root.scale.x > 0) { this.root.scale.x = -1; } else if (A.x < B.x && this.root.scale.x < 0) { this.root.scale.x = 1; } var prevZ = Math.floor(this.y) * 12 + Math.floor(this.x); this.x = C.x; this.y = C.y; var newZ = Math.floor(this.y) * 12 + Math.floor(this.x); if (prevZ !== newZ) { this.root.zIndex = newZ; this.scene.pLiveObject.sortChildren(); } this.root.x = (this.x + 0.5) * 108; this.root.y = (this.y + 0.5) * 108; }; AbstractEnemy.prototype.updateAni = function (deltaTime) { this.scaleKeyFrame += deltaTime / this.scaleDuration; this.scaleKeyFrame = this.scaleKeyFrame % 1; var t = (0, _util.bezierBlend)(this.scaleKeyFrame); if (t < 0.5) t = t * 2;else t = (1 - t) * 2; this.stand.scale.y = this.minScale + (this.maxScale - this.minScale) * t; }; AbstractEnemy.prototype.remove = function () { if (this.root.parent) this.root.parent.removeChild(this.root); delete this.scene.enemies[this.id]; }; AbstractEnemy.prototype.getRect = function () { return new _Rectangle["default"](this.scene.map.x + this.x * 108, this.scene.map.y + this.y * 108, 108, 108); }; AbstractEnemy.prototype.isHit = function (point) { var rect = this.getRect(); return rect.containsPoint(point); }; AbstractEnemy.prototype.beDamaged = function (damage) { if (this.hp <= 0) return; this.hp -= damage; if (this.hp <= 0) { this.exited = true; this.scene.starCoins += this.coins; this.exited = true; this.remove(); } }; AbstractEnemy.prototype.beSlow = function (time) { this.slowRemainingTime = time || 1000; }; /** * @extends AbstractEnemy * @constructor */ function BoTri(scene, x, y) { AbstractEnemy.apply(this, arguments); this.stand.scale.x = -1; } (0, _OOP.mixClass)(BoTri, AbstractEnemy); BoTri.prototype.imageRes = 'bo_tri'; /** * @extends AbstractEnemy * @constructor */ function ViKhuan(scene, x, y) { AbstractEnemy.apply(this, arguments); } (0, _OOP.mixClass)(ViKhuan, AbstractEnemy); ViKhuan.prototype.imageRes = 'vi_khuan'; /** * @extends AbstractEnemy * @constructor */ function Sau(scene, x, y) { AbstractEnemy.apply(this, arguments); } (0, _OOP.mixClass)(Sau, AbstractEnemy); Sau.prototype.imageRes = 'sau'; /** * @extends AbstractEnemy * @constructor */ function OcSen(scene, x, y) { AbstractEnemy.apply(this, arguments); } (0, _OOP.mixClass)(OcSen, AbstractEnemy); OcSen.prototype.imageRes = 'oc_sen'; /** * @extends AbstractEnemy * @constructor */ function NamBenh(scene, x, y) { AbstractEnemy.apply(this, arguments); this.stand.scale.x = -1; } (0, _OOP.mixClass)(NamBenh, AbstractEnemy); NamBenh.prototype.imageRes = 'nam_benh'; ViKhuan.prototype.attack = 1; /** * @extends AbstractEnemy * @constructor */ function BoCanhCung(scene, x, y) { AbstractEnemy.apply(this, arguments); } (0, _OOP.mixClass)(BoCanhCung, AbstractEnemy); BoCanhCung.prototype.imageRes = 'bo_canh_cung'; /** * @extends AbstractEnemy * @constructor */ function BoRep() { AbstractEnemy.apply(this, arguments); this.stand.scale.x = -1; } (0, _OOP.mixClass)(BoRep, AbstractEnemy); BoRep.prototype.imageRes = 'bo_rep'; ViKhuan.prototype.hp = 30; NamBenh.prototype.hp = 40; BoCanhCung.prototype.hp = 50; BoRep.prototype.hp = 50; OcSen.prototype.hp = 80; Sau.prototype.hp = 40; ViKhuan.prototype.coins = 3; NamBenh.prototype.coins = 4; BoCanhCung.prototype.coins = 4; BoRep.prototype.coins = 4; OcSen.prototype.coins = 8; Sau.prototype.coins = 5; ViKhuan.prototype.attack = 1; NamBenh.prototype.attack = 2; BoCanhCung.prototype.attack = 3; BoRep.prototype.attack = 3; OcSen.prototype.attack = 4; Sau.prototype.attack = 3; ViKhuan.prototype.speed = 1.2; NamBenh.prototype.speed = 1; BoCanhCung.prototype.speed = 0.9; BoRep.prototype.speed = 1; OcSen.prototype.speed = 0.5; Sau.prototype.speed = 0.8; /***/ }), /***/ 98192: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var defaultValue = __webpack_require__(40486); var mapType = __webpack_require__(63880); "use strict"; function getUniformData(program, gl) { var uniforms = {}; var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); for (var i = 0; i < totalUniforms; i++) { var uniformData = gl.getActiveUniform(program, i); var name = uniformData.name.replace(/\[.*?\]$/, ""); var isArray = !!uniformData.name.match(/\[.*?\]$/); var type = mapType.mapType(gl, uniformData.type); uniforms[name] = { name: name, index: i, type: type, size: uniformData.size, isArray: isArray, value: defaultValue.defaultValue(type, uniformData.size) }; } return uniforms; } exports.getUniformData = getUniformData; /***/ }), /***/ 98268: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function updateLocalTransform(lt, container) { var scale = container._scale; var pivot = container._pivot; var position = container._position; var sx = scale._x; var sy = scale._y; var px = pivot._x; var py = pivot._y; lt.a = container._cx * sx; lt.b = container._sx * sx; lt.c = container._cy * sy; lt.d = container._sy * sy; lt.tx = position._x - (px * lt.a + py * lt.c); lt.ty = position._y - (px * lt.b + py * lt.d); } exports.updateLocalTransform = updateLocalTransform; /***/ }), /***/ 98687: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; function DPTokenizer(opt) { opt = opt || {}; if (opt.elementRegexes) this.elementRegexes = opt.elementRegexes; this._combineTokenRegex(); } DPTokenizer.prototype.elementRegexes = [['string', /("(?:[^"\\]|\\.)*?")|('(?:[^'\\]|\\.)*?')/], ['number', /(\d+([.]\d*)?([eE][+-]?\d+)?|[.]\d+([eE][+-]?\d+)?)/], ['word', /[_a-zA-Z][_a-zA-Z0-9]*/], ['skip', /([\s\r\n]+)|(\/\/[^\n]*)|(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)/], ['dsymbol', /\+\+|--|==|!=|<=|>=|\|\||&&/], ['tsymbol', /\.\.\./], ['symbol', /[^\s_a-zA-Z0-9]/]]; DPTokenizer.prototype._combineTokenRegex = function () { var tokenRegexSource = this.elementRegexes.map(function (cr) { return '(' + cr[1].source + ')'; }).join('|'); this.tokenRegex = new RegExp(tokenRegexSource, 'g'); this.groupIndexOfTypes = this.elementRegexes.slice(0, this.elementRegexes.length - 1).reduce(function (ac, cr) { var subGroupLength = new RegExp(cr[1].source + '|.').exec('a').length; ac.push(ac[ac.length - 1] + subGroupLength); return ac; }, [1]); this.types = this.elementRegexes.reduce(function (ac, cr) { ac[cr[0]] = cr; return ac; }, {}); }; DPTokenizer.prototype.tokenize = function (source) { var regex = new RegExp(this.tokenRegex.source, 'g'); var elementRegexes = this.elementRegexes; var groupIndexOfTypes = this.groupIndexOfTypes; var res = []; var matched = regex.exec(source); var type, i; while (matched) { type = null; for (i = 0; i < groupIndexOfTypes.length; ++i) { if (matched[groupIndexOfTypes[i]]) { type = elementRegexes[i][0]; } } res.push({ type: type, content: matched[0], start: matched.index, end: matched.index + matched[0].length }); matched = regex.exec(source); } return res; }; var _default = exports["default"] = DPTokenizer; /***/ }), /***/ 98828: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var colord = __webpack_require__(47266); var namesPlugin = __webpack_require__(80793); "use strict"; colord.extend([namesPlugin]); var _Color = /*#__PURE__*/function () { /** * @param {ColorSource} value - Optional value to use, if not provided, white is used. */ function _Color() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16777215; _classCallCheck(this, _Color); this._value = null; this._components = new Float32Array(4); this._components.fill(1); this._int = 16777215; this.value = value; } /** Get red component (0 - 1) */ return _createClass(_Color, [{ key: "red", get: function get() { return this._components[0]; } /** Get green component (0 - 1) */ }, { key: "green", get: function get() { return this._components[1]; } /** Get blue component (0 - 1) */ }, { key: "blue", get: function get() { return this._components[2]; } /** Get alpha component (0 - 1) */ }, { key: "alpha", get: function get() { return this._components[3]; } /** * Set the value, suitable for chaining * @param value * @see Color.value */ }, { key: "setValue", value: function setValue(value) { this.value = value; return this; } /** * The current color source. * * When setting: * - Setting to an instance of `Color` will copy its color source and components. * - Otherwise, `Color` will try to normalize the color source and set the components. * If the color source is invalid, an `Error` will be thrown and the `Color` will left unchanged. * * Note: The `null` in the setter's parameter type is added to match the TypeScript rule: return type of getter * must be assignable to its setter's parameter type. Setting `value` to `null` will throw an `Error`. * * When getting: * - A return value of `null` means the previous value was overridden (e.g., {@link Color.multiply multiply}, * {@link Color.premultiply premultiply} or {@link Color.round round}). * - Otherwise, the color source used when setting is returned. */ }, { key: "value", get: function get() { return this._value; } /** * Copy a color source internally. * @param value - Color source */, set: function set(value) { if (value instanceof _Color) { this._value = this._cloneSource(value._value); this._int = value._int; this._components.set(value._components); } else if (value === null) { throw new Error("Cannot set Color#value to null"); } else if (this._value === null || !this._isSourceEqual(this._value, value)) { this._value = this._cloneSource(value); this._normalize(this._value); } } }, { key: "_cloneSource", value: function _cloneSource(value) { if (typeof value === "string" || typeof value === "number" || value instanceof Number || value === null) { return value; } else if (Array.isArray(value) || ArrayBuffer.isView(value)) { return value.slice(0); } else if (_typeof(value) === "object" && value !== null) { return _objectSpread({}, value); } return value; } /** * Equality check for color sources. * @param value1 - First color source * @param value2 - Second color source * @returns `true` if the color sources are equal, `false` otherwise. */ }, { key: "_isSourceEqual", value: function _isSourceEqual(value1, value2) { var type1 = _typeof(value1); var type2 = _typeof(value2); if (type1 !== type2) { return false; } else if (type1 === "number" || type1 === "string" || value1 instanceof Number) { return value1 === value2; } else if (Array.isArray(value1) && Array.isArray(value2) || ArrayBuffer.isView(value1) && ArrayBuffer.isView(value2)) { if (value1.length !== value2.length) { return false; } return value1.every(function (v, i) { return v === value2[i]; }); } else if (value1 !== null && value2 !== null) { var keys1 = Object.keys(value1); var keys2 = Object.keys(value2); if (keys1.length !== keys2.length) { return false; } return keys1.every(function (key) { return value1[key] === value2[key]; }); } return value1 === value2; } /** * Convert to a RGBA color object. * @example * import { Color } from 'pixi.js'; * new Color('white').toRgb(); // returns { r: 1, g: 1, b: 1, a: 1 } */ }, { key: "toRgba", value: function toRgba() { var _this$_components = _slicedToArray(this._components, 4), r = _this$_components[0], g = _this$_components[1], b = _this$_components[2], a = _this$_components[3]; return { r: r, g: g, b: b, a: a }; } /** * Convert to a RGB color object. * @example * import { Color } from 'pixi.js'; * new Color('white').toRgb(); // returns { r: 1, g: 1, b: 1 } */ }, { key: "toRgb", value: function toRgb() { var _this$_components2 = _slicedToArray(this._components, 3), r = _this$_components2[0], g = _this$_components2[1], b = _this$_components2[2]; return { r: r, g: g, b: b }; } /** Convert to a CSS-style rgba string: `rgba(255,255,255,1.0)`. */ }, { key: "toRgbaString", value: function toRgbaString() { var _this$toUint8RgbArray = this.toUint8RgbArray(), _this$toUint8RgbArray2 = _slicedToArray(_this$toUint8RgbArray, 3), r = _this$toUint8RgbArray2[0], g = _this$toUint8RgbArray2[1], b = _this$toUint8RgbArray2[2]; return "rgba(".concat(r, ",").concat(g, ",").concat(b, ",").concat(this.alpha, ")"); } }, { key: "toUint8RgbArray", value: function toUint8RgbArray(out) { var _this$_components3 = _slicedToArray(this._components, 3), r = _this$_components3[0], g = _this$_components3[1], b = _this$_components3[2]; if (!this._arrayRgb) { this._arrayRgb = []; } out || (out = this._arrayRgb); out[0] = Math.round(r * 255); out[1] = Math.round(g * 255); out[2] = Math.round(b * 255); return out; } }, { key: "toArray", value: function toArray(out) { if (!this._arrayRgba) { this._arrayRgba = []; } out || (out = this._arrayRgba); var _this$_components4 = _slicedToArray(this._components, 4), r = _this$_components4[0], g = _this$_components4[1], b = _this$_components4[2], a = _this$_components4[3]; out[0] = r; out[1] = g; out[2] = b; out[3] = a; return out; } }, { key: "toRgbArray", value: function toRgbArray(out) { if (!this._arrayRgb) { this._arrayRgb = []; } out || (out = this._arrayRgb); var _this$_components5 = _slicedToArray(this._components, 3), r = _this$_components5[0], g = _this$_components5[1], b = _this$_components5[2]; out[0] = r; out[1] = g; out[2] = b; return out; } /** * Convert to a hexadecimal number. * @example * import { Color } from 'pixi.js'; * new Color('white').toNumber(); // returns 16777215 */ }, { key: "toNumber", value: function toNumber() { return this._int; } /** * Convert to a BGR number * @example * import { Color } from 'pixi.js'; * new Color(0xffcc99).toBgrNumber(); // returns 0x99ccff */ }, { key: "toBgrNumber", value: function toBgrNumber() { var _this$toUint8RgbArray3 = this.toUint8RgbArray(), _this$toUint8RgbArray4 = _slicedToArray(_this$toUint8RgbArray3, 3), r = _this$toUint8RgbArray4[0], g = _this$toUint8RgbArray4[1], b = _this$toUint8RgbArray4[2]; return (b << 16) + (g << 8) + r; } /** * Convert to a hexadecimal number in little endian format (e.g., BBGGRR). * @example * import { Color } from 'pixi.js'; * new Color(0xffcc99).toLittleEndianNumber(); // returns 0x99ccff * @returns {number} - The color as a number in little endian format. */ }, { key: "toLittleEndianNumber", value: function toLittleEndianNumber() { var value = this._int; return (value >> 16) + (value & 65280) + ((value & 255) << 16); } /** * Multiply with another color. This action is destructive, and will * override the previous `value` property to be `null`. * @param {ColorSource} value - The color to multiply by. */ }, { key: "multiply", value: function multiply(value) { var _Color$_temp$setValue = _slicedToArray(_Color._temp.setValue(value)._components, 4), r = _Color$_temp$setValue[0], g = _Color$_temp$setValue[1], b = _Color$_temp$setValue[2], a = _Color$_temp$setValue[3]; this._components[0] *= r; this._components[1] *= g; this._components[2] *= b; this._components[3] *= a; this._refreshInt(); this._value = null; return this; } /** * Converts color to a premultiplied alpha format. This action is destructive, and will * override the previous `value` property to be `null`. * @param alpha - The alpha to multiply by. * @param {boolean} [applyToRGB=true] - Whether to premultiply RGB channels. * @returns {Color} - Itself. */ }, { key: "premultiply", value: function premultiply(alpha) { var applyToRGB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (applyToRGB) { this._components[0] *= alpha; this._components[1] *= alpha; this._components[2] *= alpha; } this._components[3] = alpha; this._refreshInt(); this._value = null; return this; } /** * Premultiplies alpha with current color. * @param {number} alpha - The alpha to multiply by. * @param {boolean} [applyToRGB=true] - Whether to premultiply RGB channels. * @returns {number} tint multiplied by alpha */ }, { key: "toPremultiplied", value: function toPremultiplied(alpha) { var applyToRGB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (alpha === 1) { return (255 << 24) + this._int; } if (alpha === 0) { return applyToRGB ? 0 : this._int; } var r = this._int >> 16 & 255; var g = this._int >> 8 & 255; var b = this._int & 255; if (applyToRGB) { r = r * alpha + 0.5 | 0; g = g * alpha + 0.5 | 0; b = b * alpha + 0.5 | 0; } return (alpha * 255 << 24) + (r << 16) + (g << 8) + b; } /** * Convert to a hexadecimal string. * @example * import { Color } from 'pixi.js'; * new Color('white').toHex(); // returns "#ffffff" */ }, { key: "toHex", value: function toHex() { var hexString = this._int.toString(16); return "#".concat("000000".substring(0, 6 - hexString.length) + hexString); } /** * Convert to a hexadecimal string with alpha. * @example * import { Color } from 'pixi.js'; * new Color('white').toHexa(); // returns "#ffffffff" */ }, { key: "toHexa", value: function toHexa() { var alphaValue = Math.round(this._components[3] * 255); var alphaString = alphaValue.toString(16); return this.toHex() + "00".substring(0, 2 - alphaString.length) + alphaString; } /** * Set alpha, suitable for chaining. * @param alpha */ }, { key: "setAlpha", value: function setAlpha(alpha) { this._components[3] = this._clamp(alpha); return this; } /** * Normalize the input value into rgba * @param value - Input value */ }, { key: "_normalize", value: function _normalize(value) { var r; var g; var b; var a; if ((typeof value === "number" || value instanceof Number) && value >= 0 && value <= 16777215) { var _int = value; r = (_int >> 16 & 255) / 255; g = (_int >> 8 & 255) / 255; b = (_int & 255) / 255; a = 1; } else if ((Array.isArray(value) || value instanceof Float32Array) && value.length >= 3 && value.length <= 4) { value = this._clamp(value); var _value = value; var _value2 = _slicedToArray(_value, 4); r = _value2[0]; g = _value2[1]; b = _value2[2]; var _value2$ = _value2[3]; a = _value2$ === void 0 ? 1 : _value2$; } else if ((value instanceof Uint8Array || value instanceof Uint8ClampedArray) && value.length >= 3 && value.length <= 4) { value = this._clamp(value, 0, 255); var _value3 = value; var _value4 = _slicedToArray(_value3, 4); r = _value4[0]; g = _value4[1]; b = _value4[2]; var _value4$ = _value4[3]; a = _value4$ === void 0 ? 255 : _value4$; r /= 255; g /= 255; b /= 255; a /= 255; } else if (typeof value === "string" || _typeof(value) === "object") { if (typeof value === "string") { var match = _Color.HEX_PATTERN.exec(value); if (match) { value = "#".concat(match[2]); } } var color = colord.colord(value); if (color.isValid()) { var _color$rgba = color.rgba; r = _color$rgba.r; g = _color$rgba.g; b = _color$rgba.b; a = _color$rgba.a; r /= 255; g /= 255; b /= 255; } } if (r !== void 0) { this._components[0] = r; this._components[1] = g; this._components[2] = b; this._components[3] = a; this._refreshInt(); } else { throw new Error("Unable to convert color ".concat(value)); } } /** Refresh the internal color rgb number */ }, { key: "_refreshInt", value: function _refreshInt() { this._clamp(this._components); var _this$_components6 = _slicedToArray(this._components, 3), r = _this$_components6[0], g = _this$_components6[1], b = _this$_components6[2]; this._int = (r * 255 << 16) + (g * 255 << 8) + (b * 255 | 0); } /** * Clamps values to a range. Will override original values * @param value - Value(s) to clamp * @param min - Minimum value * @param max - Maximum value */ }, { key: "_clamp", value: function _clamp(value) { var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; if (typeof value === "number") { return Math.min(Math.max(value, min), max); } value.forEach(function (v, i) { value[i] = Math.min(Math.max(v, min), max); }); return value; } /** * Check if the value is a color-like object * @param value - Value to check * @returns True if the value is a color-like object * @static * @example * import { Color } from 'pixi.js'; * Color.isColorLike('white'); // returns true * Color.isColorLike(0xffffff); // returns true * Color.isColorLike([1, 1, 1]); // returns true */ }], [{ key: "isColorLike", value: function isColorLike(value) { return typeof value === "number" || typeof value === "string" || value instanceof Number || value instanceof _Color || Array.isArray(value) || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Float32Array || value.r !== void 0 && value.g !== void 0 && value.b !== void 0 || value.r !== void 0 && value.g !== void 0 && value.b !== void 0 && value.a !== void 0 || value.h !== void 0 && value.s !== void 0 && value.l !== void 0 || value.h !== void 0 && value.s !== void 0 && value.l !== void 0 && value.a !== void 0 || value.h !== void 0 && value.s !== void 0 && value.v !== void 0 || value.h !== void 0 && value.s !== void 0 && value.v !== void 0 && value.a !== void 0; } }]); }(); /** * Default Color object for static uses * @example * import { Color } from 'pixi.js'; * Color.shared.setValue(0xffffff).toHex(); // '#ffffff' */ _Color.shared = new _Color(); /** * Temporary Color object for static uses internally. * As to not conflict with Color.shared. * @ignore */ _Color._temp = new _Color(); /** Pattern for hex strings */ // eslint-disable-next-line @typescript-eslint/naming-convention _Color.HEX_PATTERN = /^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i; var Color = _Color; exports.Color = Color; /***/ }), /***/ 98954: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var createUboElementsWGSL = __webpack_require__(30008); "use strict"; function generateArraySyncWGSL(uboElement, offsetToAdd) { var _createUboElementsWGS = createUboElementsWGSL.WGSL_ALIGN_SIZE_DATA[uboElement.data.type], size = _createUboElementsWGS.size, align = _createUboElementsWGS.align; var remainder = (align - size) / 4; var data = uboElement.data.type.indexOf("i32") >= 0 ? "dataInt32" : "data"; return "\n v = uv.".concat(uboElement.data.name, ";\n ").concat(offsetToAdd !== 0 ? "offset += ".concat(offsetToAdd, ";") : "", "\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ").concat(uboElement.data.size * (size / 4), "; i++)\n {\n for(var j = 0; j < ").concat(size / 4, "; j++)\n {\n ").concat(data, "[arrayOffset++] = v[t++];\n }\n ").concat(remainder !== 0 ? "arrayOffset += ".concat(remainder, ";") : "", "\n }\n "); } exports.generateArraySyncWGSL = generateArraySyncWGSL; /***/ }), /***/ 98961: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var content = __webpack_require__(49673); if(typeof content === 'string') content = [[module.id, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(53027)(content, options); if(content.locals) module.exports = content.locals; if(false) // removed by dead control flow {} /***/ }), /***/ 98971: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _Extensions$extension; function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var Extensions = __webpack_require__(86890); var GpuGraphicsAdaptor = __webpack_require__(71717); var GpuMeshAdapter = __webpack_require__(3851); var GpuBatchAdaptor = __webpack_require__(53626); var AbstractRenderer = __webpack_require__(59158); var SharedSystems = __webpack_require__(96406); var types = __webpack_require__(9634); var BindGroupSystem = __webpack_require__(95865); var GpuBufferSystem = __webpack_require__(37848); var GpuColorMaskSystem = __webpack_require__(83432); var GpuDeviceSystem = __webpack_require__(58815); var GpuEncoderSystem = __webpack_require__(59471); var GpuStencilSystem = __webpack_require__(47135); var GpuUboSystem = __webpack_require__(51387); var GpuUniformBatchPipe = __webpack_require__(79236); var PipelineSystem = __webpack_require__(12026); var GpuRenderTargetSystem = __webpack_require__(30324); var GpuShaderSystem = __webpack_require__(82084); var GpuStateSystem = __webpack_require__(95120); var GpuTextureSystem = __webpack_require__(61284); "use strict"; var DefaultWebGPUSystems = [].concat(_toConsumableArray(SharedSystems.SharedSystems), [GpuUboSystem.GpuUboSystem, GpuEncoderSystem.GpuEncoderSystem, GpuDeviceSystem.GpuDeviceSystem, GpuBufferSystem.GpuBufferSystem, GpuTextureSystem.GpuTextureSystem, GpuRenderTargetSystem.GpuRenderTargetSystem, GpuShaderSystem.GpuShaderSystem, GpuStateSystem.GpuStateSystem, PipelineSystem.PipelineSystem, GpuColorMaskSystem.GpuColorMaskSystem, GpuStencilSystem.GpuStencilSystem, BindGroupSystem.BindGroupSystem]); var DefaultWebGPUPipes = [].concat(_toConsumableArray(SharedSystems.SharedRenderPipes), [GpuUniformBatchPipe.GpuUniformBatchPipe]); var DefaultWebGPUAdapters = [GpuBatchAdaptor.GpuBatchAdaptor, GpuMeshAdapter.GpuMeshAdapter, GpuGraphicsAdaptor.GpuGraphicsAdaptor]; var systems = []; var renderPipes = []; var renderPipeAdaptors = []; Extensions.extensions.handleByNamedList(Extensions.ExtensionType.WebGPUSystem, systems); Extensions.extensions.handleByNamedList(Extensions.ExtensionType.WebGPUPipes, renderPipes); Extensions.extensions.handleByNamedList(Extensions.ExtensionType.WebGPUPipesAdaptor, renderPipeAdaptors); (_Extensions$extension = Extensions.extensions).add.apply(_Extensions$extension, _toConsumableArray(DefaultWebGPUSystems).concat(_toConsumableArray(DefaultWebGPUPipes), DefaultWebGPUAdapters)); var WebGPURenderer = /*#__PURE__*/function (_AbstractRenderer$Abs) { function WebGPURenderer() { _classCallCheck(this, WebGPURenderer); var systemConfig = { name: "webgpu", type: types.RendererType.WEBGPU, systems: systems, renderPipes: renderPipes, renderPipeAdaptors: renderPipeAdaptors }; return _callSuper(this, WebGPURenderer, [systemConfig]); } _inherits(WebGPURenderer, _AbstractRenderer$Abs); return _createClass(WebGPURenderer); }(AbstractRenderer.AbstractRenderer); exports.WebGPURenderer = WebGPURenderer; /***/ }), /***/ 98996: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var GpuParticleContainerAdaptor = /*#__PURE__*/function () { function GpuParticleContainerAdaptor() { _classCallCheck(this, GpuParticleContainerAdaptor); } return _createClass(GpuParticleContainerAdaptor, [{ key: "execute", value: function execute(particleContainerPipe, container) { var renderer = particleContainerPipe.renderer; var shader = container.shader || particleContainerPipe.defaultShader; shader.groups[0] = renderer.renderPipes.uniformBatch.getUniformBindGroup(particleContainerPipe.localUniforms, true); shader.groups[1] = renderer.texture.getTextureBindGroup(container.texture); var state = particleContainerPipe.state; var buffer = particleContainerPipe.getBuffers(container); renderer.encoder.draw({ geometry: buffer.geometry, shader: container.shader || particleContainerPipe.defaultShader, state: state, size: container.particleChildren.length * 6 }); } }]); }(); exports.GpuParticleContainerAdaptor = GpuParticleContainerAdaptor; /***/ }), /***/ 99229: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function mapFormatToGlFormat(gl) { return { // 8-bit formats r8unorm: gl.RED, r8snorm: gl.RED, r8uint: gl.RED, r8sint: gl.RED, // 16-bit formats r16uint: gl.RED, r16sint: gl.RED, r16float: gl.RED, rg8unorm: gl.RG, rg8snorm: gl.RG, rg8uint: gl.RG, rg8sint: gl.RG, // 32-bit formats r32uint: gl.RED, r32sint: gl.RED, r32float: gl.RED, rg16uint: gl.RG, rg16sint: gl.RG, rg16float: gl.RG, rgba8unorm: gl.RGBA, "rgba8unorm-srgb": gl.RGBA, // Packed 32-bit formats rgba8snorm: gl.RGBA, rgba8uint: gl.RGBA, rgba8sint: gl.RGBA, bgra8unorm: gl.RGBA, "bgra8unorm-srgb": gl.RGBA, rgb9e5ufloat: gl.RGB, rgb10a2unorm: gl.RGBA, rg11b10ufloat: gl.RGB, // 64-bit formats rg32uint: gl.RG, rg32sint: gl.RG, rg32float: gl.RG, rgba16uint: gl.RGBA, rgba16sint: gl.RGBA, rgba16float: gl.RGBA, // 128-bit formats rgba32uint: gl.RGBA, rgba32sint: gl.RGBA, rgba32float: gl.RGBA, // Depth/stencil formats stencil8: gl.STENCIL_INDEX8, depth16unorm: gl.DEPTH_COMPONENT, depth24plus: gl.DEPTH_COMPONENT, "depth24plus-stencil8": gl.DEPTH_STENCIL, depth32float: gl.DEPTH_COMPONENT, "depth32float-stencil8": gl.DEPTH_STENCIL }; } exports.mapFormatToGlFormat = mapFormatToGlFormat; /***/ }), /***/ 99539: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } var MeshGeometry = __webpack_require__(56451); "use strict"; var QuadGeometry = /*#__PURE__*/function (_MeshGeometry$MeshGeo) { function QuadGeometry() { _classCallCheck(this, QuadGeometry); return _callSuper(this, QuadGeometry, [{ positions: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), uvs: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), indices: new Uint32Array([0, 1, 2, 0, 2, 3]) }]); } _inherits(QuadGeometry, _MeshGeometry$MeshGeo); return _createClass(QuadGeometry); }(MeshGeometry.MeshGeometry); exports.QuadGeometry = QuadGeometry; /***/ }), /***/ 99724: /***/ (() => { "use strict"; "use strict"; /***/ }), /***/ 99799: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; var closePointEps = 1e-4; var curveEps = 1e-4; exports.closePointEps = closePointEps; exports.curveEps = curveEps; /***/ }), /***/ 99836: /***/ ((__unused_webpack_module, exports) => { "use strict"; "use strict"; function parseSVGFloatAttribute(svg, id, defaultValue) { var value = svg.getAttribute(id); return value ? Number(value) : defaultValue; } exports.parseSVGFloatAttribute = parseSVGFloatAttribute; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /******/ /* webpack/runtime/nonce */ /******/ (() => { /******/ __webpack_require__.nc = undefined; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; __webpack_require__(98961); var _FlavorAdventure = _interopRequireDefault(__webpack_require__(58212)); var _SummaryScene = _interopRequireDefault(__webpack_require__(93938)); var _FCore = __webpack_require__(49997); var _Clipboard = __webpack_require__(2737); var _LoadingScene = _interopRequireDefault(__webpack_require__(55774)); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } var app = new _FlavorAdventure["default"](); app.assetMng.loadImage('bg2', './assets/bg2.png').then(function () { return app.assetMng.loadImage('bg2', './assets/bg2.png'); }).then(function () { return app.assetMng.loadImage('book_loading', './assets/book_loading.png'); }).then(function () { return app.assetMng.loadImage('cat_zzz', './assets/cat_zzz.png'); }).then(function () { setTimeout(function () { app.getView().addTo(document.body); app.start(); app.startScene(_LoadingScene["default"]); (0, _FCore.$)('.as-preload').addStyle('display', 'none'); /* var mouseX = 0; var mouseY = 0; addEventListener('mousemove', (e) => { var appBound = app.$main.getBoundingClientRect(); mouseX = e.clientX - appBound.left; mouseY = e.clientY - appBound.top; mouseX/= app.scale; mouseY/= app.scale; mouseX = Math.round(mouseX); mouseY = Math.round(mouseY); }); addEventListener('mousedown', ()=>{ console.log('copy', mouseX, mouseY); copyText(`left: ${mouseX}px;\ntop: ${mouseY}px;`); })*/ }, 200); }); })(); /******/ })() ;