This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

21
resources/app/node_modules/@pixi/utils/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2013-2023 Mathew Groves, Chad Engler
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,30 @@
"use strict";
var constants = require("@pixi/constants");
let promise;
async function detectVideoAlphaMode() {
return promise ?? (promise = (async () => {
const gl = document.createElement("canvas").getContext("webgl");
if (!gl)
return constants.ALPHA_MODES.UNPACK;
const video = await new Promise((resolve) => {
const video2 = document.createElement("video");
video2.onloadeddata = () => resolve(video2), video2.onerror = () => resolve(null), video2.autoplay = !1, video2.crossOrigin = "anonymous", video2.preload = "auto", video2.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=", video2.load();
});
if (!video)
return constants.ALPHA_MODES.UNPACK;
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
const 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, !1), gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE), gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
const pixel = new Uint8Array(4);
return gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel), gl.deleteFramebuffer(framebuffer), gl.deleteTexture(texture), gl.getExtension("WEBGL_lose_context")?.loseContext(), pixel[0] <= pixel[3] ? constants.ALPHA_MODES.PMA : constants.ALPHA_MODES.UNPACK;
})()), promise;
}
exports.detectVideoAlphaMode = detectVideoAlphaMode;
//# sourceMappingURL=detectVideoAlphaMode.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"detectVideoAlphaMode.js","sources":["../../src/browser/detectVideoAlphaMode.ts"],"sourcesContent":["import { ALPHA_MODES } from '@pixi/constants';\n\nlet promise: Promise<ALPHA_MODES> | undefined;\n\n/**\n * Helper for detecting the correct alpha mode for video textures.\n * For some reason, some browsers/devices/WebGL implementations premultiply the alpha\n * of a video before and then a second time if `UNPACK_PREMULTIPLY_ALPHA_WEBGL`\n * is true. So the video is premultiplied twice if the alpha mode is `UNPACK`.\n * In this case we need the alpha mode to be `PMA`. This function detects\n * the upload behavior by uploading a white 2x2 webm with 50% alpha\n * without `UNPACK_PREMULTIPLY_ALPHA_WEBGL` and then checking whether\n * the uploaded pixels are premultiplied.\n * @memberof PIXI.utils\n * @function detectVideoAlphaMode\n * @returns {Promise<PIXI.ALPHA_MODES>} The correct alpha mode for video textures.\n */\nexport async function detectVideoAlphaMode(): Promise<ALPHA_MODES>\n{\n promise ??= (async () =>\n {\n const canvas = document.createElement('canvas');\n const gl = canvas.getContext('webgl');\n\n if (!gl)\n {\n return ALPHA_MODES.UNPACK;\n }\n\n const video = await new Promise<HTMLVideoElement | null>((resolve) =>\n {\n const video = document.createElement('video');\n\n video.onloadeddata = () => resolve(video);\n video.onerror = () => resolve(null);\n video.autoplay = false;\n video.crossOrigin = 'anonymous';\n video.preload = 'auto';\n // eslint-disable-next-line max-len\n video.src = 'data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=';\n video.load();\n });\n\n if (!video)\n {\n return ALPHA_MODES.UNPACK;\n }\n\n const texture = gl.createTexture();\n\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n const framebuffer = gl.createFramebuffer();\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0,\n gl.TEXTURE_2D,\n texture,\n 0\n );\n\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);\n\n const pixel = new Uint8Array(4);\n\n gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);\n\n gl.deleteFramebuffer(framebuffer);\n gl.deleteTexture(texture);\n gl.getExtension('WEBGL_lose_context')?.loseContext();\n\n return pixel[0] <= pixel[3] ? ALPHA_MODES.PMA : ALPHA_MODES.UNPACK;\n })();\n\n return promise;\n}\n"],"names":["ALPHA_MODES","video"],"mappings":";;AAEA,IAAI;AAeJ,eAAsB,uBACtB;AACI,SAAA,YAAA,WAAa,YACb;AAEI,UAAM,KADS,SAAS,cAAc,QAAQ,EAC5B,WAAW,OAAO;AAEpC,QAAI,CAAC;AAED,aAAOA,UAAAA,YAAY;AAGvB,UAAM,QAAQ,MAAM,IAAI,QAAiC,CAAC,YAC1D;AACUC,YAAAA,SAAQ,SAAS,cAAc,OAAO;AAE5CA,aAAM,eAAe,MAAM,QAAQA,MAAK,GACxCA,OAAM,UAAU,MAAM,QAAQ,IAAI,GAClCA,OAAM,WAAW,IACjBA,OAAM,cAAc,aACpBA,OAAM,UAAU,QAEhBA,OAAM,MAAM,2sBACZA,OAAM,KAAK;AAAA,IAAA,CACd;AAED,QAAI,CAAC;AAED,aAAOD,UAAAA,YAAY;AAGjB,UAAA,UAAU,GAAG;AAEhB,OAAA,YAAY,GAAG,YAAY,OAAO;AAE/B,UAAA,cAAc,GAAG;AAEvB,OAAG,gBAAgB,GAAG,aAAa,WAAW,GAC9C,GAAG;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MACA;AAAA,IACJ,GAEA,GAAG,YAAY,GAAG,gCAAgC,EAAK,GACvD,GAAG,YAAY,GAAG,oCAAoC,GAAG,IAAI,GAC7D,GAAG,WAAW,GAAG,YAAY,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,KAAK;AAEnE,UAAA,QAAQ,IAAI,WAAW,CAAC;AAE9B,WAAA,GAAG,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,eAAe,KAAK,GAE1D,GAAG,kBAAkB,WAAW,GAChC,GAAG,cAAc,OAAO,GACxB,GAAG,aAAa,oBAAoB,GAAG,eAEhC,MAAM,CAAC,KAAK,MAAM,CAAC,IAAIA,UAAA,YAAY,MAAMA,UAAY,YAAA;AAAA,EAAA,GAGzD,IAAA;AACX;;"}

View File

@@ -0,0 +1,31 @@
import { ALPHA_MODES } from "@pixi/constants";
let promise;
async function detectVideoAlphaMode() {
return promise ?? (promise = (async () => {
const gl = document.createElement("canvas").getContext("webgl");
if (!gl)
return ALPHA_MODES.UNPACK;
const video = await new Promise((resolve) => {
const video2 = document.createElement("video");
video2.onloadeddata = () => resolve(video2), video2.onerror = () => resolve(null), video2.autoplay = !1, video2.crossOrigin = "anonymous", video2.preload = "auto", video2.src = "data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=", video2.load();
});
if (!video)
return ALPHA_MODES.UNPACK;
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
const 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, !1), gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE), gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
const pixel = new Uint8Array(4);
return gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel), gl.deleteFramebuffer(framebuffer), gl.deleteTexture(texture), gl.getExtension("WEBGL_lose_context")?.loseContext(), pixel[0] <= pixel[3] ? ALPHA_MODES.PMA : ALPHA_MODES.UNPACK;
})()), promise;
}
export {
detectVideoAlphaMode
};
//# sourceMappingURL=detectVideoAlphaMode.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"detectVideoAlphaMode.mjs","sources":["../../src/browser/detectVideoAlphaMode.ts"],"sourcesContent":["import { ALPHA_MODES } from '@pixi/constants';\n\nlet promise: Promise<ALPHA_MODES> | undefined;\n\n/**\n * Helper for detecting the correct alpha mode for video textures.\n * For some reason, some browsers/devices/WebGL implementations premultiply the alpha\n * of a video before and then a second time if `UNPACK_PREMULTIPLY_ALPHA_WEBGL`\n * is true. So the video is premultiplied twice if the alpha mode is `UNPACK`.\n * In this case we need the alpha mode to be `PMA`. This function detects\n * the upload behavior by uploading a white 2x2 webm with 50% alpha\n * without `UNPACK_PREMULTIPLY_ALPHA_WEBGL` and then checking whether\n * the uploaded pixels are premultiplied.\n * @memberof PIXI.utils\n * @function detectVideoAlphaMode\n * @returns {Promise<PIXI.ALPHA_MODES>} The correct alpha mode for video textures.\n */\nexport async function detectVideoAlphaMode(): Promise<ALPHA_MODES>\n{\n promise ??= (async () =>\n {\n const canvas = document.createElement('canvas');\n const gl = canvas.getContext('webgl');\n\n if (!gl)\n {\n return ALPHA_MODES.UNPACK;\n }\n\n const video = await new Promise<HTMLVideoElement | null>((resolve) =>\n {\n const video = document.createElement('video');\n\n video.onloadeddata = () => resolve(video);\n video.onerror = () => resolve(null);\n video.autoplay = false;\n video.crossOrigin = 'anonymous';\n video.preload = 'auto';\n // eslint-disable-next-line max-len\n video.src = 'data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=';\n video.load();\n });\n\n if (!video)\n {\n return ALPHA_MODES.UNPACK;\n }\n\n const texture = gl.createTexture();\n\n gl.bindTexture(gl.TEXTURE_2D, texture);\n\n const framebuffer = gl.createFramebuffer();\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(\n gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0,\n gl.TEXTURE_2D,\n texture,\n 0\n );\n\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);\n\n const pixel = new Uint8Array(4);\n\n gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);\n\n gl.deleteFramebuffer(framebuffer);\n gl.deleteTexture(texture);\n gl.getExtension('WEBGL_lose_context')?.loseContext();\n\n return pixel[0] <= pixel[3] ? ALPHA_MODES.PMA : ALPHA_MODES.UNPACK;\n })();\n\n return promise;\n}\n"],"names":["video"],"mappings":";AAEA,IAAI;AAeJ,eAAsB,uBACtB;AACI,SAAA,YAAA,WAAa,YACb;AAEI,UAAM,KADS,SAAS,cAAc,QAAQ,EAC5B,WAAW,OAAO;AAEpC,QAAI,CAAC;AAED,aAAO,YAAY;AAGvB,UAAM,QAAQ,MAAM,IAAI,QAAiC,CAAC,YAC1D;AACUA,YAAAA,SAAQ,SAAS,cAAc,OAAO;AAE5CA,aAAM,eAAe,MAAM,QAAQA,MAAK,GACxCA,OAAM,UAAU,MAAM,QAAQ,IAAI,GAClCA,OAAM,WAAW,IACjBA,OAAM,cAAc,aACpBA,OAAM,UAAU,QAEhBA,OAAM,MAAM,2sBACZA,OAAM,KAAK;AAAA,IAAA,CACd;AAED,QAAI,CAAC;AAED,aAAO,YAAY;AAGjB,UAAA,UAAU,GAAG;AAEhB,OAAA,YAAY,GAAG,YAAY,OAAO;AAE/B,UAAA,cAAc,GAAG;AAEvB,OAAG,gBAAgB,GAAG,aAAa,WAAW,GAC9C,GAAG;AAAA,MACC,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MACA;AAAA,IACJ,GAEA,GAAG,YAAY,GAAG,gCAAgC,EAAK,GACvD,GAAG,YAAY,GAAG,oCAAoC,GAAG,IAAI,GAC7D,GAAG,WAAW,GAAG,YAAY,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,KAAK;AAEnE,UAAA,QAAQ,IAAI,WAAW,CAAC;AAE9B,WAAA,GAAG,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,eAAe,KAAK,GAE1D,GAAG,kBAAkB,WAAW,GAChC,GAAG,cAAc,OAAO,GACxB,GAAG,aAAa,oBAAoB,GAAG,eAEhC,MAAM,CAAC,KAAK,MAAM,CAAC,IAAI,YAAY,MAAM,YAAY;AAAA,EAAA,GAGzD,IAAA;AACX;"}

View File

@@ -0,0 +1,11 @@
"use strict";
var deprecation = require("../logging/deprecation.js");
function skipHello() {
deprecation.deprecation("7.0.0", "skipHello is deprecated, please use settings.RENDER_OPTIONS.hello");
}
function sayHello() {
deprecation.deprecation("7.0.0", `sayHello is deprecated, please use Renderer's "hello" option`);
}
exports.sayHello = sayHello;
exports.skipHello = skipHello;
//# sourceMappingURL=hello.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hello.js","sources":["../../src/browser/hello.ts"],"sourcesContent":["import { deprecation } from '../logging/deprecation';\n\n/**\n * @function skipHello\n * @memberof PIXI.utils\n * @deprecated since 7.0.0\n */\nexport function skipHello(): void\n{\n if (process.env.DEBUG)\n {\n deprecation('7.0.0', 'skipHello is deprecated, please use settings.RENDER_OPTIONS.hello');\n }\n}\n\n/**\n * @static\n * @function sayHello\n * @memberof PIXI.utils\n * @deprecated since 7.0.0\n */\nexport function sayHello(): void\n{\n if (process.env.DEBUG)\n {\n deprecation('7.0.0', 'sayHello is deprecated, please use Renderer\\'s \"hello\" option');\n }\n}\n"],"names":["deprecation"],"mappings":";;AAOO,SAAS,YAChB;AAGQA,0BAAY,SAAS,mEAAmE;AAEhG;AAQO,SAAS,WAChB;AAGQA,cAAAA,YAAY,SAAS,8DAA+D;AAE5F;;;"}

View File

@@ -0,0 +1,12 @@
import { deprecation } from "../logging/deprecation.mjs";
function skipHello() {
deprecation("7.0.0", "skipHello is deprecated, please use settings.RENDER_OPTIONS.hello");
}
function sayHello() {
deprecation("7.0.0", `sayHello is deprecated, please use Renderer's "hello" option`);
}
export {
sayHello,
skipHello
};
//# sourceMappingURL=hello.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hello.mjs","sources":["../../src/browser/hello.ts"],"sourcesContent":["import { deprecation } from '../logging/deprecation';\n\n/**\n * @function skipHello\n * @memberof PIXI.utils\n * @deprecated since 7.0.0\n */\nexport function skipHello(): void\n{\n if (process.env.DEBUG)\n {\n deprecation('7.0.0', 'skipHello is deprecated, please use settings.RENDER_OPTIONS.hello');\n }\n}\n\n/**\n * @static\n * @function sayHello\n * @memberof PIXI.utils\n * @deprecated since 7.0.0\n */\nexport function sayHello(): void\n{\n if (process.env.DEBUG)\n {\n deprecation('7.0.0', 'sayHello is deprecated, please use Renderer\\'s \"hello\" option');\n }\n}\n"],"names":[],"mappings":";AAOO,SAAS,YAChB;AAGQ,cAAY,SAAS,mEAAmE;AAEhG;AAQO,SAAS,WAChB;AAGQ,cAAY,SAAS,8DAA+D;AAE5F;"}

View File

@@ -0,0 +1,28 @@
"use strict";
require("../settings.js");
var settings = require("@pixi/settings");
let supported;
function isWebGLSupported() {
return typeof supported > "u" && (supported = function() {
const contextOptions = {
stencil: !0,
failIfMajorPerformanceCaveat: settings.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT
};
try {
if (!settings.settings.ADAPTER.getWebGLRenderingContext())
return !1;
const canvas = settings.settings.ADAPTER.createCanvas();
let gl = canvas.getContext("webgl", contextOptions) || canvas.getContext("experimental-webgl", contextOptions);
const success = !!gl?.getContextAttributes()?.stencil;
if (gl) {
const loseContext = gl.getExtension("WEBGL_lose_context");
loseContext && loseContext.loseContext();
}
return gl = null, success;
} catch {
return !1;
}
}()), supported;
}
exports.isWebGLSupported = isWebGLSupported;
//# sourceMappingURL=isWebGLSupported.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isWebGLSupported.js","sources":["../../src/browser/isWebGLSupported.ts"],"sourcesContent":["import { settings } from '../settings';\n\nlet supported: boolean | undefined;\n\n/**\n * Helper for checking for WebGL support.\n * @memberof PIXI.utils\n * @function isWebGLSupported\n * @returns {boolean} Is WebGL supported.\n */\nexport function isWebGLSupported(): boolean\n{\n if (typeof supported === 'undefined')\n {\n supported = (function supported(): boolean\n {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat: settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT,\n };\n\n try\n {\n if (!settings.ADAPTER.getWebGLRenderingContext())\n {\n return false;\n }\n\n const canvas = settings.ADAPTER.createCanvas();\n let gl = (\n canvas.getContext('webgl', contextOptions)\n || canvas.getContext('experimental-webgl', contextOptions)\n ) as WebGLRenderingContext | null;\n\n const success = !!gl?.getContextAttributes()?.stencil;\n\n if (gl)\n {\n const loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext)\n {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n }\n catch (e)\n {\n return false;\n }\n })();\n }\n\n return supported;\n}\n"],"names":["settings"],"mappings":";;;AAEA,IAAI;AAQG,SAAS,mBAChB;AACI,SAAI,OAAO,YAAc,QAErB,YAAa,WACb;AACI,UAAM,iBAAiB;AAAA,MACnB,SAAS;AAAA,MACT,8BAA8BA,SAAS,SAAA;AAAA,IAAA;AAI3C,QAAA;AACQ,UAAA,CAACA,SAAAA,SAAS,QAAQ,yBAAyB;AAEpC,eAAA;AAGL,YAAA,SAASA,SAAAA,SAAS,QAAQ,aAAa;AACzC,UAAA,KACA,OAAO,WAAW,SAAS,cAAc,KACtC,OAAO,WAAW,sBAAsB,cAAc;AAG7D,YAAM,UAAU,CAAC,CAAC,IAAI,wBAAwB;AAE9C,UAAI,IACJ;AACU,cAAA,cAAc,GAAG,aAAa,oBAAoB;AAEpD,uBAEA,YAAY;MAEpB;AAEA,aAAA,KAAK,MAEE;AAAA,IAAA,QAGX;AACW,aAAA;AAAA,IACX;AAAA,EAAA,EAID,IAAA;AACX;;"}

View File

@@ -0,0 +1,29 @@
import "../settings.mjs";
import { settings } from "@pixi/settings";
let supported;
function isWebGLSupported() {
return typeof supported > "u" && (supported = function() {
const contextOptions = {
stencil: !0,
failIfMajorPerformanceCaveat: settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT
};
try {
if (!settings.ADAPTER.getWebGLRenderingContext())
return !1;
const canvas = settings.ADAPTER.createCanvas();
let gl = canvas.getContext("webgl", contextOptions) || canvas.getContext("experimental-webgl", contextOptions);
const success = !!gl?.getContextAttributes()?.stencil;
if (gl) {
const loseContext = gl.getExtension("WEBGL_lose_context");
loseContext && loseContext.loseContext();
}
return gl = null, success;
} catch {
return !1;
}
}()), supported;
}
export {
isWebGLSupported
};
//# sourceMappingURL=isWebGLSupported.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isWebGLSupported.mjs","sources":["../../src/browser/isWebGLSupported.ts"],"sourcesContent":["import { settings } from '../settings';\n\nlet supported: boolean | undefined;\n\n/**\n * Helper for checking for WebGL support.\n * @memberof PIXI.utils\n * @function isWebGLSupported\n * @returns {boolean} Is WebGL supported.\n */\nexport function isWebGLSupported(): boolean\n{\n if (typeof supported === 'undefined')\n {\n supported = (function supported(): boolean\n {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat: settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT,\n };\n\n try\n {\n if (!settings.ADAPTER.getWebGLRenderingContext())\n {\n return false;\n }\n\n const canvas = settings.ADAPTER.createCanvas();\n let gl = (\n canvas.getContext('webgl', contextOptions)\n || canvas.getContext('experimental-webgl', contextOptions)\n ) as WebGLRenderingContext | null;\n\n const success = !!gl?.getContextAttributes()?.stencil;\n\n if (gl)\n {\n const loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext)\n {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n }\n catch (e)\n {\n return false;\n }\n })();\n }\n\n return supported;\n}\n"],"names":[],"mappings":";;AAEA,IAAI;AAQG,SAAS,mBAChB;AACI,SAAI,OAAO,YAAc,QAErB,YAAa,WACb;AACI,UAAM,iBAAiB;AAAA,MACnB,SAAS;AAAA,MACT,8BAA8B,SAAS;AAAA,IAAA;AAI3C,QAAA;AACQ,UAAA,CAAC,SAAS,QAAQ,yBAAyB;AAEpC,eAAA;AAGL,YAAA,SAAS,SAAS,QAAQ,aAAa;AACzC,UAAA,KACA,OAAO,WAAW,SAAS,cAAc,KACtC,OAAO,WAAW,sBAAsB,cAAc;AAG7D,YAAM,UAAU,CAAC,CAAC,IAAI,wBAAwB;AAE9C,UAAI,IACJ;AACU,cAAA,cAAc,GAAG,aAAa,oBAAoB;AAEpD,uBAEA,YAAY;MAEpB;AAEA,aAAA,KAAK,MAEE;AAAA,IAAA,QAGX;AACW,aAAA;AAAA,IACX;AAAA,EAAA,EAID,IAAA;AACX;"}

View File

@@ -0,0 +1,19 @@
"use strict";
var color = require("@pixi/color"), deprecation = require("../logging/deprecation.js");
function hex2rgb(hex, out = []) {
return deprecation.deprecation("7.2.0", "utils.hex2rgb is deprecated, use Color#toRgbArray instead"), color.Color.shared.setValue(hex).toRgbArray(out);
}
function hex2string(hex) {
return deprecation.deprecation("7.2.0", "utils.hex2string is deprecated, use Color#toHex instead"), color.Color.shared.setValue(hex).toHex();
}
function string2hex(string) {
return deprecation.deprecation("7.2.0", "utils.string2hex is deprecated, use Color#toNumber instead"), color.Color.shared.setValue(string).toNumber();
}
function rgb2hex(rgb) {
return deprecation.deprecation("7.2.0", "utils.rgb2hex is deprecated, use Color#toNumber instead"), color.Color.shared.setValue(rgb).toNumber();
}
exports.hex2rgb = hex2rgb;
exports.hex2string = hex2string;
exports.rgb2hex = rgb2hex;
exports.string2hex = string2hex;
//# sourceMappingURL=hex.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hex.js","sources":["../../src/color/hex.ts"],"sourcesContent":["import { Color } from '@pixi/color';\nimport { deprecation } from '../logging/deprecation';\n\n/**\n * Converts a hexadecimal color number to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).\n * @memberof PIXI.utils\n * @function hex2rgb\n * @see PIXI.Color.toRgbArray\n * @deprecated since 7.2.0\n * @param {number} hex - The hexadecimal number to convert\n * @param {number[]} [out=[]] - If supplied, this array will be used rather than returning a new one\n * @returns {number[]} An array representing the [R, G, B] of the color where all values are floats.\n */\nexport function hex2rgb(hex: number, out: Array<number> | Float32Array = []): Array<number> | Float32Array\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', 'utils.hex2rgb is deprecated, use Color#toRgbArray instead');\n }\n\n return Color.shared.setValue(hex).toRgbArray(out);\n}\n\n/**\n * Converts a hexadecimal color number to a string.\n * @see PIXI.Color.toHex\n * @deprecated since 7.2.0\n * @memberof PIXI.utils\n * @function hex2string\n * @param {number} hex - Number in hex (e.g., `0xffffff`)\n * @returns {string} The string color (e.g., `\"#ffffff\"`).\n */\nexport function hex2string(hex: number): string\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', 'utils.hex2string is deprecated, use Color#toHex instead');\n }\n\n return Color.shared.setValue(hex).toHex();\n}\n\n/**\n * Converts a string to a hexadecimal color number.\n * @deprecated since 7.2.0\n * @see PIXI.Color.toNumber\n * @memberof PIXI.utils\n * @function string2hex\n * @param {string} string - The string color (e.g., `\"#ffffff\"`)\n * @returns {number} Number in hexadecimal.\n */\nexport function string2hex(string: string): number\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', 'utils.string2hex is deprecated, use Color#toNumber instead');\n }\n\n return Color.shared.setValue(string).toNumber();\n}\n\n/**\n * Converts a color as an [R, G, B] array of normalized floats to a hexadecimal number.\n * @deprecated since 7.2.0\n * @see PIXI.Color.toNumber\n * @memberof PIXI.utils\n * @function rgb2hex\n * @param {number[]} rgb - Array of numbers where all values are normalized floats from 0.0 to 1.0.\n * @returns {number} Number in hexadecimal.\n */\nexport function rgb2hex(rgb: number[] | Float32Array): number\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', 'utils.rgb2hex is deprecated, use Color#toNumber instead');\n }\n\n return Color.shared.setValue(rgb).toNumber();\n}\n"],"names":["deprecation","Color"],"mappings":";;AAaO,SAAS,QAAQ,KAAa,MAAoC,IACzE;AAGoB,SAAAA,wBAAA,SAAS,2DAA2D,GAG7EC,MAAA,MAAM,OAAO,SAAS,GAAG,EAAE,WAAW,GAAG;AACpD;AAWO,SAAS,WAAW,KAC3B;AAGoB,SAAAD,YAAA,YAAA,SAAS,yDAAyD,GAG3EC,MAAAA,MAAM,OAAO,SAAS,GAAG,EAAE;AACtC;AAWO,SAAS,WAAW,QAC3B;AAGoB,SAAAD,YAAA,YAAA,SAAS,4DAA4D,GAG9EC,MAAAA,MAAM,OAAO,SAAS,MAAM,EAAE;AACzC;AAWO,SAAS,QAAQ,KACxB;AAGoB,SAAAD,YAAA,YAAA,SAAS,yDAAyD,GAG3EC,MAAAA,MAAM,OAAO,SAAS,GAAG,EAAE;AACtC;;;;;"}

View File

@@ -0,0 +1,21 @@
import { Color } from "@pixi/color";
import { deprecation } from "../logging/deprecation.mjs";
function hex2rgb(hex, out = []) {
return deprecation("7.2.0", "utils.hex2rgb is deprecated, use Color#toRgbArray instead"), Color.shared.setValue(hex).toRgbArray(out);
}
function hex2string(hex) {
return deprecation("7.2.0", "utils.hex2string is deprecated, use Color#toHex instead"), Color.shared.setValue(hex).toHex();
}
function string2hex(string) {
return deprecation("7.2.0", "utils.string2hex is deprecated, use Color#toNumber instead"), Color.shared.setValue(string).toNumber();
}
function rgb2hex(rgb) {
return deprecation("7.2.0", "utils.rgb2hex is deprecated, use Color#toNumber instead"), Color.shared.setValue(rgb).toNumber();
}
export {
hex2rgb,
hex2string,
rgb2hex,
string2hex
};
//# sourceMappingURL=hex.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"hex.mjs","sources":["../../src/color/hex.ts"],"sourcesContent":["import { Color } from '@pixi/color';\nimport { deprecation } from '../logging/deprecation';\n\n/**\n * Converts a hexadecimal color number to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).\n * @memberof PIXI.utils\n * @function hex2rgb\n * @see PIXI.Color.toRgbArray\n * @deprecated since 7.2.0\n * @param {number} hex - The hexadecimal number to convert\n * @param {number[]} [out=[]] - If supplied, this array will be used rather than returning a new one\n * @returns {number[]} An array representing the [R, G, B] of the color where all values are floats.\n */\nexport function hex2rgb(hex: number, out: Array<number> | Float32Array = []): Array<number> | Float32Array\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', 'utils.hex2rgb is deprecated, use Color#toRgbArray instead');\n }\n\n return Color.shared.setValue(hex).toRgbArray(out);\n}\n\n/**\n * Converts a hexadecimal color number to a string.\n * @see PIXI.Color.toHex\n * @deprecated since 7.2.0\n * @memberof PIXI.utils\n * @function hex2string\n * @param {number} hex - Number in hex (e.g., `0xffffff`)\n * @returns {string} The string color (e.g., `\"#ffffff\"`).\n */\nexport function hex2string(hex: number): string\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', 'utils.hex2string is deprecated, use Color#toHex instead');\n }\n\n return Color.shared.setValue(hex).toHex();\n}\n\n/**\n * Converts a string to a hexadecimal color number.\n * @deprecated since 7.2.0\n * @see PIXI.Color.toNumber\n * @memberof PIXI.utils\n * @function string2hex\n * @param {string} string - The string color (e.g., `\"#ffffff\"`)\n * @returns {number} Number in hexadecimal.\n */\nexport function string2hex(string: string): number\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', 'utils.string2hex is deprecated, use Color#toNumber instead');\n }\n\n return Color.shared.setValue(string).toNumber();\n}\n\n/**\n * Converts a color as an [R, G, B] array of normalized floats to a hexadecimal number.\n * @deprecated since 7.2.0\n * @see PIXI.Color.toNumber\n * @memberof PIXI.utils\n * @function rgb2hex\n * @param {number[]} rgb - Array of numbers where all values are normalized floats from 0.0 to 1.0.\n * @returns {number} Number in hexadecimal.\n */\nexport function rgb2hex(rgb: number[] | Float32Array): number\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', 'utils.rgb2hex is deprecated, use Color#toNumber instead');\n }\n\n return Color.shared.setValue(rgb).toNumber();\n}\n"],"names":[],"mappings":";;AAaO,SAAS,QAAQ,KAAa,MAAoC,IACzE;AAGoB,SAAA,YAAA,SAAS,2DAA2D,GAG7E,MAAM,OAAO,SAAS,GAAG,EAAE,WAAW,GAAG;AACpD;AAWO,SAAS,WAAW,KAC3B;AAGoB,SAAA,YAAA,SAAS,yDAAyD,GAG3E,MAAM,OAAO,SAAS,GAAG,EAAE;AACtC;AAWO,SAAS,WAAW,QAC3B;AAGoB,SAAA,YAAA,SAAS,4DAA4D,GAG9E,MAAM,OAAO,SAAS,MAAM,EAAE;AACzC;AAWO,SAAS,QAAQ,KACxB;AAGoB,SAAA,YAAA,SAAS,yDAAyD,GAG3E,MAAM,OAAO,SAAS,GAAG,EAAE;AACtC;"}

View File

@@ -0,0 +1,29 @@
"use strict";
var color = require("@pixi/color"), constants = require("@pixi/constants"), deprecation = require("../logging/deprecation.js");
function mapPremultipliedBlendModes() {
const pm = [], npm = [];
for (let i = 0; i < 32; i++)
pm[i] = i, npm[i] = i;
pm[constants.BLEND_MODES.NORMAL_NPM] = constants.BLEND_MODES.NORMAL, pm[constants.BLEND_MODES.ADD_NPM] = constants.BLEND_MODES.ADD, pm[constants.BLEND_MODES.SCREEN_NPM] = constants.BLEND_MODES.SCREEN, npm[constants.BLEND_MODES.NORMAL] = constants.BLEND_MODES.NORMAL_NPM, npm[constants.BLEND_MODES.ADD] = constants.BLEND_MODES.ADD_NPM, npm[constants.BLEND_MODES.SCREEN] = constants.BLEND_MODES.SCREEN_NPM;
const array = [];
return array.push(npm), array.push(pm), array;
}
const premultiplyBlendMode = mapPremultipliedBlendModes();
function correctBlendMode(blendMode, premultiplied) {
return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];
}
function premultiplyRgba(rgb, alpha, out, premultiply = !0) {
return deprecation.deprecation("7.2.0", "utils.premultiplyRgba has moved to Color.premultiply"), color.Color.shared.setValue(rgb).premultiply(alpha, premultiply).toArray(out ?? new Float32Array(4));
}
function premultiplyTint(tint, alpha) {
return deprecation.deprecation("7.2.0", "utils.premultiplyTint has moved to Color.toPremultiplied"), color.Color.shared.setValue(tint).toPremultiplied(alpha);
}
function premultiplyTintToRgba(tint, alpha, out, premultiply = !0) {
return deprecation.deprecation("7.2.0", "utils.premultiplyTintToRgba has moved to Color.premultiply"), color.Color.shared.setValue(tint).premultiply(alpha, premultiply).toArray(out ?? new Float32Array(4));
}
exports.correctBlendMode = correctBlendMode;
exports.premultiplyBlendMode = premultiplyBlendMode;
exports.premultiplyRgba = premultiplyRgba;
exports.premultiplyTint = premultiplyTint;
exports.premultiplyTintToRgba = premultiplyTintToRgba;
//# sourceMappingURL=premultiply.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"premultiply.js","sources":["../../src/color/premultiply.ts"],"sourcesContent":["import { Color } from '@pixi/color';\nimport { BLEND_MODES } from '@pixi/constants';\nimport { deprecation } from '../logging/deprecation';\n\n/**\n * Corrects PixiJS blend, takes premultiplied alpha into account\n * @memberof PIXI.utils\n * @function mapPremultipliedBlendModes\n * @private\n * @returns {Array<number[]>} Mapped modes.\n */\nfunction mapPremultipliedBlendModes(): number[][]\n{\n const pm = [];\n const npm = [];\n\n for (let i = 0; i < 32; i++)\n {\n pm[i] = i;\n npm[i] = i;\n }\n\n pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;\n pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;\n pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;\n\n npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM;\n npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM;\n npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;\n\n const array: number[][] = [];\n\n array.push(npm);\n array.push(pm);\n\n return array;\n}\n\n/**\n * maps premultiply flag and blendMode to adjusted blendMode\n * @memberof PIXI.utils\n * @type {Array<number[]>}\n */\nexport const premultiplyBlendMode = mapPremultipliedBlendModes();\n\n/**\n * changes blendMode according to texture format\n * @memberof PIXI.utils\n * @function correctBlendMode\n * @param {number} blendMode - supposed blend mode\n * @param {boolean} premultiplied - whether source is premultiplied\n * @returns {number} true blend mode for this texture\n */\nexport function correctBlendMode(blendMode: number, premultiplied: boolean): number\n{\n return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];\n}\n\n/**\n * @memberof PIXI.utils\n * @function premultiplyRgba\n * @deprecated since 7.2.0\n * @see PIXI.Color.premultiply\n * @param {Float32Array|number[]} rgb -\n * @param {number} alpha -\n * @param {Float32Array} [out] -\n * @param {boolean} [premultiply=true] -\n */\nexport function premultiplyRgba(\n rgb: Float32Array | number[],\n alpha: number,\n out?: Float32Array,\n premultiply = true\n): Float32Array\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', `utils.premultiplyRgba has moved to Color.premultiply`);\n }\n\n return Color.shared\n .setValue(rgb)\n .premultiply(alpha, premultiply)\n .toArray(out ?? new Float32Array(4));\n}\n\n/**\n * @memberof PIXI.utils\n * @function premultiplyTint\n * @deprecated since 7.2.0\n * @see PIXI.Color.toPremultiplied\n * @param {number} tint -\n * @param {number} alpha -\n */\nexport function premultiplyTint(tint: number, alpha: number): number\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', `utils.premultiplyTint has moved to Color.toPremultiplied`);\n }\n\n return Color.shared\n .setValue(tint)\n .toPremultiplied(alpha);\n}\n\n/**\n * @memberof PIXI.utils\n * @function premultiplyTintToRgba\n * @deprecated since 7.2.0\n * @see PIXI.Color.premultiply\n * @param {number} tint -\n * @param {number} alpha -\n * @param {Float32Array} [out] -\n * @param {boolean} [premultiply=true] -\n */\nexport function premultiplyTintToRgba(tint: number, alpha: number, out?: Float32Array, premultiply = true): Float32Array\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', `utils.premultiplyTintToRgba has moved to Color.premultiply`);\n }\n\n return Color.shared\n .setValue(tint)\n .premultiply(alpha, premultiply)\n .toArray(out ?? new Float32Array(4));\n}\n"],"names":["BLEND_MODES","deprecation","Color"],"mappings":";;AAWA,SAAS,6BACT;AACI,QAAM,KAAK,CAAA,GACL,MAAM;AAEH,WAAA,IAAI,GAAG,IAAI,IAAI;AAEpB,OAAG,CAAC,IAAI,GACR,IAAI,CAAC,IAAI;AAGb,KAAGA,UAAY,YAAA,UAAU,IAAIA,UAAAA,YAAY,QACzC,GAAGA,UAAA,YAAY,OAAO,IAAIA,UAAAA,YAAY,KACtC,GAAGA,UAAAA,YAAY,UAAU,IAAIA,sBAAY,QAEzC,IAAIA,UAAAA,YAAY,MAAM,IAAIA,UAAA,YAAY,YACtC,IAAIA,sBAAY,GAAG,IAAIA,sBAAY,SACnC,IAAIA,UAAAA,YAAY,MAAM,IAAIA,UAAY,YAAA;AAEtC,QAAM,QAAoB,CAAA;AAE1B,SAAA,MAAM,KAAK,GAAG,GACd,MAAM,KAAK,EAAE,GAEN;AACX;AAOO,MAAM,uBAAuB,2BAA2B;AAU/C,SAAA,iBAAiB,WAAmB,eACpD;AACI,SAAO,qBAAqB,gBAAgB,IAAI,CAAC,EAAE,SAAS;AAChE;AAYO,SAAS,gBACZ,KACA,OACA,KACA,cAAc,IAElB;AAGQ,SAAAC,YAAAA,YAAY,SAAS,sDAAsD,GAGxEC,MAAAA,MAAM,OACR,SAAS,GAAG,EACZ,YAAY,OAAO,WAAW,EAC9B,QAAQ,OAAO,IAAI,aAAa,CAAC,CAAC;AAC3C;AAUgB,SAAA,gBAAgB,MAAc,OAC9C;AAGoB,SAAAD,wBAAA,SAAS,0DAA0D,GAG5EC,MAAA,MAAM,OACR,SAAS,IAAI,EACb,gBAAgB,KAAK;AAC9B;AAYO,SAAS,sBAAsB,MAAc,OAAe,KAAoB,cAAc,IACrG;AAGQ,SAAAD,YAAAA,YAAY,SAAS,4DAA4D,GAG9EC,MAAAA,MAAM,OACR,SAAS,IAAI,EACb,YAAY,OAAO,WAAW,EAC9B,QAAQ,OAAO,IAAI,aAAa,CAAC,CAAC;AAC3C;;;;;;"}

View File

@@ -0,0 +1,32 @@
import { Color } from "@pixi/color";
import { BLEND_MODES } from "@pixi/constants";
import { deprecation } from "../logging/deprecation.mjs";
function mapPremultipliedBlendModes() {
const pm = [], npm = [];
for (let i = 0; i < 32; i++)
pm[i] = i, npm[i] = i;
pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL, pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD, pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN, npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM, npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM, npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;
const array = [];
return array.push(npm), array.push(pm), array;
}
const premultiplyBlendMode = mapPremultipliedBlendModes();
function correctBlendMode(blendMode, premultiplied) {
return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];
}
function premultiplyRgba(rgb, alpha, out, premultiply = !0) {
return deprecation("7.2.0", "utils.premultiplyRgba has moved to Color.premultiply"), Color.shared.setValue(rgb).premultiply(alpha, premultiply).toArray(out ?? new Float32Array(4));
}
function premultiplyTint(tint, alpha) {
return deprecation("7.2.0", "utils.premultiplyTint has moved to Color.toPremultiplied"), Color.shared.setValue(tint).toPremultiplied(alpha);
}
function premultiplyTintToRgba(tint, alpha, out, premultiply = !0) {
return deprecation("7.2.0", "utils.premultiplyTintToRgba has moved to Color.premultiply"), Color.shared.setValue(tint).premultiply(alpha, premultiply).toArray(out ?? new Float32Array(4));
}
export {
correctBlendMode,
premultiplyBlendMode,
premultiplyRgba,
premultiplyTint,
premultiplyTintToRgba
};
//# sourceMappingURL=premultiply.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"premultiply.mjs","sources":["../../src/color/premultiply.ts"],"sourcesContent":["import { Color } from '@pixi/color';\nimport { BLEND_MODES } from '@pixi/constants';\nimport { deprecation } from '../logging/deprecation';\n\n/**\n * Corrects PixiJS blend, takes premultiplied alpha into account\n * @memberof PIXI.utils\n * @function mapPremultipliedBlendModes\n * @private\n * @returns {Array<number[]>} Mapped modes.\n */\nfunction mapPremultipliedBlendModes(): number[][]\n{\n const pm = [];\n const npm = [];\n\n for (let i = 0; i < 32; i++)\n {\n pm[i] = i;\n npm[i] = i;\n }\n\n pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;\n pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;\n pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;\n\n npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM;\n npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM;\n npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;\n\n const array: number[][] = [];\n\n array.push(npm);\n array.push(pm);\n\n return array;\n}\n\n/**\n * maps premultiply flag and blendMode to adjusted blendMode\n * @memberof PIXI.utils\n * @type {Array<number[]>}\n */\nexport const premultiplyBlendMode = mapPremultipliedBlendModes();\n\n/**\n * changes blendMode according to texture format\n * @memberof PIXI.utils\n * @function correctBlendMode\n * @param {number} blendMode - supposed blend mode\n * @param {boolean} premultiplied - whether source is premultiplied\n * @returns {number} true blend mode for this texture\n */\nexport function correctBlendMode(blendMode: number, premultiplied: boolean): number\n{\n return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];\n}\n\n/**\n * @memberof PIXI.utils\n * @function premultiplyRgba\n * @deprecated since 7.2.0\n * @see PIXI.Color.premultiply\n * @param {Float32Array|number[]} rgb -\n * @param {number} alpha -\n * @param {Float32Array} [out] -\n * @param {boolean} [premultiply=true] -\n */\nexport function premultiplyRgba(\n rgb: Float32Array | number[],\n alpha: number,\n out?: Float32Array,\n premultiply = true\n): Float32Array\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', `utils.premultiplyRgba has moved to Color.premultiply`);\n }\n\n return Color.shared\n .setValue(rgb)\n .premultiply(alpha, premultiply)\n .toArray(out ?? new Float32Array(4));\n}\n\n/**\n * @memberof PIXI.utils\n * @function premultiplyTint\n * @deprecated since 7.2.0\n * @see PIXI.Color.toPremultiplied\n * @param {number} tint -\n * @param {number} alpha -\n */\nexport function premultiplyTint(tint: number, alpha: number): number\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', `utils.premultiplyTint has moved to Color.toPremultiplied`);\n }\n\n return Color.shared\n .setValue(tint)\n .toPremultiplied(alpha);\n}\n\n/**\n * @memberof PIXI.utils\n * @function premultiplyTintToRgba\n * @deprecated since 7.2.0\n * @see PIXI.Color.premultiply\n * @param {number} tint -\n * @param {number} alpha -\n * @param {Float32Array} [out] -\n * @param {boolean} [premultiply=true] -\n */\nexport function premultiplyTintToRgba(tint: number, alpha: number, out?: Float32Array, premultiply = true): Float32Array\n{\n if (process.env.DEBUG)\n {\n deprecation('7.2.0', `utils.premultiplyTintToRgba has moved to Color.premultiply`);\n }\n\n return Color.shared\n .setValue(tint)\n .premultiply(alpha, premultiply)\n .toArray(out ?? new Float32Array(4));\n}\n"],"names":[],"mappings":";;;AAWA,SAAS,6BACT;AACI,QAAM,KAAK,CAAA,GACL,MAAM;AAEH,WAAA,IAAI,GAAG,IAAI,IAAI;AAEpB,OAAG,CAAC,IAAI,GACR,IAAI,CAAC,IAAI;AAGb,KAAG,YAAY,UAAU,IAAI,YAAY,QACzC,GAAG,YAAY,OAAO,IAAI,YAAY,KACtC,GAAG,YAAY,UAAU,IAAI,YAAY,QAEzC,IAAI,YAAY,MAAM,IAAI,YAAY,YACtC,IAAI,YAAY,GAAG,IAAI,YAAY,SACnC,IAAI,YAAY,MAAM,IAAI,YAAY;AAEtC,QAAM,QAAoB,CAAA;AAE1B,SAAA,MAAM,KAAK,GAAG,GACd,MAAM,KAAK,EAAE,GAEN;AACX;AAOO,MAAM,uBAAuB,2BAA2B;AAU/C,SAAA,iBAAiB,WAAmB,eACpD;AACI,SAAO,qBAAqB,gBAAgB,IAAI,CAAC,EAAE,SAAS;AAChE;AAYO,SAAS,gBACZ,KACA,OACA,KACA,cAAc,IAElB;AAGQ,SAAA,YAAY,SAAS,sDAAsD,GAGxE,MAAM,OACR,SAAS,GAAG,EACZ,YAAY,OAAO,WAAW,EAC9B,QAAQ,OAAO,IAAI,aAAa,CAAC,CAAC;AAC3C;AAUgB,SAAA,gBAAgB,MAAc,OAC9C;AAGoB,SAAA,YAAA,SAAS,0DAA0D,GAG5E,MAAM,OACR,SAAS,IAAI,EACb,gBAAgB,KAAK;AAC9B;AAYO,SAAS,sBAAsB,MAAc,OAAe,KAAoB,cAAc,IACrG;AAGQ,SAAA,YAAY,SAAS,4DAA4D,GAG9E,MAAM,OACR,SAAS,IAAI,EACb,YAAY,OAAO,WAAW,EAC9B,QAAQ,OAAO,IAAI,aAAa,CAAC,CAAC;AAC3C;"}

4
resources/app/node_modules/@pixi/utils/lib/const.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
"use strict";
const DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;
exports.DATA_URI = DATA_URI;
//# sourceMappingURL=const.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"const.js","sources":["../src/const.ts"],"sourcesContent":["/**\n * Regexp for data URI.\n * Based on: {@link https://github.com/ragingwind/data-uri-regex}\n * @static\n * @type {RegExp}\n * @memberof PIXI\n * @example\n * import { DATA_URI } from 'pixi.js';\n *\n * DATA_URI.test('data:image/png;base64,foobar'); // => true\n */\nexport const DATA_URI = /^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;charset=([\\w-]+))?(?:;(base64))?,(.*)/i;\n"],"names":[],"mappings":";AAWO,MAAM,WAAW;;"}

5
resources/app/node_modules/@pixi/utils/lib/const.mjs generated vendored Normal file
View File

@@ -0,0 +1,5 @@
const DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;
export {
DATA_URI
};
//# sourceMappingURL=const.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"const.mjs","sources":["../src/const.ts"],"sourcesContent":["/**\n * Regexp for data URI.\n * Based on: {@link https://github.com/ragingwind/data-uri-regex}\n * @static\n * @type {RegExp}\n * @memberof PIXI\n * @example\n * import { DATA_URI } from 'pixi.js';\n *\n * DATA_URI.test('data:image/png;base64,foobar'); // => true\n */\nexport const DATA_URI = /^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;charset=([\\w-]+))?(?:;(base64))?,(.*)/i;\n"],"names":[],"mappings":"AAWO,MAAM,WAAW;"}

View File

@@ -0,0 +1,11 @@
"use strict";
function createIndicesForQuads(size, outBuffer = null) {
const totalIndices = size * 6;
if (outBuffer = outBuffer || new Uint16Array(totalIndices), outBuffer.length !== totalIndices)
throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);
for (let 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;
//# sourceMappingURL=createIndicesForQuads.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createIndicesForQuads.js","sources":["../../src/data/createIndicesForQuads.ts"],"sourcesContent":["/**\n * Generic Mask Stack data structure\n * @memberof PIXI.utils\n * @function createIndicesForQuads\n * @param {number} size - Number of quads\n * @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size`\n * @returns {Uint16Array|Uint32Array} - Resulting index buffer\n */\nexport function createIndicesForQuads(\n size: number,\n outBuffer: Uint16Array | Uint32Array | null = null\n): Uint16Array | Uint32Array\n{\n // the total number of indices in our array, there are 6 points per quad.\n const totalIndices = size * 6;\n\n outBuffer = outBuffer || new Uint16Array(totalIndices);\n\n if (outBuffer.length !== totalIndices)\n {\n throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);\n }\n\n // fill the indices with the quads to draw\n for (let i = 0, j = 0; i < totalIndices; i += 6, j += 4)\n {\n outBuffer[i + 0] = j + 0;\n outBuffer[i + 1] = j + 1;\n outBuffer[i + 2] = j + 2;\n outBuffer[i + 3] = j + 0;\n outBuffer[i + 4] = j + 2;\n outBuffer[i + 5] = j + 3;\n }\n\n return outBuffer;\n}\n"],"names":[],"mappings":";AAQgB,SAAA,sBACZ,MACA,YAA8C,MAElD;AAEI,QAAM,eAAe,OAAO;AAI5B,MAFA,YAAY,aAAa,IAAI,YAAY,YAAY,GAEjD,UAAU,WAAW;AAErB,UAAM,IAAI,MAAM,uCAAuC,UAAU,MAAM,iBAAiB,YAAY,EAAE;AAIjG,WAAA,IAAI,GAAG,IAAI,GAAG,IAAI,cAAc,KAAK,GAAG,KAAK;AAElD,cAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI;AAGpB,SAAA;AACX;;"}

View File

@@ -0,0 +1,12 @@
function createIndicesForQuads(size, outBuffer = null) {
const totalIndices = size * 6;
if (outBuffer = outBuffer || new Uint16Array(totalIndices), outBuffer.length !== totalIndices)
throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);
for (let 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;
}
export {
createIndicesForQuads
};
//# sourceMappingURL=createIndicesForQuads.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"createIndicesForQuads.mjs","sources":["../../src/data/createIndicesForQuads.ts"],"sourcesContent":["/**\n * Generic Mask Stack data structure\n * @memberof PIXI.utils\n * @function createIndicesForQuads\n * @param {number} size - Number of quads\n * @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size`\n * @returns {Uint16Array|Uint32Array} - Resulting index buffer\n */\nexport function createIndicesForQuads(\n size: number,\n outBuffer: Uint16Array | Uint32Array | null = null\n): Uint16Array | Uint32Array\n{\n // the total number of indices in our array, there are 6 points per quad.\n const totalIndices = size * 6;\n\n outBuffer = outBuffer || new Uint16Array(totalIndices);\n\n if (outBuffer.length !== totalIndices)\n {\n throw new Error(`Out buffer length is incorrect, got ${outBuffer.length} and expected ${totalIndices}`);\n }\n\n // fill the indices with the quads to draw\n for (let i = 0, j = 0; i < totalIndices; i += 6, j += 4)\n {\n outBuffer[i + 0] = j + 0;\n outBuffer[i + 1] = j + 1;\n outBuffer[i + 2] = j + 2;\n outBuffer[i + 3] = j + 0;\n outBuffer[i + 4] = j + 2;\n outBuffer[i + 5] = j + 3;\n }\n\n return outBuffer;\n}\n"],"names":[],"mappings":"AAQgB,SAAA,sBACZ,MACA,YAA8C,MAElD;AAEI,QAAM,eAAe,OAAO;AAI5B,MAFA,YAAY,aAAa,IAAI,YAAY,YAAY,GAEjD,UAAU,WAAW;AAErB,UAAM,IAAI,MAAM,uCAAuC,UAAU,MAAM,iBAAiB,YAAY,EAAE;AAIjG,WAAA,IAAI,GAAG,IAAI,GAAG,IAAI,cAAc,KAAK,GAAG,KAAK;AAElD,cAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI,GACvB,UAAU,IAAI,CAAC,IAAI,IAAI;AAGpB,SAAA;AACX;"}

View File

@@ -0,0 +1,13 @@
"use strict";
function getBufferType(array) {
if (array.BYTES_PER_ELEMENT === 4)
return array instanceof Float32Array ? "Float32Array" : array instanceof Uint32Array ? "Uint32Array" : "Int32Array";
if (array.BYTES_PER_ELEMENT === 2) {
if (array instanceof Uint16Array)
return "Uint16Array";
} else if (array.BYTES_PER_ELEMENT === 1 && array instanceof Uint8Array)
return "Uint8Array";
return null;
}
exports.getBufferType = getBufferType;
//# sourceMappingURL=getBufferType.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getBufferType.js","sources":["../../src/data/getBufferType.ts"],"sourcesContent":["import type { ITypedArray } from '@pixi/core';\n\nexport function getBufferType(\n array: ITypedArray\n): 'Float32Array' | 'Uint32Array' | 'Int32Array' | 'Uint16Array' | 'Uint8Array' | null\n{\n if (array.BYTES_PER_ELEMENT === 4)\n {\n if (array instanceof Float32Array)\n {\n return 'Float32Array';\n }\n else if (array instanceof Uint32Array)\n {\n return 'Uint32Array';\n }\n\n return 'Int32Array';\n }\n else if (array.BYTES_PER_ELEMENT === 2)\n {\n if (array instanceof Uint16Array)\n {\n return 'Uint16Array';\n }\n }\n else if (array.BYTES_PER_ELEMENT === 1)\n {\n if (array instanceof Uint8Array)\n {\n return 'Uint8Array';\n }\n }\n\n // TODO map out the rest of the array elements!\n return null;\n}\n"],"names":[],"mappings":";AAEO,SAAS,cACZ,OAEJ;AACI,MAAI,MAAM,sBAAsB;AAE5B,WAAI,iBAAiB,eAEV,iBAEF,iBAAiB,cAEf,gBAGJ;AAEN,MAAI,MAAM,sBAAsB;AAEjC,QAAI,iBAAiB;AAEV,aAAA;AAAA,aAGN,MAAM,sBAAsB,KAE7B,iBAAiB;AAEV,WAAA;AAKR,SAAA;AACX;;"}

View File

@@ -0,0 +1,14 @@
function getBufferType(array) {
if (array.BYTES_PER_ELEMENT === 4)
return array instanceof Float32Array ? "Float32Array" : array instanceof Uint32Array ? "Uint32Array" : "Int32Array";
if (array.BYTES_PER_ELEMENT === 2) {
if (array instanceof Uint16Array)
return "Uint16Array";
} else if (array.BYTES_PER_ELEMENT === 1 && array instanceof Uint8Array)
return "Uint8Array";
return null;
}
export {
getBufferType
};
//# sourceMappingURL=getBufferType.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getBufferType.mjs","sources":["../../src/data/getBufferType.ts"],"sourcesContent":["import type { ITypedArray } from '@pixi/core';\n\nexport function getBufferType(\n array: ITypedArray\n): 'Float32Array' | 'Uint32Array' | 'Int32Array' | 'Uint16Array' | 'Uint8Array' | null\n{\n if (array.BYTES_PER_ELEMENT === 4)\n {\n if (array instanceof Float32Array)\n {\n return 'Float32Array';\n }\n else if (array instanceof Uint32Array)\n {\n return 'Uint32Array';\n }\n\n return 'Int32Array';\n }\n else if (array.BYTES_PER_ELEMENT === 2)\n {\n if (array instanceof Uint16Array)\n {\n return 'Uint16Array';\n }\n }\n else if (array.BYTES_PER_ELEMENT === 1)\n {\n if (array instanceof Uint8Array)\n {\n return 'Uint8Array';\n }\n }\n\n // TODO map out the rest of the array elements!\n return null;\n}\n"],"names":[],"mappings":"AAEO,SAAS,cACZ,OAEJ;AACI,MAAI,MAAM,sBAAsB;AAE5B,WAAI,iBAAiB,eAEV,iBAEF,iBAAiB,cAEf,gBAGJ;AAEN,MAAI,MAAM,sBAAsB;AAEjC,QAAI,iBAAiB;AAEV,aAAA;AAAA,aAGN,MAAM,sBAAsB,KAE7B,iBAAiB;AAEV,WAAA;AAKR,SAAA;AACX;"}

View File

@@ -0,0 +1,23 @@
"use strict";
var getBufferType = require("./getBufferType.js");
const map = { Float32Array, Uint32Array, Int32Array, Uint8Array };
function interleaveTypedArrays(arrays, sizes) {
let outSize = 0, stride = 0;
const views = {};
for (let i = 0; i < arrays.length; i++)
stride += sizes[i], outSize += arrays[i].length;
const buffer = new ArrayBuffer(outSize * 4);
let out = null, littleOffset = 0;
for (let i = 0; i < arrays.length; i++) {
const size = sizes[i], array = arrays[i], type = getBufferType.getBufferType(array);
views[type] || (views[type] = new map[type](buffer)), out = views[type];
for (let j = 0; j < array.length; j++) {
const indexStart = (j / size | 0) * stride + littleOffset, index = j % size;
out[indexStart + index] = array[j];
}
littleOffset += size;
}
return new Float32Array(buffer);
}
exports.interleaveTypedArrays = interleaveTypedArrays;
//# sourceMappingURL=interleaveTypedArrays.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"interleaveTypedArrays.js","sources":["../../src/data/interleaveTypedArrays.ts"],"sourcesContent":["import { getBufferType } from './getBufferType';\n\n/* eslint-disable object-shorthand */\nconst map = { Float32Array: Float32Array, Uint32Array: Uint32Array, Int32Array: Int32Array, Uint8Array: Uint8Array };\n\ntype PackedArray = Float32Array | Uint32Array | Int32Array | Uint8Array;\n\nexport function interleaveTypedArrays(arrays: PackedArray[], sizes: number[]): Float32Array\n{\n let outSize = 0;\n let stride = 0;\n const views: {[key: string]: PackedArray} = {};\n\n for (let i = 0; i < arrays.length; i++)\n {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n\n const buffer = new ArrayBuffer(outSize * 4);\n\n let out = null;\n let littleOffset = 0;\n\n for (let i = 0; i < arrays.length; i++)\n {\n const size = sizes[i];\n const array = arrays[i];\n\n /*\n @todo This is unsafe casting but consistent with how the code worked previously. Should it stay this way\n or should and `getBufferTypeUnsafe` function be exposed that throws an Error if unsupported type is passed?\n */\n const type = getBufferType(array) as keyof typeof map;\n\n if (!views[type])\n {\n views[type] = new map[type](buffer);\n }\n\n out = views[type];\n\n for (let j = 0; j < array.length; j++)\n {\n const indexStart = ((j / size | 0) * stride) + littleOffset;\n const index = j % size;\n\n out[indexStart + index] = array[j];\n }\n\n littleOffset += size;\n }\n\n return new Float32Array(buffer);\n}\n"],"names":["getBufferType"],"mappings":";;AAGA,MAAM,MAAM,EAAE,cAA4B,aAA0B,YAAwB,WAAuB;AAInG,SAAA,sBAAsB,QAAuB,OAC7D;AACQ,MAAA,UAAU,GACV,SAAS;AACb,QAAM,QAAsC,CAAA;AAE5C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ;AAE/B,cAAU,MAAM,CAAC,GACjB,WAAW,OAAO,CAAC,EAAE;AAGzB,QAAM,SAAS,IAAI,YAAY,UAAU,CAAC;AAEtC,MAAA,MAAM,MACN,eAAe;AAEnB,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KACnC;AACU,UAAA,OAAO,MAAM,CAAC,GACd,QAAQ,OAAO,CAAC,GAMhB,OAAOA,cAAA,cAAc,KAAK;AAE3B,UAAM,IAAI,MAEX,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,MAAM,IAGtC,MAAM,MAAM,IAAI;AAEhB,aAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAClC;AACI,YAAM,cAAe,IAAI,OAAO,KAAK,SAAU,cACzC,QAAQ,IAAI;AAElB,UAAI,aAAa,KAAK,IAAI,MAAM,CAAC;AAAA,IACrC;AAEgB,oBAAA;AAAA,EACpB;AAEO,SAAA,IAAI,aAAa,MAAM;AAClC;;"}

View File

@@ -0,0 +1,24 @@
import { getBufferType } from "./getBufferType.mjs";
const map = { Float32Array, Uint32Array, Int32Array, Uint8Array };
function interleaveTypedArrays(arrays, sizes) {
let outSize = 0, stride = 0;
const views = {};
for (let i = 0; i < arrays.length; i++)
stride += sizes[i], outSize += arrays[i].length;
const buffer = new ArrayBuffer(outSize * 4);
let out = null, littleOffset = 0;
for (let i = 0; i < arrays.length; i++) {
const size = sizes[i], array = arrays[i], type = getBufferType(array);
views[type] || (views[type] = new map[type](buffer)), out = views[type];
for (let j = 0; j < array.length; j++) {
const indexStart = (j / size | 0) * stride + littleOffset, index = j % size;
out[indexStart + index] = array[j];
}
littleOffset += size;
}
return new Float32Array(buffer);
}
export {
interleaveTypedArrays
};
//# sourceMappingURL=interleaveTypedArrays.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"interleaveTypedArrays.mjs","sources":["../../src/data/interleaveTypedArrays.ts"],"sourcesContent":["import { getBufferType } from './getBufferType';\n\n/* eslint-disable object-shorthand */\nconst map = { Float32Array: Float32Array, Uint32Array: Uint32Array, Int32Array: Int32Array, Uint8Array: Uint8Array };\n\ntype PackedArray = Float32Array | Uint32Array | Int32Array | Uint8Array;\n\nexport function interleaveTypedArrays(arrays: PackedArray[], sizes: number[]): Float32Array\n{\n let outSize = 0;\n let stride = 0;\n const views: {[key: string]: PackedArray} = {};\n\n for (let i = 0; i < arrays.length; i++)\n {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n\n const buffer = new ArrayBuffer(outSize * 4);\n\n let out = null;\n let littleOffset = 0;\n\n for (let i = 0; i < arrays.length; i++)\n {\n const size = sizes[i];\n const array = arrays[i];\n\n /*\n @todo This is unsafe casting but consistent with how the code worked previously. Should it stay this way\n or should and `getBufferTypeUnsafe` function be exposed that throws an Error if unsupported type is passed?\n */\n const type = getBufferType(array) as keyof typeof map;\n\n if (!views[type])\n {\n views[type] = new map[type](buffer);\n }\n\n out = views[type];\n\n for (let j = 0; j < array.length; j++)\n {\n const indexStart = ((j / size | 0) * stride) + littleOffset;\n const index = j % size;\n\n out[indexStart + index] = array[j];\n }\n\n littleOffset += size;\n }\n\n return new Float32Array(buffer);\n}\n"],"names":[],"mappings":";AAGA,MAAM,MAAM,EAAE,cAA4B,aAA0B,YAAwB,WAAuB;AAInG,SAAA,sBAAsB,QAAuB,OAC7D;AACQ,MAAA,UAAU,GACV,SAAS;AACb,QAAM,QAAsC,CAAA;AAE5C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ;AAE/B,cAAU,MAAM,CAAC,GACjB,WAAW,OAAO,CAAC,EAAE;AAGzB,QAAM,SAAS,IAAI,YAAY,UAAU,CAAC;AAEtC,MAAA,MAAM,MACN,eAAe;AAEnB,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KACnC;AACU,UAAA,OAAO,MAAM,CAAC,GACd,QAAQ,OAAO,CAAC,GAMhB,OAAO,cAAc,KAAK;AAE3B,UAAM,IAAI,MAEX,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,MAAM,IAGtC,MAAM,MAAM,IAAI;AAEhB,aAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAClC;AACI,YAAM,cAAe,IAAI,OAAO,KAAK,SAAU,cACzC,QAAQ,IAAI;AAElB,UAAI,aAAa,KAAK,IAAI,MAAM,CAAC;AAAA,IACrC;AAEgB,oBAAA;AAAA,EACpB;AAEO,SAAA,IAAI,aAAa,MAAM;AAClC;"}

View File

@@ -0,0 +1,17 @@
"use strict";
function nextPow2(v) {
return v += v === 0 ? 1 : 0, --v, v |= v >>> 1, v |= v >>> 2, v |= v >>> 4, v |= v >>> 8, v |= v >>> 16, v + 1;
}
function isPow2(v) {
return !(v & v - 1) && !!v;
}
function log2(v) {
let r = (v > 65535 ? 1 : 0) << 4;
v >>>= r;
let shift = (v > 255 ? 1 : 0) << 3;
return v >>>= shift, r |= shift, shift = (v > 15 ? 1 : 0) << 2, v >>>= shift, r |= shift, shift = (v > 3 ? 1 : 0) << 1, v >>>= shift, r |= shift, r | v >> 1;
}
exports.isPow2 = isPow2;
exports.log2 = log2;
exports.nextPow2 = nextPow2;
//# sourceMappingURL=pow2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pow2.js","sources":["../../src/data/pow2.ts"],"sourcesContent":["// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n * @function log2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\n}\n"],"names":[],"mappings":";AASO,SAAS,SAAS,GACzB;AACS,SAAA,KAAA,MAAM,IAAI,IAAI,GACnB,EAAE,GACF,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,IAEJ,IAAI;AACf;AASO,SAAS,OAAO,GACvB;AACI,SAAO,EAAE,IAAK,IAAI,MAAQ,CAAC,CAAC;AAChC;AASO,SAAS,KAAK,GACrB;AACI,MAAI,KAAK,IAAI,QAAS,IAAI,MAAM;AAEzB,SAAA;AAEP,MAAI,SAAS,IAAI,MAAO,IAAI,MAAM;AAE3B,SAAA,OAAA,OAAO,KAAK,OACnB,SAAS,IAAI,KAAM,IAAI,MAAM,GAC7B,OAAO,OAAO,KAAK,OACnB,SAAS,IAAI,IAAM,IAAI,MAAM,GAC7B,OAAO,OAAO,KAAK,OAEZ,IAAK,KAAK;AACrB;;;;"}

View File

@@ -0,0 +1,18 @@
function nextPow2(v) {
return v += v === 0 ? 1 : 0, --v, v |= v >>> 1, v |= v >>> 2, v |= v >>> 4, v |= v >>> 8, v |= v >>> 16, v + 1;
}
function isPow2(v) {
return !(v & v - 1) && !!v;
}
function log2(v) {
let r = (v > 65535 ? 1 : 0) << 4;
v >>>= r;
let shift = (v > 255 ? 1 : 0) << 3;
return v >>>= shift, r |= shift, shift = (v > 15 ? 1 : 0) << 2, v >>>= shift, r |= shift, shift = (v > 3 ? 1 : 0) << 1, v >>>= shift, r |= shift, r | v >> 1;
}
export {
isPow2,
log2,
nextPow2
};
//# sourceMappingURL=pow2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"pow2.mjs","sources":["../../src/data/pow2.ts"],"sourcesContent":["// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n * @function log2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\n}\n"],"names":[],"mappings":"AASO,SAAS,SAAS,GACzB;AACS,SAAA,KAAA,MAAM,IAAI,IAAI,GACnB,EAAE,GACF,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,GACX,KAAK,MAAM,IAEJ,IAAI;AACf;AASO,SAAS,OAAO,GACvB;AACI,SAAO,EAAE,IAAK,IAAI,MAAQ,CAAC,CAAC;AAChC;AASO,SAAS,KAAK,GACrB;AACI,MAAI,KAAK,IAAI,QAAS,IAAI,MAAM;AAEzB,SAAA;AAEP,MAAI,SAAS,IAAI,MAAO,IAAI,MAAM;AAE3B,SAAA,OAAA,OAAO,KAAK,OACnB,SAAS,IAAI,KAAM,IAAI,MAAM,GAC7B,OAAO,OAAO,KAAK,OACnB,SAAS,IAAI,IAAM,IAAI,MAAM,GAC7B,OAAO,OAAO,KAAK,OAEZ,IAAK,KAAK;AACrB;"}

View File

@@ -0,0 +1,14 @@
"use strict";
function removeItems(arr, startIdx, removeCount) {
const length = arr.length;
let i;
if (startIdx >= length || removeCount === 0)
return;
removeCount = startIdx + removeCount > length ? length - startIdx : removeCount;
const len = length - removeCount;
for (i = startIdx; i < len; ++i)
arr[i] = arr[i + removeCount];
arr.length = len;
}
exports.removeItems = removeItems;
//# sourceMappingURL=removeItems.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"removeItems.js","sources":["../../src/data/removeItems.ts"],"sourcesContent":["/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @memberof PIXI.utils\n * @param {Array<any>} arr - Array to remove elements from\n * @param {number} startIdx - starting index\n * @param {number} removeCount - how many to remove\n */\nexport function removeItems(arr: any[], startIdx: number, removeCount: number): void\n{\n const length = arr.length;\n let i;\n\n if (startIdx >= length || removeCount === 0)\n {\n return;\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n\n const len = length - removeCount;\n\n for (i = startIdx; i < len; ++i)\n {\n arr[i] = arr[i + removeCount];\n }\n\n arr.length = len;\n}\n"],"names":[],"mappings":";AAQgB,SAAA,YAAY,KAAY,UAAkB,aAC1D;AACI,QAAM,SAAS,IAAI;AACf,MAAA;AAEA,MAAA,YAAY,UAAU,gBAAgB;AAEtC;AAGJ,gBAAe,WAAW,cAAc,SAAS,SAAS,WAAW;AAErE,QAAM,MAAM,SAAS;AAErB,OAAK,IAAI,UAAU,IAAI,KAAK,EAAE;AAE1B,QAAI,CAAC,IAAI,IAAI,IAAI,WAAW;AAGhC,MAAI,SAAS;AACjB;;"}

View File

@@ -0,0 +1,15 @@
function removeItems(arr, startIdx, removeCount) {
const length = arr.length;
let i;
if (startIdx >= length || removeCount === 0)
return;
removeCount = startIdx + removeCount > length ? length - startIdx : removeCount;
const len = length - removeCount;
for (i = startIdx; i < len; ++i)
arr[i] = arr[i + removeCount];
arr.length = len;
}
export {
removeItems
};
//# sourceMappingURL=removeItems.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"removeItems.mjs","sources":["../../src/data/removeItems.ts"],"sourcesContent":["/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @memberof PIXI.utils\n * @param {Array<any>} arr - Array to remove elements from\n * @param {number} startIdx - starting index\n * @param {number} removeCount - how many to remove\n */\nexport function removeItems(arr: any[], startIdx: number, removeCount: number): void\n{\n const length = arr.length;\n let i;\n\n if (startIdx >= length || removeCount === 0)\n {\n return;\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n\n const len = length - removeCount;\n\n for (i = startIdx; i < len; ++i)\n {\n arr[i] = arr[i + removeCount];\n }\n\n arr.length = len;\n}\n"],"names":[],"mappings":"AAQgB,SAAA,YAAY,KAAY,UAAkB,aAC1D;AACI,QAAM,SAAS,IAAI;AACf,MAAA;AAEA,MAAA,YAAY,UAAU,gBAAgB;AAEtC;AAGJ,gBAAe,WAAW,cAAc,SAAS,SAAS,WAAW;AAErE,QAAM,MAAM,SAAS;AAErB,OAAK,IAAI,UAAU,IAAI,KAAK,EAAE;AAE1B,QAAI,CAAC,IAAI,IAAI,IAAI,WAAW;AAGhC,MAAI,SAAS;AACjB;"}

View File

@@ -0,0 +1,6 @@
"use strict";
function sign(n) {
return n === 0 ? 0 : n < 0 ? -1 : 1;
}
exports.sign = sign;
//# sourceMappingURL=sign.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sign.js","sources":["../../src/data/sign.ts"],"sourcesContent":["/**\n * Returns sign of number\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nexport function sign(n: number): -1 | 0 | 1\n{\n if (n === 0) return 0;\n\n return n < 0 ? -1 : 1;\n}\n"],"names":[],"mappings":";AAOO,SAAS,KAAK,GACrB;AACI,SAAI,MAAM,IAAU,IAEb,IAAI,IAAI,KAAK;AACxB;;"}

View File

@@ -0,0 +1,7 @@
function sign(n) {
return n === 0 ? 0 : n < 0 ? -1 : 1;
}
export {
sign
};
//# sourceMappingURL=sign.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sign.mjs","sources":["../../src/data/sign.ts"],"sourcesContent":["/**\n * Returns sign of number\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nexport function sign(n: number): -1 | 0 | 1\n{\n if (n === 0) return 0;\n\n return n < 0 ? -1 : 1;\n}\n"],"names":[],"mappings":"AAOO,SAAS,KAAK,GACrB;AACI,SAAI,MAAM,IAAU,IAEb,IAAI,IAAI,KAAK;AACxB;"}

View File

@@ -0,0 +1,7 @@
"use strict";
let nextUid = 0;
function uid() {
return ++nextUid;
}
exports.uid = uid;
//# sourceMappingURL=uid.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"uid.js","sources":["../../src/data/uid.ts"],"sourcesContent":["let nextUid = 0;\n\n/**\n * Gets the next unique identifier\n * @memberof PIXI.utils\n * @function uid\n * @returns {number} The next unique identifier to use.\n */\nexport function uid(): number\n{\n return ++nextUid;\n}\n"],"names":[],"mappings":";AAAA,IAAI,UAAU;AAQP,SAAS,MAChB;AACI,SAAO,EAAE;AACb;;"}

View File

@@ -0,0 +1,8 @@
let nextUid = 0;
function uid() {
return ++nextUid;
}
export {
uid
};
//# sourceMappingURL=uid.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"uid.mjs","sources":["../../src/data/uid.ts"],"sourcesContent":["let nextUid = 0;\n\n/**\n * Gets the next unique identifier\n * @memberof PIXI.utils\n * @function uid\n * @returns {number} The next unique identifier to use.\n */\nexport function uid(): number\n{\n return ++nextUid;\n}\n"],"names":[],"mappings":"AAAA,IAAI,UAAU;AAQP,SAAS,MAChB;AACI,SAAO,EAAE;AACb;"}

51
resources/app/node_modules/@pixi/utils/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
"use strict";
require("./settings.js");
var settings = require("@pixi/settings"), eventemitter3 = require("eventemitter3"), earcut = require("earcut"), url = require("./url.js"), path = require("./path.js"), detectVideoAlphaMode = require("./browser/detectVideoAlphaMode.js"), hello = require("./browser/hello.js"), isWebGLSupported = require("./browser/isWebGLSupported.js"), hex = require("./color/hex.js"), premultiply = require("./color/premultiply.js"), _const = require("./const.js"), createIndicesForQuads = require("./data/createIndicesForQuads.js"), getBufferType = require("./data/getBufferType.js"), interleaveTypedArrays = require("./data/interleaveTypedArrays.js"), pow2 = require("./data/pow2.js"), removeItems = require("./data/removeItems.js"), sign = require("./data/sign.js"), uid = require("./data/uid.js"), deprecation = require("./logging/deprecation.js"), BoundingBox = require("./media/BoundingBox.js"), caches = require("./media/caches.js"), CanvasRenderTarget = require("./media/CanvasRenderTarget.js"), getCanvasBoundingBox = require("./media/getCanvasBoundingBox.js"), trimCanvas = require("./media/trimCanvas.js"), decomposeDataUri = require("./network/decomposeDataUri.js"), determineCrossOrigin = require("./network/determineCrossOrigin.js"), getResolutionOfUrl = require("./network/getResolutionOfUrl.js");
require("./types/index.js");
Object.defineProperty(exports, "isMobile", {
enumerable: !0,
get: function() {
return settings.isMobile;
}
});
exports.EventEmitter = eventemitter3;
exports.earcut = earcut;
exports.url = url.url;
exports.path = path.path;
exports.detectVideoAlphaMode = detectVideoAlphaMode.detectVideoAlphaMode;
exports.sayHello = hello.sayHello;
exports.skipHello = hello.skipHello;
exports.isWebGLSupported = isWebGLSupported.isWebGLSupported;
exports.hex2rgb = hex.hex2rgb;
exports.hex2string = hex.hex2string;
exports.rgb2hex = hex.rgb2hex;
exports.string2hex = hex.string2hex;
exports.correctBlendMode = premultiply.correctBlendMode;
exports.premultiplyBlendMode = premultiply.premultiplyBlendMode;
exports.premultiplyRgba = premultiply.premultiplyRgba;
exports.premultiplyTint = premultiply.premultiplyTint;
exports.premultiplyTintToRgba = premultiply.premultiplyTintToRgba;
exports.DATA_URI = _const.DATA_URI;
exports.createIndicesForQuads = createIndicesForQuads.createIndicesForQuads;
exports.getBufferType = getBufferType.getBufferType;
exports.interleaveTypedArrays = interleaveTypedArrays.interleaveTypedArrays;
exports.isPow2 = pow2.isPow2;
exports.log2 = pow2.log2;
exports.nextPow2 = pow2.nextPow2;
exports.removeItems = removeItems.removeItems;
exports.sign = sign.sign;
exports.uid = uid.uid;
exports.deprecation = deprecation.deprecation;
exports.BoundingBox = BoundingBox.BoundingBox;
exports.BaseTextureCache = caches.BaseTextureCache;
exports.ProgramCache = caches.ProgramCache;
exports.TextureCache = caches.TextureCache;
exports.clearTextureCache = caches.clearTextureCache;
exports.destroyTextureCache = caches.destroyTextureCache;
exports.CanvasRenderTarget = CanvasRenderTarget.CanvasRenderTarget;
exports.getCanvasBoundingBox = getCanvasBoundingBox.getCanvasBoundingBox;
exports.trimCanvas = trimCanvas.trimCanvas;
exports.decomposeDataUri = decomposeDataUri.decomposeDataUri;
exports.determineCrossOrigin = determineCrossOrigin.determineCrossOrigin;
exports.getResolutionOfUrl = getResolutionOfUrl.getResolutionOfUrl;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

73
resources/app/node_modules/@pixi/utils/lib/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,73 @@
import "./settings.mjs";
import { isMobile } from "@pixi/settings";
import { default as default2 } from "eventemitter3";
import { default as default3 } from "earcut";
import { url } from "./url.mjs";
import { path } from "./path.mjs";
import { detectVideoAlphaMode } from "./browser/detectVideoAlphaMode.mjs";
import { sayHello, skipHello } from "./browser/hello.mjs";
import { isWebGLSupported } from "./browser/isWebGLSupported.mjs";
import { hex2rgb, hex2string, rgb2hex, string2hex } from "./color/hex.mjs";
import { correctBlendMode, premultiplyBlendMode, premultiplyRgba, premultiplyTint, premultiplyTintToRgba } from "./color/premultiply.mjs";
import { DATA_URI } from "./const.mjs";
import { createIndicesForQuads } from "./data/createIndicesForQuads.mjs";
import { getBufferType } from "./data/getBufferType.mjs";
import { interleaveTypedArrays } from "./data/interleaveTypedArrays.mjs";
import { isPow2, log2, nextPow2 } from "./data/pow2.mjs";
import { removeItems } from "./data/removeItems.mjs";
import { sign } from "./data/sign.mjs";
import { uid } from "./data/uid.mjs";
import { deprecation } from "./logging/deprecation.mjs";
import { BoundingBox } from "./media/BoundingBox.mjs";
import { BaseTextureCache, ProgramCache, TextureCache, clearTextureCache, destroyTextureCache } from "./media/caches.mjs";
import { CanvasRenderTarget } from "./media/CanvasRenderTarget.mjs";
import { getCanvasBoundingBox } from "./media/getCanvasBoundingBox.mjs";
import { trimCanvas } from "./media/trimCanvas.mjs";
import { decomposeDataUri } from "./network/decomposeDataUri.mjs";
import { determineCrossOrigin } from "./network/determineCrossOrigin.mjs";
import { getResolutionOfUrl } from "./network/getResolutionOfUrl.mjs";
import "./types/index.mjs";
export {
BaseTextureCache,
BoundingBox,
CanvasRenderTarget,
DATA_URI,
default2 as EventEmitter,
ProgramCache,
TextureCache,
clearTextureCache,
correctBlendMode,
createIndicesForQuads,
decomposeDataUri,
deprecation,
destroyTextureCache,
detectVideoAlphaMode,
determineCrossOrigin,
default3 as earcut,
getBufferType,
getCanvasBoundingBox,
getResolutionOfUrl,
hex2rgb,
hex2string,
interleaveTypedArrays,
isMobile,
isPow2,
isWebGLSupported,
log2,
nextPow2,
path,
premultiplyBlendMode,
premultiplyRgba,
premultiplyTint,
premultiplyTintToRgba,
removeItems,
rgb2hex,
sayHello,
sign,
skipHello,
string2hex,
trimCanvas,
uid,
url
};
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,20 @@
"use strict";
const warnings = {};
function deprecation(version, message, ignoreDepth = 3) {
if (warnings[message])
return;
let stack = new Error().stack;
typeof stack > "u" ? console.warn("PixiJS Deprecation Warning: ", `${message}
Deprecated since v${version}`) : (stack = stack.split(`
`).splice(ignoreDepth).join(`
`), console.groupCollapsed ? (console.groupCollapsed(
"%cPixiJS Deprecation Warning: %c%s",
"color:#614108;background:#fffbe6",
"font-weight:normal;color:#614108;background:#fffbe6",
`${message}
Deprecated since v${version}`
), console.warn(stack), console.groupEnd()) : (console.warn("PixiJS Deprecation Warning: ", `${message}
Deprecated since v${version}`), console.warn(stack))), warnings[message] = !0;
}
exports.deprecation = deprecation;
//# sourceMappingURL=deprecation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"deprecation.js","sources":["../../src/logging/deprecation.ts"],"sourcesContent":["import type { Dict } from '../types';\n\n// A map of warning messages already fired\nconst warnings: Dict<boolean> = {};\n\n/**\n * Helper for warning developers about deprecated features & settings.\n * A stack track for warnings is given; useful for tracking-down where\n * deprecated methods/properties/classes are being used within the code.\n * @memberof PIXI.utils\n * @function deprecation\n * @param {string} version - The version where the feature became deprecated\n * @param {string} message - Message should include what is deprecated, where, and the new solution\n * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack\n * this is mostly to ignore internal deprecation calls.\n */\nexport function deprecation(version: string, message: string, ignoreDepth = 3): void\n{\n // Ignore duplicat\n if (warnings[message])\n {\n return;\n }\n\n /* eslint-disable no-console */\n let stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined')\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n }\n else\n {\n // chop off the stack trace which includes PixiJS internal calls\n stack = stack.split('\\n').splice(ignoreDepth).join('\\n');\n\n if (console.groupCollapsed)\n {\n console.groupCollapsed(\n '%cPixiJS Deprecation Warning: %c%s',\n 'color:#614108;background:#fffbe6',\n 'font-weight:normal;color:#614108;background:#fffbe6',\n `${message}\\nDeprecated since v${version}`\n );\n console.warn(stack);\n console.groupEnd();\n }\n else\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n\n warnings[message] = true;\n}\n"],"names":[],"mappings":";AAGA,MAAM,WAA0B,CAAA;AAazB,SAAS,YAAY,SAAiB,SAAiB,cAAc,GAC5E;AAEI,MAAI,SAAS,OAAO;AAEhB;AAIA,MAAA,QAAQ,IAAI,MAAQ,EAAA;AAGpB,SAAO,QAAU,MAEjB,QAAQ,KAAK,gCAAgC,GAAG,OAAO;AAAA,oBAAuB,OAAO,EAAE,KAKvF,QAAQ,MAAM,MAAM;AAAA,CAAI,EAAE,OAAO,WAAW,EAAE,KAAK;AAAA,CAAI,GAEnD,QAAQ,kBAER,QAAQ;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,OAAO;AAAA,oBAAuB,OAAO;AAAA,EAE5C,GAAA,QAAQ,KAAK,KAAK,GAClB,QAAQ,eAIR,QAAQ,KAAK,gCAAgC,GAAG,OAAO;AAAA,oBAAuB,OAAO,EAAE,GACvF,QAAQ,KAAK,KAAK,KAK1B,SAAS,OAAO,IAAI;AACxB;;"}

View File

@@ -0,0 +1,21 @@
const warnings = {};
function deprecation(version, message, ignoreDepth = 3) {
if (warnings[message])
return;
let stack = new Error().stack;
typeof stack > "u" ? console.warn("PixiJS Deprecation Warning: ", `${message}
Deprecated since v${version}`) : (stack = stack.split(`
`).splice(ignoreDepth).join(`
`), console.groupCollapsed ? (console.groupCollapsed(
"%cPixiJS Deprecation Warning: %c%s",
"color:#614108;background:#fffbe6",
"font-weight:normal;color:#614108;background:#fffbe6",
`${message}
Deprecated since v${version}`
), console.warn(stack), console.groupEnd()) : (console.warn("PixiJS Deprecation Warning: ", `${message}
Deprecated since v${version}`), console.warn(stack))), warnings[message] = !0;
}
export {
deprecation
};
//# sourceMappingURL=deprecation.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"deprecation.mjs","sources":["../../src/logging/deprecation.ts"],"sourcesContent":["import type { Dict } from '../types';\n\n// A map of warning messages already fired\nconst warnings: Dict<boolean> = {};\n\n/**\n * Helper for warning developers about deprecated features & settings.\n * A stack track for warnings is given; useful for tracking-down where\n * deprecated methods/properties/classes are being used within the code.\n * @memberof PIXI.utils\n * @function deprecation\n * @param {string} version - The version where the feature became deprecated\n * @param {string} message - Message should include what is deprecated, where, and the new solution\n * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack\n * this is mostly to ignore internal deprecation calls.\n */\nexport function deprecation(version: string, message: string, ignoreDepth = 3): void\n{\n // Ignore duplicat\n if (warnings[message])\n {\n return;\n }\n\n /* eslint-disable no-console */\n let stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined')\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n }\n else\n {\n // chop off the stack trace which includes PixiJS internal calls\n stack = stack.split('\\n').splice(ignoreDepth).join('\\n');\n\n if (console.groupCollapsed)\n {\n console.groupCollapsed(\n '%cPixiJS Deprecation Warning: %c%s',\n 'color:#614108;background:#fffbe6',\n 'font-weight:normal;color:#614108;background:#fffbe6',\n `${message}\\nDeprecated since v${version}`\n );\n console.warn(stack);\n console.groupEnd();\n }\n else\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n\n warnings[message] = true;\n}\n"],"names":[],"mappings":"AAGA,MAAM,WAA0B,CAAA;AAazB,SAAS,YAAY,SAAiB,SAAiB,cAAc,GAC5E;AAEI,MAAI,SAAS,OAAO;AAEhB;AAIA,MAAA,QAAQ,IAAI,MAAQ,EAAA;AAGpB,SAAO,QAAU,MAEjB,QAAQ,KAAK,gCAAgC,GAAG,OAAO;AAAA,oBAAuB,OAAO,EAAE,KAKvF,QAAQ,MAAM,MAAM;AAAA,CAAI,EAAE,OAAO,WAAW,EAAE,KAAK;AAAA,CAAI,GAEnD,QAAQ,kBAER,QAAQ;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,OAAO;AAAA,oBAAuB,OAAO;AAAA,EAE5C,GAAA,QAAQ,KAAK,KAAK,GAClB,QAAQ,eAIR,QAAQ,KAAK,gCAAgC,GAAG,OAAO;AAAA,oBAAuB,OAAO,EAAE,GACvF,QAAQ,KAAK,KAAK,KAK1B,SAAS,OAAO,IAAI;AACxB;"}

View File

@@ -0,0 +1,28 @@
"use strict";
const _BoundingBox = class {
/**
* @param left - The left coordinate value of the bounding box.
* @param top - The top coordinate value of the bounding box.
* @param right - The right coordinate value of the bounding box.
* @param bottom - The bottom coordinate value of the bounding box.
*/
constructor(left, top, right, bottom) {
this.left = left, this.top = top, this.right = right, this.bottom = bottom;
}
/** The width of the bounding box. */
get width() {
return this.right - this.left;
}
/** The height of the bounding box. */
get height() {
return this.bottom - this.top;
}
/** Determines whether the BoundingBox is empty. */
isEmpty() {
return this.left === this.right || this.top === this.bottom;
}
};
_BoundingBox.EMPTY = new _BoundingBox(0, 0, 0, 0);
let BoundingBox = _BoundingBox;
exports.BoundingBox = BoundingBox;
//# sourceMappingURL=BoundingBox.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BoundingBox.js","sources":["../../src/media/BoundingBox.ts"],"sourcesContent":["/**\n * A rectangular bounding box describing the boundary of an area.\n * @memberof PIXI.utils\n * @since 7.1.0\n */\nexport class BoundingBox\n{\n /** The left coordinate value of the bounding box. */\n left: number;\n /** The top coordinate value of the bounding box. */\n top: number;\n /** The right coordinate value of the bounding box. */\n right: number;\n /** The bottom coordinate value of the bounding box. */\n bottom: number;\n\n /**\n * @param left - The left coordinate value of the bounding box.\n * @param top - The top coordinate value of the bounding box.\n * @param right - The right coordinate value of the bounding box.\n * @param bottom - The bottom coordinate value of the bounding box.\n */\n constructor(left: number, top: number, right: number, bottom: number)\n {\n this.left = left;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n }\n\n /** The width of the bounding box. */\n get width(): number { return this.right - this.left; }\n /** The height of the bounding box. */\n get height(): number { return this.bottom - this.top; }\n\n /** Determines whether the BoundingBox is empty. */\n isEmpty(): boolean\n {\n return this.left === this.right || this.top === this.bottom;\n }\n\n /**\n * An empty BoundingBox.\n * @type {PIXI.utils.BoundingBox}\n */\n public static readonly EMPTY = new BoundingBox(0, 0, 0, 0);\n}\n"],"names":[],"mappings":";AAKO,MAAM,eAAN,MACP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBI,YAAY,MAAc,KAAa,OAAe,QACtD;AACS,SAAA,OAAO,MACZ,KAAK,MAAM,KACX,KAAK,QAAQ,OACb,KAAK,SAAS;AAAA,EAClB;AAAA;AAAA,EAGA,IAAI,QAAgB;AAAS,WAAA,KAAK,QAAQ,KAAK;AAAA,EAAM;AAAA;AAAA,EAErD,IAAI,SAAiB;AAAS,WAAA,KAAK,SAAS,KAAK;AAAA,EAAK;AAAA;AAAA,EAGtD,UACA;AACI,WAAO,KAAK,SAAS,KAAK,SAAS,KAAK,QAAQ,KAAK;AAAA,EACzD;AAOJ;AAzCa,aAwCc,QAAQ,IAAI,aAAY,GAAG,GAAG,GAAG,CAAC;AAxCtD,IAAM,cAAN;;"}

View File

@@ -0,0 +1,29 @@
const _BoundingBox = class {
/**
* @param left - The left coordinate value of the bounding box.
* @param top - The top coordinate value of the bounding box.
* @param right - The right coordinate value of the bounding box.
* @param bottom - The bottom coordinate value of the bounding box.
*/
constructor(left, top, right, bottom) {
this.left = left, this.top = top, this.right = right, this.bottom = bottom;
}
/** The width of the bounding box. */
get width() {
return this.right - this.left;
}
/** The height of the bounding box. */
get height() {
return this.bottom - this.top;
}
/** Determines whether the BoundingBox is empty. */
isEmpty() {
return this.left === this.right || this.top === this.bottom;
}
};
_BoundingBox.EMPTY = new _BoundingBox(0, 0, 0, 0);
let BoundingBox = _BoundingBox;
export {
BoundingBox
};
//# sourceMappingURL=BoundingBox.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BoundingBox.mjs","sources":["../../src/media/BoundingBox.ts"],"sourcesContent":["/**\n * A rectangular bounding box describing the boundary of an area.\n * @memberof PIXI.utils\n * @since 7.1.0\n */\nexport class BoundingBox\n{\n /** The left coordinate value of the bounding box. */\n left: number;\n /** The top coordinate value of the bounding box. */\n top: number;\n /** The right coordinate value of the bounding box. */\n right: number;\n /** The bottom coordinate value of the bounding box. */\n bottom: number;\n\n /**\n * @param left - The left coordinate value of the bounding box.\n * @param top - The top coordinate value of the bounding box.\n * @param right - The right coordinate value of the bounding box.\n * @param bottom - The bottom coordinate value of the bounding box.\n */\n constructor(left: number, top: number, right: number, bottom: number)\n {\n this.left = left;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n }\n\n /** The width of the bounding box. */\n get width(): number { return this.right - this.left; }\n /** The height of the bounding box. */\n get height(): number { return this.bottom - this.top; }\n\n /** Determines whether the BoundingBox is empty. */\n isEmpty(): boolean\n {\n return this.left === this.right || this.top === this.bottom;\n }\n\n /**\n * An empty BoundingBox.\n * @type {PIXI.utils.BoundingBox}\n */\n public static readonly EMPTY = new BoundingBox(0, 0, 0, 0);\n}\n"],"names":[],"mappings":"AAKO,MAAM,eAAN,MACP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBI,YAAY,MAAc,KAAa,OAAe,QACtD;AACS,SAAA,OAAO,MACZ,KAAK,MAAM,KACX,KAAK,QAAQ,OACb,KAAK,SAAS;AAAA,EAClB;AAAA;AAAA,EAGA,IAAI,QAAgB;AAAS,WAAA,KAAK,QAAQ,KAAK;AAAA,EAAM;AAAA;AAAA,EAErD,IAAI,SAAiB;AAAS,WAAA,KAAK,SAAS,KAAK;AAAA,EAAK;AAAA;AAAA,EAGtD,UACA;AACI,WAAO,KAAK,SAAS,KAAK,SAAS,KAAK,QAAQ,KAAK;AAAA,EACzD;AAOJ;AAzCa,aAwCc,QAAQ,IAAI,aAAY,GAAG,GAAG,GAAG,CAAC;AAxCtD,IAAM,cAAN;"}

View File

@@ -0,0 +1,65 @@
"use strict";
var settings = require("@pixi/settings");
class CanvasRenderTarget {
/**
* @param width - the width for the newly created canvas
* @param height - the height for the newly created canvas
* @param {number} [resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the canvas
*/
constructor(width, height, resolution) {
this._canvas = settings.settings.ADAPTER.createCanvas(), this._context = this._canvas.getContext("2d"), this.resolution = resolution || settings.settings.RESOLUTION, this.resize(width, height);
}
/**
* Clears the canvas that was created by the CanvasRenderTarget class.
* @private
*/
clear() {
this._checkDestroyed(), this._context.setTransform(1, 0, 0, 1, 0, 0), this._context.clearRect(0, 0, this._canvas.width, this._canvas.height);
}
/**
* Resizes the canvas to the specified width and height.
* @param desiredWidth - the desired width of the canvas
* @param desiredHeight - the desired height of the canvas
*/
resize(desiredWidth, desiredHeight) {
this._checkDestroyed(), this._canvas.width = Math.round(desiredWidth * this.resolution), this._canvas.height = Math.round(desiredHeight * this.resolution);
}
/** Destroys this canvas. */
destroy() {
this._context = null, this._canvas = null;
}
/**
* The width of the canvas buffer in pixels.
* @member {number}
*/
get width() {
return this._checkDestroyed(), this._canvas.width;
}
set width(val) {
this._checkDestroyed(), this._canvas.width = Math.round(val);
}
/**
* The height of the canvas buffer in pixels.
* @member {number}
*/
get height() {
return this._checkDestroyed(), this._canvas.height;
}
set height(val) {
this._checkDestroyed(), this._canvas.height = Math.round(val);
}
/** The Canvas object that belongs to this CanvasRenderTarget. */
get canvas() {
return this._checkDestroyed(), this._canvas;
}
/** A CanvasRenderingContext2D object representing a two-dimensional rendering context. */
get context() {
return this._checkDestroyed(), this._context;
}
_checkDestroyed() {
if (this._canvas === null)
throw new TypeError("The CanvasRenderTarget has already been destroyed");
}
}
exports.CanvasRenderTarget = CanvasRenderTarget;
//# sourceMappingURL=CanvasRenderTarget.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CanvasRenderTarget.js","sources":["../../src/media/CanvasRenderTarget.ts"],"sourcesContent":["import { settings } from '@pixi/settings';\n\nimport type { ICanvas, ICanvasRenderingContext2D } from '@pixi/settings';\n\n/**\n * Creates a Canvas element of the given size to be used as a target for rendering to.\n * @class\n * @memberof PIXI.utils\n */\nexport class CanvasRenderTarget\n{\n protected _canvas: ICanvas | null;\n\n protected _context: ICanvasRenderingContext2D | null;\n\n /**\n * The resolution / device pixel ratio of the canvas\n * @default 1\n */\n public resolution: number;\n\n /**\n * @param width - the width for the newly created canvas\n * @param height - the height for the newly created canvas\n * @param {number} [resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the canvas\n */\n constructor(width: number, height: number, resolution?: number)\n {\n this._canvas = settings.ADAPTER.createCanvas();\n\n this._context = this._canvas.getContext('2d');\n\n this.resolution = resolution || settings.RESOLUTION;\n\n this.resize(width, height);\n }\n\n /**\n * Clears the canvas that was created by the CanvasRenderTarget class.\n * @private\n */\n clear(): void\n {\n this._checkDestroyed();\n\n this._context.setTransform(1, 0, 0, 1, 0, 0);\n this._context.clearRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n /**\n * Resizes the canvas to the specified width and height.\n * @param desiredWidth - the desired width of the canvas\n * @param desiredHeight - the desired height of the canvas\n */\n resize(desiredWidth: number, desiredHeight: number): void\n {\n this._checkDestroyed();\n\n this._canvas.width = Math.round(desiredWidth * this.resolution);\n this._canvas.height = Math.round(desiredHeight * this.resolution);\n }\n\n /** Destroys this canvas. */\n destroy(): void\n {\n this._context = null;\n this._canvas = null;\n }\n\n /**\n * The width of the canvas buffer in pixels.\n * @member {number}\n */\n get width(): number\n {\n this._checkDestroyed();\n\n return this._canvas.width;\n }\n\n set width(val: number)\n {\n this._checkDestroyed();\n\n this._canvas.width = Math.round(val);\n }\n\n /**\n * The height of the canvas buffer in pixels.\n * @member {number}\n */\n get height(): number\n {\n this._checkDestroyed();\n\n return this._canvas.height;\n }\n\n set height(val: number)\n {\n this._checkDestroyed();\n\n this._canvas.height = Math.round(val);\n }\n\n /** The Canvas object that belongs to this CanvasRenderTarget. */\n public get canvas(): ICanvas\n {\n this._checkDestroyed();\n\n return this._canvas;\n }\n\n /** A CanvasRenderingContext2D object representing a two-dimensional rendering context. */\n public get context(): ICanvasRenderingContext2D\n {\n this._checkDestroyed();\n\n return this._context;\n }\n\n private _checkDestroyed(): asserts this is this & { _canvas: ICanvas; _context: ICanvasRenderingContext2D }\n {\n if (this._canvas === null)\n {\n if (process.env.DEBUG)\n {\n throw new TypeError('The CanvasRenderTarget has already been destroyed');\n }\n }\n }\n}\n"],"names":["settings"],"mappings":";;AASO,MAAM,mBACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBI,YAAY,OAAe,QAAgB,YAC3C;AACS,SAAA,UAAUA,kBAAS,QAAQ,gBAEhC,KAAK,WAAW,KAAK,QAAQ,WAAW,IAAI,GAE5C,KAAK,aAAa,cAAcA,SAAA,SAAS,YAEzC,KAAK,OAAO,OAAO,MAAM;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACS,SAAA,gBAAA,GAEL,KAAK,SAAS,aAAa,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAC3C,KAAK,SAAS,UAAU,GAAG,GAAG,KAAK,QAAQ,OAAO,KAAK,QAAQ,MAAM;AAAA,EACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,cAAsB,eAC7B;AACI,SAAK,gBAEL,GAAA,KAAK,QAAQ,QAAQ,KAAK,MAAM,eAAe,KAAK,UAAU,GAC9D,KAAK,QAAQ,SAAS,KAAK,MAAM,gBAAgB,KAAK,UAAU;AAAA,EACpE;AAAA;AAAA,EAGA,UACA;AACS,SAAA,WAAW,MAChB,KAAK,UAAU;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,QACJ;AACS,WAAA,KAAA,gBAAA,GAEE,KAAK,QAAQ;AAAA,EACxB;AAAA,EAEA,IAAI,MAAM,KACV;AACI,SAAK,gBAEL,GAAA,KAAK,QAAQ,QAAQ,KAAK,MAAM,GAAG;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,SACJ;AACS,WAAA,KAAA,gBAAA,GAEE,KAAK,QAAQ;AAAA,EACxB;AAAA,EAEA,IAAI,OAAO,KACX;AACI,SAAK,gBAEL,GAAA,KAAK,QAAQ,SAAS,KAAK,MAAM,GAAG;AAAA,EACxC;AAAA;AAAA,EAGA,IAAW,SACX;AACS,WAAA,KAAA,mBAEE,KAAK;AAAA,EAChB;AAAA;AAAA,EAGA,IAAW,UACX;AACS,WAAA,KAAA,mBAEE,KAAK;AAAA,EAChB;AAAA,EAEQ,kBACR;AACI,QAAI,KAAK,YAAY;AAIP,YAAA,IAAI,UAAU,mDAAmD;AAAA,EAGnF;AACJ;;"}

View File

@@ -0,0 +1,66 @@
import { settings } from "@pixi/settings";
class CanvasRenderTarget {
/**
* @param width - the width for the newly created canvas
* @param height - the height for the newly created canvas
* @param {number} [resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the canvas
*/
constructor(width, height, resolution) {
this._canvas = settings.ADAPTER.createCanvas(), this._context = this._canvas.getContext("2d"), this.resolution = resolution || settings.RESOLUTION, this.resize(width, height);
}
/**
* Clears the canvas that was created by the CanvasRenderTarget class.
* @private
*/
clear() {
this._checkDestroyed(), this._context.setTransform(1, 0, 0, 1, 0, 0), this._context.clearRect(0, 0, this._canvas.width, this._canvas.height);
}
/**
* Resizes the canvas to the specified width and height.
* @param desiredWidth - the desired width of the canvas
* @param desiredHeight - the desired height of the canvas
*/
resize(desiredWidth, desiredHeight) {
this._checkDestroyed(), this._canvas.width = Math.round(desiredWidth * this.resolution), this._canvas.height = Math.round(desiredHeight * this.resolution);
}
/** Destroys this canvas. */
destroy() {
this._context = null, this._canvas = null;
}
/**
* The width of the canvas buffer in pixels.
* @member {number}
*/
get width() {
return this._checkDestroyed(), this._canvas.width;
}
set width(val) {
this._checkDestroyed(), this._canvas.width = Math.round(val);
}
/**
* The height of the canvas buffer in pixels.
* @member {number}
*/
get height() {
return this._checkDestroyed(), this._canvas.height;
}
set height(val) {
this._checkDestroyed(), this._canvas.height = Math.round(val);
}
/** The Canvas object that belongs to this CanvasRenderTarget. */
get canvas() {
return this._checkDestroyed(), this._canvas;
}
/** A CanvasRenderingContext2D object representing a two-dimensional rendering context. */
get context() {
return this._checkDestroyed(), this._context;
}
_checkDestroyed() {
if (this._canvas === null)
throw new TypeError("The CanvasRenderTarget has already been destroyed");
}
}
export {
CanvasRenderTarget
};
//# sourceMappingURL=CanvasRenderTarget.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CanvasRenderTarget.mjs","sources":["../../src/media/CanvasRenderTarget.ts"],"sourcesContent":["import { settings } from '@pixi/settings';\n\nimport type { ICanvas, ICanvasRenderingContext2D } from '@pixi/settings';\n\n/**\n * Creates a Canvas element of the given size to be used as a target for rendering to.\n * @class\n * @memberof PIXI.utils\n */\nexport class CanvasRenderTarget\n{\n protected _canvas: ICanvas | null;\n\n protected _context: ICanvasRenderingContext2D | null;\n\n /**\n * The resolution / device pixel ratio of the canvas\n * @default 1\n */\n public resolution: number;\n\n /**\n * @param width - the width for the newly created canvas\n * @param height - the height for the newly created canvas\n * @param {number} [resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the canvas\n */\n constructor(width: number, height: number, resolution?: number)\n {\n this._canvas = settings.ADAPTER.createCanvas();\n\n this._context = this._canvas.getContext('2d');\n\n this.resolution = resolution || settings.RESOLUTION;\n\n this.resize(width, height);\n }\n\n /**\n * Clears the canvas that was created by the CanvasRenderTarget class.\n * @private\n */\n clear(): void\n {\n this._checkDestroyed();\n\n this._context.setTransform(1, 0, 0, 1, 0, 0);\n this._context.clearRect(0, 0, this._canvas.width, this._canvas.height);\n }\n\n /**\n * Resizes the canvas to the specified width and height.\n * @param desiredWidth - the desired width of the canvas\n * @param desiredHeight - the desired height of the canvas\n */\n resize(desiredWidth: number, desiredHeight: number): void\n {\n this._checkDestroyed();\n\n this._canvas.width = Math.round(desiredWidth * this.resolution);\n this._canvas.height = Math.round(desiredHeight * this.resolution);\n }\n\n /** Destroys this canvas. */\n destroy(): void\n {\n this._context = null;\n this._canvas = null;\n }\n\n /**\n * The width of the canvas buffer in pixels.\n * @member {number}\n */\n get width(): number\n {\n this._checkDestroyed();\n\n return this._canvas.width;\n }\n\n set width(val: number)\n {\n this._checkDestroyed();\n\n this._canvas.width = Math.round(val);\n }\n\n /**\n * The height of the canvas buffer in pixels.\n * @member {number}\n */\n get height(): number\n {\n this._checkDestroyed();\n\n return this._canvas.height;\n }\n\n set height(val: number)\n {\n this._checkDestroyed();\n\n this._canvas.height = Math.round(val);\n }\n\n /** The Canvas object that belongs to this CanvasRenderTarget. */\n public get canvas(): ICanvas\n {\n this._checkDestroyed();\n\n return this._canvas;\n }\n\n /** A CanvasRenderingContext2D object representing a two-dimensional rendering context. */\n public get context(): ICanvasRenderingContext2D\n {\n this._checkDestroyed();\n\n return this._context;\n }\n\n private _checkDestroyed(): asserts this is this & { _canvas: ICanvas; _context: ICanvasRenderingContext2D }\n {\n if (this._canvas === null)\n {\n if (process.env.DEBUG)\n {\n throw new TypeError('The CanvasRenderTarget has already been destroyed');\n }\n }\n }\n}\n"],"names":[],"mappings":";AASO,MAAM,mBACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBI,YAAY,OAAe,QAAgB,YAC3C;AACS,SAAA,UAAU,SAAS,QAAQ,gBAEhC,KAAK,WAAW,KAAK,QAAQ,WAAW,IAAI,GAE5C,KAAK,aAAa,cAAc,SAAS,YAEzC,KAAK,OAAO,OAAO,MAAM;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,QACA;AACS,SAAA,gBAAA,GAEL,KAAK,SAAS,aAAa,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAC3C,KAAK,SAAS,UAAU,GAAG,GAAG,KAAK,QAAQ,OAAO,KAAK,QAAQ,MAAM;AAAA,EACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,cAAsB,eAC7B;AACI,SAAK,gBAEL,GAAA,KAAK,QAAQ,QAAQ,KAAK,MAAM,eAAe,KAAK,UAAU,GAC9D,KAAK,QAAQ,SAAS,KAAK,MAAM,gBAAgB,KAAK,UAAU;AAAA,EACpE;AAAA;AAAA,EAGA,UACA;AACS,SAAA,WAAW,MAChB,KAAK,UAAU;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,QACJ;AACS,WAAA,KAAA,gBAAA,GAEE,KAAK,QAAQ;AAAA,EACxB;AAAA,EAEA,IAAI,MAAM,KACV;AACI,SAAK,gBAEL,GAAA,KAAK,QAAQ,QAAQ,KAAK,MAAM,GAAG;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,SACJ;AACS,WAAA,KAAA,gBAAA,GAEE,KAAK,QAAQ;AAAA,EACxB;AAAA,EAEA,IAAI,OAAO,KACX;AACI,SAAK,gBAEL,GAAA,KAAK,QAAQ,SAAS,KAAK,MAAM,GAAG;AAAA,EACxC;AAAA;AAAA,EAGA,IAAW,SACX;AACS,WAAA,KAAA,mBAEE,KAAK;AAAA,EAChB;AAAA;AAAA,EAGA,IAAW,UACX;AACS,WAAA,KAAA,mBAEE,KAAK;AAAA,EAChB;AAAA,EAEQ,kBACR;AACI,QAAI,KAAK,YAAY;AAIP,YAAA,IAAI,UAAU,mDAAmD;AAAA,EAGnF;AACJ;"}

View File

@@ -0,0 +1,22 @@
"use strict";
const ProgramCache = {}, TextureCache = /* @__PURE__ */ Object.create(null), BaseTextureCache = /* @__PURE__ */ Object.create(null);
function destroyTextureCache() {
let key;
for (key in TextureCache)
TextureCache[key].destroy();
for (key in BaseTextureCache)
BaseTextureCache[key].destroy();
}
function clearTextureCache() {
let key;
for (key in TextureCache)
delete TextureCache[key];
for (key in BaseTextureCache)
delete BaseTextureCache[key];
}
exports.BaseTextureCache = BaseTextureCache;
exports.ProgramCache = ProgramCache;
exports.TextureCache = TextureCache;
exports.clearTextureCache = clearTextureCache;
exports.destroyTextureCache = destroyTextureCache;
//# sourceMappingURL=caches.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"caches.js","sources":["../../src/media/caches.ts"],"sourcesContent":["import type { BaseTexture, Program, Texture } from '@pixi/core';\n\n/**\n * @todo Describe property usage\n * @static\n * @name ProgramCache\n * @memberof PIXI.utils\n * @type {Record<string, Program>}\n */\nexport const ProgramCache: {[key: string]: Program} = {};\n\n/**\n * @todo Describe property usage\n * @static\n * @name TextureCache\n * @memberof PIXI.utils\n * @type {Record<string, Texture>}\n */\nexport const TextureCache: {[key: string]: Texture} = Object.create(null);\n\n/**\n * @todo Describe property usage\n * @static\n * @name BaseTextureCache\n * @memberof PIXI.utils\n * @type {Record<string, BaseTexture>}\n */\nexport const BaseTextureCache: {[key: string]: BaseTexture} = Object.create(null);\n\n/**\n * Destroys all texture in the cache\n * @memberof PIXI.utils\n * @function destroyTextureCache\n */\nexport function destroyTextureCache(): void\n{\n let key;\n\n for (key in TextureCache)\n {\n TextureCache[key].destroy();\n }\n for (key in BaseTextureCache)\n {\n BaseTextureCache[key].destroy();\n }\n}\n\n/**\n * Removes all textures from cache, but does not destroy them\n * @memberof PIXI.utils\n * @function clearTextureCache\n */\nexport function clearTextureCache(): void\n{\n let key;\n\n for (key in TextureCache)\n {\n delete TextureCache[key];\n }\n for (key in BaseTextureCache)\n {\n delete BaseTextureCache[key];\n }\n}\n"],"names":[],"mappings":";AASa,MAAA,eAAyC,CAAC,GAS1C,eAAyC,uBAAO,OAAO,IAAI,GAS3D,mBAAwD,uBAAA,OAAO,IAAI;AAOzE,SAAS,sBAChB;AACQ,MAAA;AAEJ,OAAK,OAAO;AAEK,iBAAA,GAAG,EAAE;AAEtB,OAAK,OAAO;AAES,qBAAA,GAAG,EAAE;AAE9B;AAOO,SAAS,oBAChB;AACQ,MAAA;AAEJ,OAAK,OAAO;AAER,WAAO,aAAa,GAAG;AAE3B,OAAK,OAAO;AAER,WAAO,iBAAiB,GAAG;AAEnC;;;;;;"}

View File

@@ -0,0 +1,23 @@
const ProgramCache = {}, TextureCache = /* @__PURE__ */ Object.create(null), BaseTextureCache = /* @__PURE__ */ Object.create(null);
function destroyTextureCache() {
let key;
for (key in TextureCache)
TextureCache[key].destroy();
for (key in BaseTextureCache)
BaseTextureCache[key].destroy();
}
function clearTextureCache() {
let key;
for (key in TextureCache)
delete TextureCache[key];
for (key in BaseTextureCache)
delete BaseTextureCache[key];
}
export {
BaseTextureCache,
ProgramCache,
TextureCache,
clearTextureCache,
destroyTextureCache
};
//# sourceMappingURL=caches.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"caches.mjs","sources":["../../src/media/caches.ts"],"sourcesContent":["import type { BaseTexture, Program, Texture } from '@pixi/core';\n\n/**\n * @todo Describe property usage\n * @static\n * @name ProgramCache\n * @memberof PIXI.utils\n * @type {Record<string, Program>}\n */\nexport const ProgramCache: {[key: string]: Program} = {};\n\n/**\n * @todo Describe property usage\n * @static\n * @name TextureCache\n * @memberof PIXI.utils\n * @type {Record<string, Texture>}\n */\nexport const TextureCache: {[key: string]: Texture} = Object.create(null);\n\n/**\n * @todo Describe property usage\n * @static\n * @name BaseTextureCache\n * @memberof PIXI.utils\n * @type {Record<string, BaseTexture>}\n */\nexport const BaseTextureCache: {[key: string]: BaseTexture} = Object.create(null);\n\n/**\n * Destroys all texture in the cache\n * @memberof PIXI.utils\n * @function destroyTextureCache\n */\nexport function destroyTextureCache(): void\n{\n let key;\n\n for (key in TextureCache)\n {\n TextureCache[key].destroy();\n }\n for (key in BaseTextureCache)\n {\n BaseTextureCache[key].destroy();\n }\n}\n\n/**\n * Removes all textures from cache, but does not destroy them\n * @memberof PIXI.utils\n * @function clearTextureCache\n */\nexport function clearTextureCache(): void\n{\n let key;\n\n for (key in TextureCache)\n {\n delete TextureCache[key];\n }\n for (key in BaseTextureCache)\n {\n delete BaseTextureCache[key];\n }\n}\n"],"names":[],"mappings":"AASa,MAAA,eAAyC,CAAC,GAS1C,eAAyC,uBAAO,OAAO,IAAI,GAS3D,mBAAwD,uBAAA,OAAO,IAAI;AAOzE,SAAS,sBAChB;AACQ,MAAA;AAEJ,OAAK,OAAO;AAEK,iBAAA,GAAG,EAAE;AAEtB,OAAK,OAAO;AAES,qBAAA,GAAG,EAAE;AAE9B;AAOO,SAAS,oBAChB;AACQ,MAAA;AAEJ,OAAK,OAAO;AAER,WAAO,aAAa,GAAG;AAE3B,OAAK,OAAO;AAER,WAAO,iBAAiB,GAAG;AAEnC;"}

View File

@@ -0,0 +1,37 @@
"use strict";
var BoundingBox = require("./BoundingBox.js");
function checkRow(data, width, y) {
for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4)
if (data[index + 3] !== 0)
return !1;
return !0;
}
function checkColumn(data, width, x, top, bottom) {
const stride = 4 * width;
for (let y = top, index = top * stride + 4 * x; y <= bottom; ++y, index += stride)
if (data[index + 3] !== 0)
return !1;
return !0;
}
function getCanvasBoundingBox(canvas) {
const { width, height } = canvas, context = canvas.getContext("2d", {
willReadFrequently: !0
});
if (context === null)
throw new TypeError("Failed to get canvas 2D context");
const data = context.getImageData(0, 0, width, height).data;
let left = 0, top = 0, right = width - 1, bottom = height - 1;
for (; top < height && checkRow(data, width, top); )
++top;
if (top === height)
return BoundingBox.BoundingBox.EMPTY;
for (; checkRow(data, width, bottom); )
--bottom;
for (; checkColumn(data, width, left, top, bottom); )
++left;
for (; checkColumn(data, width, right, top, bottom); )
--right;
return ++right, ++bottom, new BoundingBox.BoundingBox(left, top, right, bottom);
}
exports.getCanvasBoundingBox = getCanvasBoundingBox;
//# sourceMappingURL=getCanvasBoundingBox.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getCanvasBoundingBox.js","sources":["../../src/media/getCanvasBoundingBox.ts"],"sourcesContent":["import { BoundingBox } from './BoundingBox';\n\nimport type { ICanvas } from '@pixi/settings';\n\nfunction checkRow(data: Uint8ClampedArray, width: number, y: number)\n{\n for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4)\n {\n if (data[index + 3] !== 0) return false;\n }\n\n return true;\n}\n\nfunction checkColumn(data: Uint8ClampedArray, width: number, x: number, top: number, bottom: number)\n{\n const stride = 4 * width;\n\n for (let y = top, index = (top * stride) + (4 * x); y <= bottom; ++y, index += stride)\n {\n if (data[index + 3] !== 0) return false;\n }\n\n return true;\n}\n\n/**\n * Measuring the bounds of a canvas' visible (non-transparent) pixels.\n * @memberof PIXI.utils\n * @param {PIXI.ICanvas} canvas - The canvas to measure.\n * @returns {PIXI.utils.BoundingBox} The bounding box of the canvas' visible pixels.\n * @since 7.1.0\n */\nexport function getCanvasBoundingBox(canvas: ICanvas): BoundingBox\n{\n // https://gist.github.com/timdown/021d9c8f2aabc7092df564996f5afbbf\n\n const { width, height } = canvas;\n\n const context = canvas.getContext('2d', {\n willReadFrequently: true,\n });\n\n if (context === null)\n {\n throw new TypeError('Failed to get canvas 2D context');\n }\n\n const imageData = context.getImageData(0, 0, width, height);\n const data = imageData.data;\n\n let left = 0;\n let top = 0;\n let right = width - 1;\n let bottom = height - 1;\n\n while (top < height && checkRow(data, width, top)) ++top;\n if (top === height) return BoundingBox.EMPTY;\n while (checkRow(data, width, bottom)) --bottom;\n while (checkColumn(data, width, left, top, bottom)) ++left;\n while (checkColumn(data, width, right, top, bottom)) --right;\n\n ++right;\n ++bottom;\n\n return new BoundingBox(left, top, right, bottom);\n}\n"],"names":["BoundingBox"],"mappings":";;AAIA,SAAS,SAAS,MAAyB,OAAe,GAC1D;AACa,WAAA,IAAI,GAAG,QAAQ,IAAI,IAAI,OAAO,IAAI,OAAO,EAAE,GAAG,SAAS;AAExD,QAAA,KAAK,QAAQ,CAAC,MAAM;AAAU,aAAA;AAG/B,SAAA;AACX;AAEA,SAAS,YAAY,MAAyB,OAAe,GAAW,KAAa,QACrF;AACI,QAAM,SAAS,IAAI;AAEV,WAAA,IAAI,KAAK,QAAS,MAAM,SAAW,IAAI,GAAI,KAAK,QAAQ,EAAE,GAAG,SAAS;AAEvE,QAAA,KAAK,QAAQ,CAAC,MAAM;AAAU,aAAA;AAG/B,SAAA;AACX;AASO,SAAS,qBAAqB,QACrC;AAGU,QAAA,EAAE,OAAO,WAAW,QAEpB,UAAU,OAAO,WAAW,MAAM;AAAA,IACpC,oBAAoB;AAAA,EAAA,CACvB;AAED,MAAI,YAAY;AAEN,UAAA,IAAI,UAAU,iCAAiC;AAIzD,QAAM,OADY,QAAQ,aAAa,GAAG,GAAG,OAAO,MAAM,EACnC;AAEnB,MAAA,OAAO,GACP,MAAM,GACN,QAAQ,QAAQ,GAChB,SAAS,SAAS;AAEtB,SAAO,MAAM,UAAU,SAAS,MAAM,OAAO,GAAG;AAAK,MAAA;AACrD,MAAI,QAAQ;AAAQ,WAAOA,YAAAA,YAAY;AAChC,SAAA,SAAS,MAAM,OAAO,MAAM;AAAK,MAAA;AACxC,SAAO,YAAY,MAAM,OAAO,MAAM,KAAK,MAAM;AAAK,MAAA;AACtD,SAAO,YAAY,MAAM,OAAO,OAAO,KAAK,MAAM;AAAK,MAAA;AAErD,SAAA,EAAA,OACF,EAAE,QAEK,IAAIA,YAAAA,YAAY,MAAM,KAAK,OAAO,MAAM;AACnD;;"}

View File

@@ -0,0 +1,38 @@
import { BoundingBox } from "./BoundingBox.mjs";
function checkRow(data, width, y) {
for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4)
if (data[index + 3] !== 0)
return !1;
return !0;
}
function checkColumn(data, width, x, top, bottom) {
const stride = 4 * width;
for (let y = top, index = top * stride + 4 * x; y <= bottom; ++y, index += stride)
if (data[index + 3] !== 0)
return !1;
return !0;
}
function getCanvasBoundingBox(canvas) {
const { width, height } = canvas, context = canvas.getContext("2d", {
willReadFrequently: !0
});
if (context === null)
throw new TypeError("Failed to get canvas 2D context");
const data = context.getImageData(0, 0, width, height).data;
let left = 0, top = 0, right = width - 1, bottom = height - 1;
for (; top < height && checkRow(data, width, top); )
++top;
if (top === height)
return BoundingBox.EMPTY;
for (; checkRow(data, width, bottom); )
--bottom;
for (; checkColumn(data, width, left, top, bottom); )
++left;
for (; checkColumn(data, width, right, top, bottom); )
--right;
return ++right, ++bottom, new BoundingBox(left, top, right, bottom);
}
export {
getCanvasBoundingBox
};
//# sourceMappingURL=getCanvasBoundingBox.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getCanvasBoundingBox.mjs","sources":["../../src/media/getCanvasBoundingBox.ts"],"sourcesContent":["import { BoundingBox } from './BoundingBox';\n\nimport type { ICanvas } from '@pixi/settings';\n\nfunction checkRow(data: Uint8ClampedArray, width: number, y: number)\n{\n for (let x = 0, index = 4 * y * width; x < width; ++x, index += 4)\n {\n if (data[index + 3] !== 0) return false;\n }\n\n return true;\n}\n\nfunction checkColumn(data: Uint8ClampedArray, width: number, x: number, top: number, bottom: number)\n{\n const stride = 4 * width;\n\n for (let y = top, index = (top * stride) + (4 * x); y <= bottom; ++y, index += stride)\n {\n if (data[index + 3] !== 0) return false;\n }\n\n return true;\n}\n\n/**\n * Measuring the bounds of a canvas' visible (non-transparent) pixels.\n * @memberof PIXI.utils\n * @param {PIXI.ICanvas} canvas - The canvas to measure.\n * @returns {PIXI.utils.BoundingBox} The bounding box of the canvas' visible pixels.\n * @since 7.1.0\n */\nexport function getCanvasBoundingBox(canvas: ICanvas): BoundingBox\n{\n // https://gist.github.com/timdown/021d9c8f2aabc7092df564996f5afbbf\n\n const { width, height } = canvas;\n\n const context = canvas.getContext('2d', {\n willReadFrequently: true,\n });\n\n if (context === null)\n {\n throw new TypeError('Failed to get canvas 2D context');\n }\n\n const imageData = context.getImageData(0, 0, width, height);\n const data = imageData.data;\n\n let left = 0;\n let top = 0;\n let right = width - 1;\n let bottom = height - 1;\n\n while (top < height && checkRow(data, width, top)) ++top;\n if (top === height) return BoundingBox.EMPTY;\n while (checkRow(data, width, bottom)) --bottom;\n while (checkColumn(data, width, left, top, bottom)) ++left;\n while (checkColumn(data, width, right, top, bottom)) --right;\n\n ++right;\n ++bottom;\n\n return new BoundingBox(left, top, right, bottom);\n}\n"],"names":[],"mappings":";AAIA,SAAS,SAAS,MAAyB,OAAe,GAC1D;AACa,WAAA,IAAI,GAAG,QAAQ,IAAI,IAAI,OAAO,IAAI,OAAO,EAAE,GAAG,SAAS;AAExD,QAAA,KAAK,QAAQ,CAAC,MAAM;AAAU,aAAA;AAG/B,SAAA;AACX;AAEA,SAAS,YAAY,MAAyB,OAAe,GAAW,KAAa,QACrF;AACI,QAAM,SAAS,IAAI;AAEV,WAAA,IAAI,KAAK,QAAS,MAAM,SAAW,IAAI,GAAI,KAAK,QAAQ,EAAE,GAAG,SAAS;AAEvE,QAAA,KAAK,QAAQ,CAAC,MAAM;AAAU,aAAA;AAG/B,SAAA;AACX;AASO,SAAS,qBAAqB,QACrC;AAGU,QAAA,EAAE,OAAO,WAAW,QAEpB,UAAU,OAAO,WAAW,MAAM;AAAA,IACpC,oBAAoB;AAAA,EAAA,CACvB;AAED,MAAI,YAAY;AAEN,UAAA,IAAI,UAAU,iCAAiC;AAIzD,QAAM,OADY,QAAQ,aAAa,GAAG,GAAG,OAAO,MAAM,EACnC;AAEnB,MAAA,OAAO,GACP,MAAM,GACN,QAAQ,QAAQ,GAChB,SAAS,SAAS;AAEtB,SAAO,MAAM,UAAU,SAAS,MAAM,OAAO,GAAG;AAAK,MAAA;AACrD,MAAI,QAAQ;AAAQ,WAAO,YAAY;AAChC,SAAA,SAAS,MAAM,OAAO,MAAM;AAAK,MAAA;AACxC,SAAO,YAAY,MAAM,OAAO,MAAM,KAAK,MAAM;AAAK,MAAA;AACtD,SAAO,YAAY,MAAM,OAAO,OAAO,KAAK,MAAM;AAAK,MAAA;AAErD,SAAA,EAAA,OACF,EAAE,QAEK,IAAI,YAAY,MAAM,KAAK,OAAO,MAAM;AACnD;"}

View File

@@ -0,0 +1,20 @@
"use strict";
var getCanvasBoundingBox = require("./getCanvasBoundingBox.js");
function trimCanvas(canvas) {
const boundingBox = getCanvasBoundingBox.getCanvasBoundingBox(canvas), { width, height } = boundingBox;
let data = null;
if (!boundingBox.isEmpty()) {
const context = canvas.getContext("2d");
if (context === null)
throw new TypeError("Failed to get canvas 2D context");
data = context.getImageData(
boundingBox.left,
boundingBox.top,
width,
height
);
}
return { width, height, data };
}
exports.trimCanvas = trimCanvas;
//# sourceMappingURL=trimCanvas.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"trimCanvas.js","sources":["../../src/media/trimCanvas.ts"],"sourcesContent":["import { getCanvasBoundingBox } from './getCanvasBoundingBox';\n\nimport type { ICanvas } from '@pixi/settings';\n\n/**\n * Trim transparent borders from a canvas.\n * @memberof PIXI.utils\n * @param {PIXI.ICanvas} canvas - The canvas to trim.\n * @returns The trimmed canvas data.\n */\nexport function trimCanvas(canvas: ICanvas): { width: number, height: number, data: ImageData | null }\n{\n const boundingBox = getCanvasBoundingBox(canvas);\n const { width, height } = boundingBox;\n let data = null;\n\n if (!boundingBox.isEmpty())\n {\n const context = canvas.getContext('2d');\n\n if (context === null)\n {\n throw new TypeError('Failed to get canvas 2D context');\n }\n\n data = context.getImageData(\n boundingBox.left,\n boundingBox.top,\n width,\n height\n );\n }\n\n return { width, height, data };\n}\n"],"names":["getCanvasBoundingBox"],"mappings":";;AAUO,SAAS,WAAW,QAC3B;AACI,QAAM,cAAcA,qBAAAA,qBAAqB,MAAM,GACzC,EAAE,OAAO,OAAW,IAAA;AAC1B,MAAI,OAAO;AAEP,MAAA,CAAC,YAAY,WACjB;AACU,UAAA,UAAU,OAAO,WAAW,IAAI;AAEtC,QAAI,YAAY;AAEN,YAAA,IAAI,UAAU,iCAAiC;AAGzD,WAAO,QAAQ;AAAA,MACX,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,IAAA;AAAA,EAER;AAEO,SAAA,EAAE,OAAO,QAAQ;AAC5B;;"}

View File

@@ -0,0 +1,21 @@
import { getCanvasBoundingBox } from "./getCanvasBoundingBox.mjs";
function trimCanvas(canvas) {
const boundingBox = getCanvasBoundingBox(canvas), { width, height } = boundingBox;
let data = null;
if (!boundingBox.isEmpty()) {
const context = canvas.getContext("2d");
if (context === null)
throw new TypeError("Failed to get canvas 2D context");
data = context.getImageData(
boundingBox.left,
boundingBox.top,
width,
height
);
}
return { width, height, data };
}
export {
trimCanvas
};
//# sourceMappingURL=trimCanvas.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"trimCanvas.mjs","sources":["../../src/media/trimCanvas.ts"],"sourcesContent":["import { getCanvasBoundingBox } from './getCanvasBoundingBox';\n\nimport type { ICanvas } from '@pixi/settings';\n\n/**\n * Trim transparent borders from a canvas.\n * @memberof PIXI.utils\n * @param {PIXI.ICanvas} canvas - The canvas to trim.\n * @returns The trimmed canvas data.\n */\nexport function trimCanvas(canvas: ICanvas): { width: number, height: number, data: ImageData | null }\n{\n const boundingBox = getCanvasBoundingBox(canvas);\n const { width, height } = boundingBox;\n let data = null;\n\n if (!boundingBox.isEmpty())\n {\n const context = canvas.getContext('2d');\n\n if (context === null)\n {\n throw new TypeError('Failed to get canvas 2D context');\n }\n\n data = context.getImageData(\n boundingBox.left,\n boundingBox.top,\n width,\n height\n );\n }\n\n return { width, height, data };\n}\n"],"names":[],"mappings":";AAUO,SAAS,WAAW,QAC3B;AACI,QAAM,cAAc,qBAAqB,MAAM,GACzC,EAAE,OAAO,OAAW,IAAA;AAC1B,MAAI,OAAO;AAEP,MAAA,CAAC,YAAY,WACjB;AACU,UAAA,UAAU,OAAO,WAAW,IAAI;AAEtC,QAAI,YAAY;AAEN,YAAA,IAAI,UAAU,iCAAiC;AAGzD,WAAO,QAAQ;AAAA,MACX,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,IAAA;AAAA,EAER;AAEO,SAAA,EAAE,OAAO,QAAQ;AAC5B;"}

View File

@@ -0,0 +1,15 @@
"use strict";
var _const = require("../const.js");
function decomposeDataUri(dataUri) {
const dataUriMatch = _const.DATA_URI.exec(dataUri);
if (dataUriMatch)
return {
mediaType: dataUriMatch[1] ? dataUriMatch[1].toLowerCase() : void 0,
subType: dataUriMatch[2] ? dataUriMatch[2].toLowerCase() : void 0,
charset: dataUriMatch[3] ? dataUriMatch[3].toLowerCase() : void 0,
encoding: dataUriMatch[4] ? dataUriMatch[4].toLowerCase() : void 0,
data: dataUriMatch[5]
};
}
exports.decomposeDataUri = decomposeDataUri;
//# sourceMappingURL=decomposeDataUri.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"decomposeDataUri.js","sources":["../../src/network/decomposeDataUri.ts"],"sourcesContent":["import { DATA_URI } from '../const';\n\nexport interface DecomposedDataUri\n{\n mediaType?: string;\n subType?: string;\n charset?: string;\n encoding?: string;\n data?: string;\n}\n\n/**\n * @memberof PIXI.utils\n * @interface DecomposedDataUri\n */\n\n/**\n * type, eg. `image`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} mediaType\n */\n\n/**\n * Sub type, eg. `png`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} subType\n */\n\n/**\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} charset\n */\n\n/**\n * Data encoding, eg. `base64`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} encoding\n */\n\n/**\n * The actual data\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} data\n */\n\n/**\n * Split a data URI into components. Returns undefined if\n * parameter `dataUri` is not a valid data URI.\n * @memberof PIXI.utils\n * @function decomposeDataUri\n * @param {string} dataUri - the data URI to check\n * @returns {PIXI.utils.DecomposedDataUri|undefined} The decomposed data uri or undefined\n */\nexport function decomposeDataUri(dataUri: string): DecomposedDataUri | undefined\n{\n const dataUriMatch = DATA_URI.exec(dataUri);\n\n if (dataUriMatch)\n {\n return {\n mediaType: dataUriMatch[1] ? dataUriMatch[1].toLowerCase() : undefined,\n subType: dataUriMatch[2] ? dataUriMatch[2].toLowerCase() : undefined,\n charset: dataUriMatch[3] ? dataUriMatch[3].toLowerCase() : undefined,\n encoding: dataUriMatch[4] ? dataUriMatch[4].toLowerCase() : undefined,\n data: dataUriMatch[5],\n };\n }\n\n return undefined;\n}\n"],"names":["DATA_URI"],"mappings":";;AAqDO,SAAS,iBAAiB,SACjC;AACU,QAAA,eAAeA,OAAAA,SAAS,KAAK,OAAO;AAEtC,MAAA;AAEO,WAAA;AAAA,MACH,WAAW,aAAa,CAAC,IAAI,aAAa,CAAC,EAAE,YAAgB,IAAA;AAAA,MAC7D,SAAS,aAAa,CAAC,IAAI,aAAa,CAAC,EAAE,YAAgB,IAAA;AAAA,MAC3D,SAAS,aAAa,CAAC,IAAI,aAAa,CAAC,EAAE,YAAgB,IAAA;AAAA,MAC3D,UAAU,aAAa,CAAC,IAAI,aAAa,CAAC,EAAE,YAAgB,IAAA;AAAA,MAC5D,MAAM,aAAa,CAAC;AAAA,IAAA;AAKhC;;"}

View File

@@ -0,0 +1,16 @@
import { DATA_URI } from "../const.mjs";
function decomposeDataUri(dataUri) {
const dataUriMatch = DATA_URI.exec(dataUri);
if (dataUriMatch)
return {
mediaType: dataUriMatch[1] ? dataUriMatch[1].toLowerCase() : void 0,
subType: dataUriMatch[2] ? dataUriMatch[2].toLowerCase() : void 0,
charset: dataUriMatch[3] ? dataUriMatch[3].toLowerCase() : void 0,
encoding: dataUriMatch[4] ? dataUriMatch[4].toLowerCase() : void 0,
data: dataUriMatch[5]
};
}
export {
decomposeDataUri
};
//# sourceMappingURL=decomposeDataUri.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"decomposeDataUri.mjs","sources":["../../src/network/decomposeDataUri.ts"],"sourcesContent":["import { DATA_URI } from '../const';\n\nexport interface DecomposedDataUri\n{\n mediaType?: string;\n subType?: string;\n charset?: string;\n encoding?: string;\n data?: string;\n}\n\n/**\n * @memberof PIXI.utils\n * @interface DecomposedDataUri\n */\n\n/**\n * type, eg. `image`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} mediaType\n */\n\n/**\n * Sub type, eg. `png`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} subType\n */\n\n/**\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} charset\n */\n\n/**\n * Data encoding, eg. `base64`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} encoding\n */\n\n/**\n * The actual data\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} data\n */\n\n/**\n * Split a data URI into components. Returns undefined if\n * parameter `dataUri` is not a valid data URI.\n * @memberof PIXI.utils\n * @function decomposeDataUri\n * @param {string} dataUri - the data URI to check\n * @returns {PIXI.utils.DecomposedDataUri|undefined} The decomposed data uri or undefined\n */\nexport function decomposeDataUri(dataUri: string): DecomposedDataUri | undefined\n{\n const dataUriMatch = DATA_URI.exec(dataUri);\n\n if (dataUriMatch)\n {\n return {\n mediaType: dataUriMatch[1] ? dataUriMatch[1].toLowerCase() : undefined,\n subType: dataUriMatch[2] ? dataUriMatch[2].toLowerCase() : undefined,\n charset: dataUriMatch[3] ? dataUriMatch[3].toLowerCase() : undefined,\n encoding: dataUriMatch[4] ? dataUriMatch[4].toLowerCase() : undefined,\n data: dataUriMatch[5],\n };\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";AAqDO,SAAS,iBAAiB,SACjC;AACU,QAAA,eAAe,SAAS,KAAK,OAAO;AAEtC,MAAA;AAEO,WAAA;AAAA,MACH,WAAW,aAAa,CAAC,IAAI,aAAa,CAAC,EAAE,YAAgB,IAAA;AAAA,MAC7D,SAAS,aAAa,CAAC,IAAI,aAAa,CAAC,EAAE,YAAgB,IAAA;AAAA,MAC3D,SAAS,aAAa,CAAC,IAAI,aAAa,CAAC,EAAE,YAAgB,IAAA;AAAA,MAC3D,UAAU,aAAa,CAAC,IAAI,aAAa,CAAC,EAAE,YAAgB,IAAA;AAAA,MAC5D,MAAM,aAAa,CAAC;AAAA,IAAA;AAKhC;"}

View File

@@ -0,0 +1,10 @@
"use strict";
function determineCrossOrigin(url, loc = globalThis.location) {
if (url.startsWith("data:"))
return "";
loc = loc || globalThis.location;
const parsedUrl = new URL(url, document.baseURI);
return parsedUrl.hostname !== loc.hostname || parsedUrl.port !== loc.port || parsedUrl.protocol !== loc.protocol ? "anonymous" : "";
}
exports.determineCrossOrigin = determineCrossOrigin;
//# sourceMappingURL=determineCrossOrigin.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"determineCrossOrigin.js","sources":["../../src/network/determineCrossOrigin.ts"],"sourcesContent":["/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @returns {string} The crossOrigin value to use (or empty string for none).\n */\nexport function determineCrossOrigin(url: string, loc: Location = globalThis.location): string\n{\n // data: and javascript: urls are considered same-origin\n if (url.startsWith('data:'))\n {\n return '';\n }\n\n // default is window.location\n loc = loc || globalThis.location;\n\n const parsedUrl = new URL(url, document.baseURI);\n\n // if cross origin\n if (parsedUrl.hostname !== loc.hostname || parsedUrl.port !== loc.port || parsedUrl.protocol !== loc.protocol)\n {\n return 'anonymous';\n }\n\n return '';\n}\n"],"names":[],"mappings":";AAUO,SAAS,qBAAqB,KAAa,MAAgB,WAAW,UAC7E;AAEQ,MAAA,IAAI,WAAW,OAAO;AAEf,WAAA;AAIX,QAAM,OAAO,WAAW;AAExB,QAAM,YAAY,IAAI,IAAI,KAAK,SAAS,OAAO;AAG/C,SAAI,UAAU,aAAa,IAAI,YAAY,UAAU,SAAS,IAAI,QAAQ,UAAU,aAAa,IAAI,WAE1F,cAGJ;AACX;;"}

View File

@@ -0,0 +1,11 @@
function determineCrossOrigin(url, loc = globalThis.location) {
if (url.startsWith("data:"))
return "";
loc = loc || globalThis.location;
const parsedUrl = new URL(url, document.baseURI);
return parsedUrl.hostname !== loc.hostname || parsedUrl.port !== loc.port || parsedUrl.protocol !== loc.protocol ? "anonymous" : "";
}
export {
determineCrossOrigin
};
//# sourceMappingURL=determineCrossOrigin.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"determineCrossOrigin.mjs","sources":["../../src/network/determineCrossOrigin.ts"],"sourcesContent":["/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @returns {string} The crossOrigin value to use (or empty string for none).\n */\nexport function determineCrossOrigin(url: string, loc: Location = globalThis.location): string\n{\n // data: and javascript: urls are considered same-origin\n if (url.startsWith('data:'))\n {\n return '';\n }\n\n // default is window.location\n loc = loc || globalThis.location;\n\n const parsedUrl = new URL(url, document.baseURI);\n\n // if cross origin\n if (parsedUrl.hostname !== loc.hostname || parsedUrl.port !== loc.port || parsedUrl.protocol !== loc.protocol)\n {\n return 'anonymous';\n }\n\n return '';\n}\n"],"names":[],"mappings":"AAUO,SAAS,qBAAqB,KAAa,MAAgB,WAAW,UAC7E;AAEQ,MAAA,IAAI,WAAW,OAAO;AAEf,WAAA;AAIX,QAAM,OAAO,WAAW;AAExB,QAAM,YAAY,IAAI,IAAI,KAAK,SAAS,OAAO;AAG/C,SAAI,UAAU,aAAa,IAAI,YAAY,UAAU,SAAS,IAAI,QAAQ,UAAU,aAAa,IAAI,WAE1F,cAGJ;AACX;"}

View File

@@ -0,0 +1,9 @@
"use strict";
require("../settings.js");
var settings = require("@pixi/settings");
function getResolutionOfUrl(url, defaultValue = 1) {
const resolution = settings.settings.RETINA_PREFIX?.exec(url);
return resolution ? parseFloat(resolution[1]) : defaultValue;
}
exports.getResolutionOfUrl = getResolutionOfUrl;
//# sourceMappingURL=getResolutionOfUrl.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getResolutionOfUrl.js","sources":["../../src/network/getResolutionOfUrl.ts"],"sourcesContent":["import { settings } from '../settings';\n\n/**\n * get the resolution / device pixel ratio of an asset by looking for the prefix\n * used by spritesheets and image urls\n * @memberof PIXI.utils\n * @function getResolutionOfUrl\n * @param {string} url - the image path\n * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set.\n * @returns {number} resolution / device pixel ratio of an asset\n */\nexport function getResolutionOfUrl(url: string, defaultValue = 1): number\n{\n const resolution = settings.RETINA_PREFIX?.exec(url);\n\n if (resolution)\n {\n return parseFloat(resolution[1]);\n }\n\n return defaultValue;\n}\n"],"names":["settings"],"mappings":";;;AAWgB,SAAA,mBAAmB,KAAa,eAAe,GAC/D;AACI,QAAM,aAAaA,SAAA,SAAS,eAAe,KAAK,GAAG;AAEnD,SAAI,aAEO,WAAW,WAAW,CAAC,CAAC,IAG5B;AACX;;"}

View File

@@ -0,0 +1,10 @@
import "../settings.mjs";
import { settings } from "@pixi/settings";
function getResolutionOfUrl(url, defaultValue = 1) {
const resolution = settings.RETINA_PREFIX?.exec(url);
return resolution ? parseFloat(resolution[1]) : defaultValue;
}
export {
getResolutionOfUrl
};
//# sourceMappingURL=getResolutionOfUrl.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getResolutionOfUrl.mjs","sources":["../../src/network/getResolutionOfUrl.ts"],"sourcesContent":["import { settings } from '../settings';\n\n/**\n * get the resolution / device pixel ratio of an asset by looking for the prefix\n * used by spritesheets and image urls\n * @memberof PIXI.utils\n * @function getResolutionOfUrl\n * @param {string} url - the image path\n * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set.\n * @returns {number} resolution / device pixel ratio of an asset\n */\nexport function getResolutionOfUrl(url: string, defaultValue = 1): number\n{\n const resolution = settings.RETINA_PREFIX?.exec(url);\n\n if (resolution)\n {\n return parseFloat(resolution[1]);\n }\n\n return defaultValue;\n}\n"],"names":[],"mappings":";;AAWgB,SAAA,mBAAmB,KAAa,eAAe,GAC/D;AACI,QAAM,aAAa,SAAS,eAAe,KAAK,GAAG;AAEnD,SAAI,aAEO,WAAW,WAAW,CAAC,CAAC,IAG5B;AACX;"}

284
resources/app/node_modules/@pixi/utils/lib/path.js generated vendored Normal file
View File

@@ -0,0 +1,284 @@
"use strict";
var settings = require("@pixi/settings");
function assertPath(path2) {
if (typeof path2 != "string")
throw new TypeError(`Path must be a string. Received ${JSON.stringify(path2)}`);
}
function removeUrlParams(url) {
return url.split("?")[0].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) {
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, code = -1;
for (let i = 0; i <= path2.length; ++i) {
if (i < path2.length)
code = path2.charCodeAt(i);
else {
if (code === 47)
break;
code = 47;
}
if (code === 47) {
if (!(lastSlash === i - 1 || dots === 1))
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) {
const lastSlashIndex = res.lastIndexOf("/");
if (lastSlashIndex !== res.length - 1) {
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (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;
}
}
allowAboveRoot && (res.length > 0 ? res += "/.." : res = "..", lastSegmentLength = 2);
} else
res.length > 0 ? res += `/${path2.slice(lastSlash + 1, i)}` : res = path2.slice(lastSlash + 1, i), lastSegmentLength = i - lastSlash - 1;
lastSlash = i, dots = 0;
} else
code === 46 && dots !== -1 ? ++dots : dots = -1;
}
return res;
}
const path = {
/**
* Converts a path to posix format.
* @param path - The path to convert to posix
*/
toPosix(path2) {
return replaceAll(path2, "\\", "/");
},
/**
* Checks if the path is a URL e.g. http://, https://
* @param path - The path to check
*/
isUrl(path2) {
return /^https?:/.test(this.toPosix(path2));
},
/**
* Checks if the path is a data URL
* @param path - The path to check
*/
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(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(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(path2) {
assertPath(path2), path2 = this.toPosix(path2);
const matchFile = /^file:\/\/\//.exec(path2);
if (matchFile)
return matchFile[0];
const matchProtocol = /^[^/:]+:\/{0,2}/.exec(path2);
return matchProtocol ? matchProtocol[0] : "";
},
/**
* 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(url, customBaseUrl, customRootUrl) {
if (assertPath(url), this.isDataUrl(url) || this.isBlobUrl(url))
return url;
const baseUrl = removeUrlParams(this.toPosix(customBaseUrl ?? settings.settings.ADAPTER.getBaseUrl())), rootUrl = removeUrlParams(this.toPosix(customRootUrl ?? this.rootname(baseUrl)));
return url = this.toPosix(url), url.startsWith("/") ? path.join(rootUrl, url.slice(1)) : this.isAbsolute(url) ? url : this.join(baseUrl, url);
},
/**
* Normalizes the given path, resolving '..' and '.' segments
* @param path - The path to normalize
*/
normalize(path2) {
if (assertPath(path2), path2.length === 0)
return ".";
if (this.isDataUrl(path2) || this.isBlobUrl(path2))
return path2;
path2 = this.toPosix(path2);
let protocol = "";
const isAbsolute = path2.startsWith("/");
this.hasProtocol(path2) && (protocol = this.rootname(path2), path2 = path2.slice(protocol.length));
const trailingSeparator = path2.endsWith("/");
return path2 = normalizeStringPosix(path2, !1), path2.length > 0 && trailingSeparator && (path2 += "/"), isAbsolute ? `/${path2}` : 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(path2) {
return assertPath(path2), path2 = this.toPosix(path2), this.hasProtocol(path2) ? !0 : 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(...segments) {
if (segments.length === 0)
return ".";
let joined;
for (let i = 0; i < segments.length; ++i) {
const arg = segments[i];
if (assertPath(arg), arg.length > 0)
if (joined === void 0)
joined = arg;
else {
const prevArg = segments[i - 1] ?? "";
this.joinExtensions.includes(this.extname(prevArg).toLowerCase()) ? joined += `/../${arg}` : joined += `/${arg}`;
}
}
return joined === void 0 ? "." : this.normalize(joined);
},
/**
* Returns the directory name of a path
* @param path - The path to parse
*/
dirname(path2) {
if (assertPath(path2), path2.length === 0)
return ".";
path2 = this.toPosix(path2);
let code = path2.charCodeAt(0);
const hasRoot = code === 47;
let end = -1, matchedSlash = !0;
const proto = this.getProtocol(path2), origpath = path2;
path2 = path2.slice(proto.length);
for (let i = path2.length - 1; i >= 1; --i)
if (code = path2.charCodeAt(i), code === 47) {
if (!matchedSlash) {
end = i;
break;
}
} else
matchedSlash = !1;
return end === -1 ? hasRoot ? "/" : this.isUrl(origpath) ? proto + path2 : proto : hasRoot && end === 1 ? "//" : 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(path2) {
assertPath(path2), path2 = this.toPosix(path2);
let root = "";
if (path2.startsWith("/") ? root = "/" : root = this.getProtocol(path2), this.isUrl(path2)) {
const index = path2.indexOf("/", root.length);
index !== -1 ? root = path2.slice(0, index) : root = path2, 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(path2, ext) {
assertPath(path2), ext && assertPath(ext), path2 = removeUrlParams(this.toPosix(path2));
let start = 0, end = -1, matchedSlash = !0, i;
if (ext !== void 0 && ext.length > 0 && ext.length <= path2.length) {
if (ext.length === path2.length && ext === path2)
return "";
let extIdx = ext.length - 1, firstNonSlashEnd = -1;
for (i = path2.length - 1; i >= 0; --i) {
const code = path2.charCodeAt(i);
if (code === 47) {
if (!matchedSlash) {
start = i + 1;
break;
}
} else
firstNonSlashEnd === -1 && (matchedSlash = !1, firstNonSlashEnd = i + 1), extIdx >= 0 && (code === ext.charCodeAt(extIdx) ? --extIdx === -1 && (end = i) : (extIdx = -1, end = firstNonSlashEnd));
}
return start === end ? end = firstNonSlashEnd : end === -1 && (end = path2.length), path2.slice(start, end);
}
for (i = path2.length - 1; i >= 0; --i)
if (path2.charCodeAt(i) === 47) {
if (!matchedSlash) {
start = i + 1;
break;
}
} else
end === -1 && (matchedSlash = !1, end = i + 1);
return end === -1 ? "" : 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(path2) {
assertPath(path2), path2 = removeUrlParams(this.toPosix(path2));
let startDot = -1, startPart = 0, end = -1, matchedSlash = !0, preDotState = 0;
for (let i = path2.length - 1; i >= 0; --i) {
const code = path2.charCodeAt(i);
if (code === 47) {
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
end === -1 && (matchedSlash = !1, end = i + 1), code === 46 ? startDot === -1 ? startDot = i : preDotState !== 1 && (preDotState = 1) : startDot !== -1 && (preDotState = -1);
}
return startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? "" : 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(path2) {
assertPath(path2);
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
if (path2.length === 0)
return ret;
path2 = removeUrlParams(this.toPosix(path2));
let code = path2.charCodeAt(0);
const isAbsolute = this.isAbsolute(path2);
let start;
const protocol = "";
ret.root = this.rootname(path2), isAbsolute || this.hasProtocol(path2) ? start = 1 : start = 0;
let startDot = -1, startPart = 0, end = -1, matchedSlash = !0, i = path2.length - 1, preDotState = 0;
for (; i >= start; --i) {
if (code = path2.charCodeAt(i), code === 47) {
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
end === -1 && (matchedSlash = !1, end = i + 1), code === 46 ? startDot === -1 ? startDot = i : preDotState !== 1 && (preDotState = 1) : startDot !== -1 && (preDotState = -1);
}
return startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? end !== -1 && (startPart === 0 && isAbsolute ? ret.base = ret.name = path2.slice(1, end) : ret.base = ret.name = path2.slice(startPart, end)) : (startPart === 0 && isAbsolute ? (ret.name = path2.slice(1, startDot), ret.base = path2.slice(1, end)) : (ret.name = path2.slice(startPart, startDot), ret.base = path2.slice(startPart, end)), ret.ext = path2.slice(startDot, end)), ret.dir = this.dirname(path2), protocol && (ret.dir = protocol + ret.dir), ret;
},
sep: "/",
delimiter: ":",
joinExtensions: [".html"]
};
exports.path = path;
//# sourceMappingURL=path.js.map

File diff suppressed because one or more lines are too long

285
resources/app/node_modules/@pixi/utils/lib/path.mjs generated vendored Normal file
View File

@@ -0,0 +1,285 @@
import { settings } from "@pixi/settings";
function assertPath(path2) {
if (typeof path2 != "string")
throw new TypeError(`Path must be a string. Received ${JSON.stringify(path2)}`);
}
function removeUrlParams(url) {
return url.split("?")[0].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) {
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, code = -1;
for (let i = 0; i <= path2.length; ++i) {
if (i < path2.length)
code = path2.charCodeAt(i);
else {
if (code === 47)
break;
code = 47;
}
if (code === 47) {
if (!(lastSlash === i - 1 || dots === 1))
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) {
const lastSlashIndex = res.lastIndexOf("/");
if (lastSlashIndex !== res.length - 1) {
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (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;
}
}
allowAboveRoot && (res.length > 0 ? res += "/.." : res = "..", lastSegmentLength = 2);
} else
res.length > 0 ? res += `/${path2.slice(lastSlash + 1, i)}` : res = path2.slice(lastSlash + 1, i), lastSegmentLength = i - lastSlash - 1;
lastSlash = i, dots = 0;
} else
code === 46 && dots !== -1 ? ++dots : dots = -1;
}
return res;
}
const path = {
/**
* Converts a path to posix format.
* @param path - The path to convert to posix
*/
toPosix(path2) {
return replaceAll(path2, "\\", "/");
},
/**
* Checks if the path is a URL e.g. http://, https://
* @param path - The path to check
*/
isUrl(path2) {
return /^https?:/.test(this.toPosix(path2));
},
/**
* Checks if the path is a data URL
* @param path - The path to check
*/
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(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(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(path2) {
assertPath(path2), path2 = this.toPosix(path2);
const matchFile = /^file:\/\/\//.exec(path2);
if (matchFile)
return matchFile[0];
const matchProtocol = /^[^/:]+:\/{0,2}/.exec(path2);
return matchProtocol ? matchProtocol[0] : "";
},
/**
* 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(url, customBaseUrl, customRootUrl) {
if (assertPath(url), this.isDataUrl(url) || this.isBlobUrl(url))
return url;
const baseUrl = removeUrlParams(this.toPosix(customBaseUrl ?? settings.ADAPTER.getBaseUrl())), rootUrl = removeUrlParams(this.toPosix(customRootUrl ?? this.rootname(baseUrl)));
return url = this.toPosix(url), url.startsWith("/") ? path.join(rootUrl, url.slice(1)) : this.isAbsolute(url) ? url : this.join(baseUrl, url);
},
/**
* Normalizes the given path, resolving '..' and '.' segments
* @param path - The path to normalize
*/
normalize(path2) {
if (assertPath(path2), path2.length === 0)
return ".";
if (this.isDataUrl(path2) || this.isBlobUrl(path2))
return path2;
path2 = this.toPosix(path2);
let protocol = "";
const isAbsolute = path2.startsWith("/");
this.hasProtocol(path2) && (protocol = this.rootname(path2), path2 = path2.slice(protocol.length));
const trailingSeparator = path2.endsWith("/");
return path2 = normalizeStringPosix(path2, !1), path2.length > 0 && trailingSeparator && (path2 += "/"), isAbsolute ? `/${path2}` : 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(path2) {
return assertPath(path2), path2 = this.toPosix(path2), this.hasProtocol(path2) ? !0 : 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(...segments) {
if (segments.length === 0)
return ".";
let joined;
for (let i = 0; i < segments.length; ++i) {
const arg = segments[i];
if (assertPath(arg), arg.length > 0)
if (joined === void 0)
joined = arg;
else {
const prevArg = segments[i - 1] ?? "";
this.joinExtensions.includes(this.extname(prevArg).toLowerCase()) ? joined += `/../${arg}` : joined += `/${arg}`;
}
}
return joined === void 0 ? "." : this.normalize(joined);
},
/**
* Returns the directory name of a path
* @param path - The path to parse
*/
dirname(path2) {
if (assertPath(path2), path2.length === 0)
return ".";
path2 = this.toPosix(path2);
let code = path2.charCodeAt(0);
const hasRoot = code === 47;
let end = -1, matchedSlash = !0;
const proto = this.getProtocol(path2), origpath = path2;
path2 = path2.slice(proto.length);
for (let i = path2.length - 1; i >= 1; --i)
if (code = path2.charCodeAt(i), code === 47) {
if (!matchedSlash) {
end = i;
break;
}
} else
matchedSlash = !1;
return end === -1 ? hasRoot ? "/" : this.isUrl(origpath) ? proto + path2 : proto : hasRoot && end === 1 ? "//" : 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(path2) {
assertPath(path2), path2 = this.toPosix(path2);
let root = "";
if (path2.startsWith("/") ? root = "/" : root = this.getProtocol(path2), this.isUrl(path2)) {
const index = path2.indexOf("/", root.length);
index !== -1 ? root = path2.slice(0, index) : root = path2, 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(path2, ext) {
assertPath(path2), ext && assertPath(ext), path2 = removeUrlParams(this.toPosix(path2));
let start = 0, end = -1, matchedSlash = !0, i;
if (ext !== void 0 && ext.length > 0 && ext.length <= path2.length) {
if (ext.length === path2.length && ext === path2)
return "";
let extIdx = ext.length - 1, firstNonSlashEnd = -1;
for (i = path2.length - 1; i >= 0; --i) {
const code = path2.charCodeAt(i);
if (code === 47) {
if (!matchedSlash) {
start = i + 1;
break;
}
} else
firstNonSlashEnd === -1 && (matchedSlash = !1, firstNonSlashEnd = i + 1), extIdx >= 0 && (code === ext.charCodeAt(extIdx) ? --extIdx === -1 && (end = i) : (extIdx = -1, end = firstNonSlashEnd));
}
return start === end ? end = firstNonSlashEnd : end === -1 && (end = path2.length), path2.slice(start, end);
}
for (i = path2.length - 1; i >= 0; --i)
if (path2.charCodeAt(i) === 47) {
if (!matchedSlash) {
start = i + 1;
break;
}
} else
end === -1 && (matchedSlash = !1, end = i + 1);
return end === -1 ? "" : 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(path2) {
assertPath(path2), path2 = removeUrlParams(this.toPosix(path2));
let startDot = -1, startPart = 0, end = -1, matchedSlash = !0, preDotState = 0;
for (let i = path2.length - 1; i >= 0; --i) {
const code = path2.charCodeAt(i);
if (code === 47) {
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
end === -1 && (matchedSlash = !1, end = i + 1), code === 46 ? startDot === -1 ? startDot = i : preDotState !== 1 && (preDotState = 1) : startDot !== -1 && (preDotState = -1);
}
return startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? "" : 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(path2) {
assertPath(path2);
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
if (path2.length === 0)
return ret;
path2 = removeUrlParams(this.toPosix(path2));
let code = path2.charCodeAt(0);
const isAbsolute = this.isAbsolute(path2);
let start;
const protocol = "";
ret.root = this.rootname(path2), isAbsolute || this.hasProtocol(path2) ? start = 1 : start = 0;
let startDot = -1, startPart = 0, end = -1, matchedSlash = !0, i = path2.length - 1, preDotState = 0;
for (; i >= start; --i) {
if (code = path2.charCodeAt(i), code === 47) {
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
end === -1 && (matchedSlash = !1, end = i + 1), code === 46 ? startDot === -1 ? startDot = i : preDotState !== 1 && (preDotState = 1) : startDot !== -1 && (preDotState = -1);
}
return startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1 ? end !== -1 && (startPart === 0 && isAbsolute ? ret.base = ret.name = path2.slice(1, end) : ret.base = ret.name = path2.slice(startPart, end)) : (startPart === 0 && isAbsolute ? (ret.name = path2.slice(1, startDot), ret.base = path2.slice(1, end)) : (ret.name = path2.slice(startPart, startDot), ret.base = path2.slice(startPart, end)), ret.ext = path2.slice(startDot, end)), ret.dir = this.dirname(path2), protocol && (ret.dir = protocol + ret.dir), ret;
},
sep: "/",
delimiter: ":",
joinExtensions: [".html"]
};
export {
path
};
//# sourceMappingURL=path.mjs.map

File diff suppressed because one or more lines are too long

11
resources/app/node_modules/@pixi/utils/lib/settings.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
"use strict";
var settings = require("@pixi/settings");
settings.settings.RETINA_PREFIX = /@([0-9\.]+)x/;
settings.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = !1;
Object.defineProperty(exports, "settings", {
enumerable: !0,
get: function() {
return settings.settings;
}
});
//# sourceMappingURL=settings.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"settings.js","sources":["../src/settings.ts"],"sourcesContent":["import { settings } from '@pixi/settings';\n\n/**\n * The prefix that denotes a URL is for a retina asset.\n * @static\n * @name RETINA_PREFIX\n * @memberof PIXI.settings\n * @type {RegExp}\n * @default /@([0-9\\.]+)x/\n * @example `@2x`\n */\nsettings.RETINA_PREFIX = /@([0-9\\.]+)x/;\n\n/**\n * Should the `failIfMajorPerformanceCaveat` flag be enabled as a context option used in the `isWebGLSupported` function.\n * If set to true, a WebGL renderer can fail to be created if the browser thinks there could be performance issues when\n * using WebGL.\n *\n * In PixiJS v6 this has changed from true to false by default, to allow WebGL to work in as many scenarios as possible.\n * However, some users may have a poor experience, for example, if a user has a gpu or driver version blacklisted by the\n * browser.\n *\n * If your application requires high performance rendering, you may wish to set this to false.\n * We recommend one of two options if you decide to set this flag to false:\n *\n * 1: Use the `pixi.js-legacy` package, which includes a Canvas renderer as a fallback in case high performance WebGL is\n * not supported.\n *\n * 2: Call `isWebGLSupported` (which if found in the PIXI.utils package) in your code before attempting to create a PixiJS\n * renderer, and show an error message to the user if the function returns false, explaining that their device & browser\n * combination does not support high performance WebGL.\n * This is a much better strategy than trying to create a PixiJS renderer and finding it then fails.\n * @static\n * @name FAIL_IF_MAJOR_PERFORMANCE_CAVEAT\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\nsettings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = false;\n\nexport { settings };\n"],"names":["settings"],"mappings":";;AAWAA,SAAAA,SAAS,gBAAgB;AA2BzBA,SAAAA,SAAS,mCAAmC;;;;;;;"}

View File

@@ -0,0 +1,8 @@
import { settings } from "@pixi/settings";
import { settings as settings2 } from "@pixi/settings";
settings.RETINA_PREFIX = /@([0-9\.]+)x/;
settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = !1;
export {
settings2 as settings
};
//# sourceMappingURL=settings.mjs.map

Some files were not shown because too many files have changed in this diff Show More